1 /* Generated by Cython 0.29.24 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "define_macros": [
7             [
8                 "CYTHON_TRACE_NOGIL",
9                 "0"
10             ],
11             [
12                 "NPY_NO_DEPRECATED_API",
13                 "NPY_1_7_API_VERSION"
14             ]
15         ],
16         "depends": [
17             "C:\\Anaconda\\lib\\site-packages\\numpy\\core\\include\\numpy\\arrayobject.h",
18             "C:\\Anaconda\\lib\\site-packages\\numpy\\core\\include\\numpy\\arrayscalars.h",
19             "C:\\Anaconda\\lib\\site-packages\\numpy\\core\\include\\numpy\\ndarrayobject.h",
20             "C:\\Anaconda\\lib\\site-packages\\numpy\\core\\include\\numpy\\ndarraytypes.h",
21             "C:\\Anaconda\\lib\\site-packages\\numpy\\core\\include\\numpy\\ufuncobject.h"
22         ],
23         "include_dirs": [
24             "C:\\Anaconda\\lib\\site-packages\\numpy\\core\\include",
25             "C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include"
26         ],
27         "libraries": [
28             "npymath"
29         ],
30         "library_dirs": [
31             "C:\\\\Anaconda\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\lib"
32         ],
33         "name": "statsmodels.tsa.holtwinters._exponential_smoothers",
34         "sources": [
35             "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx"
36         ]
37     },
38     "module_name": "statsmodels.tsa.holtwinters._exponential_smoothers"
39 }
40 END: Cython Metadata */
41 
42 #ifndef PY_SSIZE_T_CLEAN
43 #define PY_SSIZE_T_CLEAN
44 #endif /* PY_SSIZE_T_CLEAN */
45 #include "Python.h"
46 #ifndef Py_PYTHON_H
47     #error Python headers needed to compile C extensions, please install development version of Python.
48 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
49     #error Cython requires Python 2.6+ or Python 3.3+.
50 #else
51 #define CYTHON_ABI "0_29_24"
52 #define CYTHON_HEX_VERSION 0x001D18F0
53 #define CYTHON_FUTURE_DIVISION 1
54 #include <stddef.h>
55 #ifndef offsetof
56   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
57 #endif
58 #if !defined(WIN32) && !defined(MS_WINDOWS)
59   #ifndef __stdcall
60     #define __stdcall
61   #endif
62   #ifndef __cdecl
63     #define __cdecl
64   #endif
65   #ifndef __fastcall
66     #define __fastcall
67   #endif
68 #endif
69 #ifndef DL_IMPORT
70   #define DL_IMPORT(t) t
71 #endif
72 #ifndef DL_EXPORT
73   #define DL_EXPORT(t) t
74 #endif
75 #define __PYX_COMMA ,
76 #ifndef HAVE_LONG_LONG
77   #if PY_VERSION_HEX >= 0x02070000
78     #define HAVE_LONG_LONG
79   #endif
80 #endif
81 #ifndef PY_LONG_LONG
82   #define PY_LONG_LONG LONG_LONG
83 #endif
84 #ifndef Py_HUGE_VAL
85   #define Py_HUGE_VAL HUGE_VAL
86 #endif
87 #ifdef PYPY_VERSION
88   #define CYTHON_COMPILING_IN_PYPY 1
89   #define CYTHON_COMPILING_IN_PYSTON 0
90   #define CYTHON_COMPILING_IN_CPYTHON 0
91   #undef CYTHON_USE_TYPE_SLOTS
92   #define CYTHON_USE_TYPE_SLOTS 0
93   #undef CYTHON_USE_PYTYPE_LOOKUP
94   #define CYTHON_USE_PYTYPE_LOOKUP 0
95   #if PY_VERSION_HEX < 0x03050000
96     #undef CYTHON_USE_ASYNC_SLOTS
97     #define CYTHON_USE_ASYNC_SLOTS 0
98   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
99     #define CYTHON_USE_ASYNC_SLOTS 1
100   #endif
101   #undef CYTHON_USE_PYLIST_INTERNALS
102   #define CYTHON_USE_PYLIST_INTERNALS 0
103   #undef CYTHON_USE_UNICODE_INTERNALS
104   #define CYTHON_USE_UNICODE_INTERNALS 0
105   #undef CYTHON_USE_UNICODE_WRITER
106   #define CYTHON_USE_UNICODE_WRITER 0
107   #undef CYTHON_USE_PYLONG_INTERNALS
108   #define CYTHON_USE_PYLONG_INTERNALS 0
109   #undef CYTHON_AVOID_BORROWED_REFS
110   #define CYTHON_AVOID_BORROWED_REFS 1
111   #undef CYTHON_ASSUME_SAFE_MACROS
112   #define CYTHON_ASSUME_SAFE_MACROS 0
113   #undef CYTHON_UNPACK_METHODS
114   #define CYTHON_UNPACK_METHODS 0
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 #elif defined(PYSTON_VERSION)
128   #define CYTHON_COMPILING_IN_PYPY 0
129   #define CYTHON_COMPILING_IN_PYSTON 1
130   #define CYTHON_COMPILING_IN_CPYTHON 0
131   #ifndef CYTHON_USE_TYPE_SLOTS
132     #define CYTHON_USE_TYPE_SLOTS 1
133   #endif
134   #undef CYTHON_USE_PYTYPE_LOOKUP
135   #define CYTHON_USE_PYTYPE_LOOKUP 0
136   #undef CYTHON_USE_ASYNC_SLOTS
137   #define CYTHON_USE_ASYNC_SLOTS 0
138   #undef CYTHON_USE_PYLIST_INTERNALS
139   #define CYTHON_USE_PYLIST_INTERNALS 0
140   #ifndef CYTHON_USE_UNICODE_INTERNALS
141     #define CYTHON_USE_UNICODE_INTERNALS 1
142   #endif
143   #undef CYTHON_USE_UNICODE_WRITER
144   #define CYTHON_USE_UNICODE_WRITER 0
145   #undef CYTHON_USE_PYLONG_INTERNALS
146   #define CYTHON_USE_PYLONG_INTERNALS 0
147   #ifndef CYTHON_AVOID_BORROWED_REFS
148     #define CYTHON_AVOID_BORROWED_REFS 0
149   #endif
150   #ifndef CYTHON_ASSUME_SAFE_MACROS
151     #define CYTHON_ASSUME_SAFE_MACROS 1
152   #endif
153   #ifndef CYTHON_UNPACK_METHODS
154     #define CYTHON_UNPACK_METHODS 1
155   #endif
156   #undef CYTHON_FAST_THREAD_STATE
157   #define CYTHON_FAST_THREAD_STATE 0
158   #undef CYTHON_FAST_PYCALL
159   #define CYTHON_FAST_PYCALL 0
160   #undef CYTHON_PEP489_MULTI_PHASE_INIT
161   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
162   #undef CYTHON_USE_TP_FINALIZE
163   #define CYTHON_USE_TP_FINALIZE 0
164   #undef CYTHON_USE_DICT_VERSIONS
165   #define CYTHON_USE_DICT_VERSIONS 0
166   #undef CYTHON_USE_EXC_INFO_STACK
167   #define CYTHON_USE_EXC_INFO_STACK 0
168 #else
169   #define CYTHON_COMPILING_IN_PYPY 0
170   #define CYTHON_COMPILING_IN_PYSTON 0
171   #define CYTHON_COMPILING_IN_CPYTHON 1
172   #ifndef CYTHON_USE_TYPE_SLOTS
173     #define CYTHON_USE_TYPE_SLOTS 1
174   #endif
175   #if PY_VERSION_HEX < 0x02070000
176     #undef CYTHON_USE_PYTYPE_LOOKUP
177     #define CYTHON_USE_PYTYPE_LOOKUP 0
178   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
179     #define CYTHON_USE_PYTYPE_LOOKUP 1
180   #endif
181   #if PY_MAJOR_VERSION < 3
182     #undef CYTHON_USE_ASYNC_SLOTS
183     #define CYTHON_USE_ASYNC_SLOTS 0
184   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
185     #define CYTHON_USE_ASYNC_SLOTS 1
186   #endif
187   #if PY_VERSION_HEX < 0x02070000
188     #undef CYTHON_USE_PYLONG_INTERNALS
189     #define CYTHON_USE_PYLONG_INTERNALS 0
190   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
191     #define CYTHON_USE_PYLONG_INTERNALS 1
192   #endif
193   #ifndef CYTHON_USE_PYLIST_INTERNALS
194     #define CYTHON_USE_PYLIST_INTERNALS 1
195   #endif
196   #ifndef CYTHON_USE_UNICODE_INTERNALS
197     #define CYTHON_USE_UNICODE_INTERNALS 1
198   #endif
199   #if PY_VERSION_HEX < 0x030300F0
200     #undef CYTHON_USE_UNICODE_WRITER
201     #define CYTHON_USE_UNICODE_WRITER 0
202   #elif !defined(CYTHON_USE_UNICODE_WRITER)
203     #define CYTHON_USE_UNICODE_WRITER 1
204   #endif
205   #ifndef CYTHON_AVOID_BORROWED_REFS
206     #define CYTHON_AVOID_BORROWED_REFS 0
207   #endif
208   #ifndef CYTHON_ASSUME_SAFE_MACROS
209     #define CYTHON_ASSUME_SAFE_MACROS 1
210   #endif
211   #ifndef CYTHON_UNPACK_METHODS
212     #define CYTHON_UNPACK_METHODS 1
213   #endif
214   #ifndef CYTHON_FAST_THREAD_STATE
215     #define CYTHON_FAST_THREAD_STATE 1
216   #endif
217   #ifndef CYTHON_FAST_PYCALL
218     #define CYTHON_FAST_PYCALL 1
219   #endif
220   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
221     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
222   #endif
223   #ifndef CYTHON_USE_TP_FINALIZE
224     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
225   #endif
226   #ifndef CYTHON_USE_DICT_VERSIONS
227     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
228   #endif
229   #ifndef CYTHON_USE_EXC_INFO_STACK
230     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
231   #endif
232 #endif
233 #if !defined(CYTHON_FAST_PYCCALL)
234 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
235 #endif
236 #if CYTHON_USE_PYLONG_INTERNALS
237   #include "longintrepr.h"
238   #undef SHIFT
239   #undef BASE
240   #undef MASK
241   #ifdef SIZEOF_VOID_P
242     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
243   #endif
244 #endif
245 #ifndef __has_attribute
246   #define __has_attribute(x) 0
247 #endif
248 #ifndef __has_cpp_attribute
249   #define __has_cpp_attribute(x) 0
250 #endif
251 #ifndef CYTHON_RESTRICT
252   #if defined(__GNUC__)
253     #define CYTHON_RESTRICT __restrict__
254   #elif defined(_MSC_VER) && _MSC_VER >= 1400
255     #define CYTHON_RESTRICT __restrict
256   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
257     #define CYTHON_RESTRICT restrict
258   #else
259     #define CYTHON_RESTRICT
260   #endif
261 #endif
262 #ifndef CYTHON_UNUSED
263 # if defined(__GNUC__)
264 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
265 #     define CYTHON_UNUSED __attribute__ ((__unused__))
266 #   else
267 #     define CYTHON_UNUSED
268 #   endif
269 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
270 #   define CYTHON_UNUSED __attribute__ ((__unused__))
271 # else
272 #   define CYTHON_UNUSED
273 # endif
274 #endif
275 #ifndef CYTHON_MAYBE_UNUSED_VAR
276 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)277      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
278 #  else
279 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
280 #  endif
281 #endif
282 #ifndef CYTHON_NCP_UNUSED
283 # if CYTHON_COMPILING_IN_CPYTHON
284 #  define CYTHON_NCP_UNUSED
285 # else
286 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
287 # endif
288 #endif
289 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
290 #ifdef _MSC_VER
291     #ifndef _MSC_STDINT_H_
292         #if _MSC_VER < 1300
293            typedef unsigned char     uint8_t;
294            typedef unsigned int      uint32_t;
295         #else
296            typedef unsigned __int8   uint8_t;
297            typedef unsigned __int32  uint32_t;
298         #endif
299     #endif
300 #else
301    #include <stdint.h>
302 #endif
303 #ifndef CYTHON_FALLTHROUGH
304   #if defined(__cplusplus) && __cplusplus >= 201103L
305     #if __has_cpp_attribute(fallthrough)
306       #define CYTHON_FALLTHROUGH [[fallthrough]]
307     #elif __has_cpp_attribute(clang::fallthrough)
308       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
309     #elif __has_cpp_attribute(gnu::fallthrough)
310       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
311     #endif
312   #endif
313   #ifndef CYTHON_FALLTHROUGH
314     #if __has_attribute(fallthrough)
315       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
316     #else
317       #define CYTHON_FALLTHROUGH
318     #endif
319   #endif
320   #if defined(__clang__ ) && defined(__apple_build_version__)
321     #if __apple_build_version__ < 7000000
322       #undef  CYTHON_FALLTHROUGH
323       #define CYTHON_FALLTHROUGH
324     #endif
325   #endif
326 #endif
327 
328 #ifndef CYTHON_INLINE
329   #if defined(__clang__)
330     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
331   #elif defined(__GNUC__)
332     #define CYTHON_INLINE __inline__
333   #elif defined(_MSC_VER)
334     #define CYTHON_INLINE __inline
335   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
336     #define CYTHON_INLINE inline
337   #else
338     #define CYTHON_INLINE
339   #endif
340 #endif
341 
342 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
343   #define Py_OptimizeFlag 0
344 #endif
345 #define __PYX_BUILD_PY_SSIZE_T "n"
346 #define CYTHON_FORMAT_SSIZE_T "z"
347 #if PY_MAJOR_VERSION < 3
348   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
349   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
350           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
351   #define __Pyx_DefaultClassType PyClass_Type
352 #else
353   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
354 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
355   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
356           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
357 #else
358   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
359           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
360 #endif
361   #define __Pyx_DefaultClassType PyType_Type
362 #endif
363 #ifndef Py_TPFLAGS_CHECKTYPES
364   #define Py_TPFLAGS_CHECKTYPES 0
365 #endif
366 #ifndef Py_TPFLAGS_HAVE_INDEX
367   #define Py_TPFLAGS_HAVE_INDEX 0
368 #endif
369 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
370   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
371 #endif
372 #ifndef Py_TPFLAGS_HAVE_FINALIZE
373   #define Py_TPFLAGS_HAVE_FINALIZE 0
374 #endif
375 #ifndef METH_STACKLESS
376   #define METH_STACKLESS 0
377 #endif
378 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
379   #ifndef METH_FASTCALL
380      #define METH_FASTCALL 0x80
381   #endif
382   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
383   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
384                                                           Py_ssize_t nargs, PyObject *kwnames);
385 #else
386   #define __Pyx_PyCFunctionFast _PyCFunctionFast
387   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
388 #endif
389 #if CYTHON_FAST_PYCCALL
390 #define __Pyx_PyFastCFunction_Check(func)\
391     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
392 #else
393 #define __Pyx_PyFastCFunction_Check(func) 0
394 #endif
395 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
396   #define PyObject_Malloc(s)   PyMem_Malloc(s)
397   #define PyObject_Free(p)     PyMem_Free(p)
398   #define PyObject_Realloc(p)  PyMem_Realloc(p)
399 #endif
400 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
401   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
402   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
403   #define PyMem_RawFree(p)             PyMem_Free(p)
404 #endif
405 #if CYTHON_COMPILING_IN_PYSTON
406   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
407   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
408 #else
409   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
410   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
411 #endif
412 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
413   #define __Pyx_PyThreadState_Current PyThreadState_GET()
414 #elif PY_VERSION_HEX >= 0x03060000
415   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
416 #elif PY_VERSION_HEX >= 0x03000000
417   #define __Pyx_PyThreadState_Current PyThreadState_GET()
418 #else
419   #define __Pyx_PyThreadState_Current _PyThreadState_Current
420 #endif
421 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
422 #include "pythread.h"
423 #define Py_tss_NEEDS_INIT 0
424 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)425 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
426   *key = PyThread_create_key();
427   return 0;
428 }
PyThread_tss_alloc(void)429 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
430   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
431   *key = Py_tss_NEEDS_INIT;
432   return key;
433 }
PyThread_tss_free(Py_tss_t * key)434 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
435   PyObject_Free(key);
436 }
PyThread_tss_is_created(Py_tss_t * key)437 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
438   return *key != Py_tss_NEEDS_INIT;
439 }
PyThread_tss_delete(Py_tss_t * key)440 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
441   PyThread_delete_key(*key);
442   *key = Py_tss_NEEDS_INIT;
443 }
PyThread_tss_set(Py_tss_t * key,void * value)444 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
445   return PyThread_set_key_value(*key, value);
446 }
PyThread_tss_get(Py_tss_t * key)447 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
448   return PyThread_get_key_value(*key);
449 }
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
452 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
453 #else
454 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
455 #endif
456 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
457   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
458   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
459 #else
460   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
461   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
462 #endif
463 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
464 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
465 #else
466 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
467 #endif
468 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
469   #define CYTHON_PEP393_ENABLED 1
470   #if defined(PyUnicode_IS_READY)
471   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
472                                               0 : _PyUnicode_Ready((PyObject *)(op)))
473   #else
474   #define __Pyx_PyUnicode_READY(op)       (0)
475   #endif
476   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
477   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
478   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
479   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
480   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
481   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
482   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
483   #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
484   #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
485   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
486   #else
487   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
488   #endif
489   #else
490   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
491   #endif
492 #else
493   #define CYTHON_PEP393_ENABLED 0
494   #define PyUnicode_1BYTE_KIND  1
495   #define PyUnicode_2BYTE_KIND  2
496   #define PyUnicode_4BYTE_KIND  4
497   #define __Pyx_PyUnicode_READY(op)       (0)
498   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
499   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
500   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
501   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
502   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
503   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
504   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
505   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
506 #endif
507 #if CYTHON_COMPILING_IN_PYPY
508   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
509   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
510 #else
511   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
512   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
513       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
514 #endif
515 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
516   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
517 #endif
518 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
519   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
520 #endif
521 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
522   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
523 #endif
524 #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))
525 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
526 #if PY_MAJOR_VERSION >= 3
527   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
528 #else
529   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
530 #endif
531 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
532   #define PyObject_ASCII(o)            PyObject_Repr(o)
533 #endif
534 #if PY_MAJOR_VERSION >= 3
535   #define PyBaseString_Type            PyUnicode_Type
536   #define PyStringObject               PyUnicodeObject
537   #define PyString_Type                PyUnicode_Type
538   #define PyString_Check               PyUnicode_Check
539   #define PyString_CheckExact          PyUnicode_CheckExact
540 #ifndef PyObject_Unicode
541   #define PyObject_Unicode             PyObject_Str
542 #endif
543 #endif
544 #if PY_MAJOR_VERSION >= 3
545   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
546   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
547 #else
548   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
549   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
550 #endif
551 #ifndef PySet_CheckExact
552   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
553 #endif
554 #if PY_VERSION_HEX >= 0x030900A4
555   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
556   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
557 #else
558   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
559   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
560 #endif
561 #if CYTHON_ASSUME_SAFE_MACROS
562   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
563 #else
564   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
565 #endif
566 #if PY_MAJOR_VERSION >= 3
567   #define PyIntObject                  PyLongObject
568   #define PyInt_Type                   PyLong_Type
569   #define PyInt_Check(op)              PyLong_Check(op)
570   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
571   #define PyInt_FromString             PyLong_FromString
572   #define PyInt_FromUnicode            PyLong_FromUnicode
573   #define PyInt_FromLong               PyLong_FromLong
574   #define PyInt_FromSize_t             PyLong_FromSize_t
575   #define PyInt_FromSsize_t            PyLong_FromSsize_t
576   #define PyInt_AsLong                 PyLong_AsLong
577   #define PyInt_AS_LONG                PyLong_AS_LONG
578   #define PyInt_AsSsize_t              PyLong_AsSsize_t
579   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
580   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
581   #define PyNumber_Int                 PyNumber_Long
582 #endif
583 #if PY_MAJOR_VERSION >= 3
584   #define PyBoolObject                 PyLongObject
585 #endif
586 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
587   #ifndef PyUnicode_InternFromString
588     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
589   #endif
590 #endif
591 #if PY_VERSION_HEX < 0x030200A4
592   typedef long Py_hash_t;
593   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
594   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
595 #else
596   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
597   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
598 #endif
599 #if PY_MAJOR_VERSION >= 3
600   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
601 #else
602   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
603 #endif
604 #if CYTHON_USE_ASYNC_SLOTS
605   #if PY_VERSION_HEX >= 0x030500B1
606     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
607     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
608   #else
609     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
610   #endif
611 #else
612   #define __Pyx_PyType_AsAsync(obj) NULL
613 #endif
614 #ifndef __Pyx_PyAsyncMethodsStruct
615     typedef struct {
616         unaryfunc am_await;
617         unaryfunc am_aiter;
618         unaryfunc am_anext;
619     } __Pyx_PyAsyncMethodsStruct;
620 #endif
621 
622 #if defined(WIN32) || defined(MS_WINDOWS)
623   #define _USE_MATH_DEFINES
624 #endif
625 #include <math.h>
626 #ifdef NAN
627 #define __PYX_NAN() ((float) NAN)
628 #else
__PYX_NAN()629 static CYTHON_INLINE float __PYX_NAN() {
630   float value;
631   memset(&value, 0xFF, sizeof(value));
632   return value;
633 }
634 #endif
635 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
636 #define __Pyx_truncl trunc
637 #else
638 #define __Pyx_truncl truncl
639 #endif
640 
641 #define __PYX_MARK_ERR_POS(f_index, lineno) \
642     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
643 #define __PYX_ERR(f_index, lineno, Ln_error) \
644     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
645 
646 #ifndef __PYX_EXTERN_C
647   #ifdef __cplusplus
648     #define __PYX_EXTERN_C extern "C"
649   #else
650     #define __PYX_EXTERN_C extern
651   #endif
652 #endif
653 
654 #define __PYX_HAVE__statsmodels__tsa__holtwinters___exponential_smoothers
655 #define __PYX_HAVE_API__statsmodels__tsa__holtwinters___exponential_smoothers
656 /* Early includes */
657 #include <string.h>
658 #include <stdio.h>
659 #include "numpy/arrayobject.h"
660 #include "numpy/ndarrayobject.h"
661 #include "numpy/ndarraytypes.h"
662 #include "numpy/arrayscalars.h"
663 #include "numpy/ufuncobject.h"
664 
665     /* NumPy API declarations from "numpy/__init__.pxd" */
666 
667 #include "pythread.h"
668 #include <stdlib.h>
669 #include "pystate.h"
670 #ifdef _OPENMP
671 #include <omp.h>
672 #endif /* _OPENMP */
673 
674 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
675 #define CYTHON_WITHOUT_ASSERTIONS
676 #endif
677 
678 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
679                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
680 
681 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
682 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
683 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
684 #define __PYX_DEFAULT_STRING_ENCODING ""
685 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
686 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
687 #define __Pyx_uchar_cast(c) ((unsigned char)c)
688 #define __Pyx_long_cast(x) ((long)x)
689 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
690     (sizeof(type) < sizeof(Py_ssize_t))  ||\
691     (sizeof(type) > sizeof(Py_ssize_t) &&\
692           likely(v < (type)PY_SSIZE_T_MAX ||\
693                  v == (type)PY_SSIZE_T_MAX)  &&\
694           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
695                                 v == (type)PY_SSIZE_T_MIN)))  ||\
696     (sizeof(type) == sizeof(Py_ssize_t) &&\
697           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
698                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)699 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
700     return (size_t) i < (size_t) limit;
701 }
702 #if defined (__cplusplus) && __cplusplus >= 201103L
703     #include <cstdlib>
704     #define __Pyx_sst_abs(value) std::abs(value)
705 #elif SIZEOF_INT >= SIZEOF_SIZE_T
706     #define __Pyx_sst_abs(value) abs(value)
707 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
708     #define __Pyx_sst_abs(value) labs(value)
709 #elif defined (_MSC_VER)
710     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
711 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
712     #define __Pyx_sst_abs(value) llabs(value)
713 #elif defined (__GNUC__)
714     #define __Pyx_sst_abs(value) __builtin_llabs(value)
715 #else
716     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
717 #endif
718 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
719 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
720 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
721 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
722 #define __Pyx_PyBytes_FromString        PyBytes_FromString
723 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
724 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
725 #if PY_MAJOR_VERSION < 3
726     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
727     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
728 #else
729     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
730     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
731 #endif
732 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
733 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
734 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
735 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
736 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
737 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
738 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
739 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
740 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
741 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
742 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
743 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
744 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
745 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
746 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
747 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)748 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
749     const Py_UNICODE *u_end = u;
750     while (*u_end++) ;
751     return (size_t)(u_end - u - 1);
752 }
753 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
754 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
755 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
756 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
757 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
758 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
759 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
760 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
761 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
762 #define __Pyx_PySequence_Tuple(obj)\
763     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
764 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
765 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
766 #if CYTHON_ASSUME_SAFE_MACROS
767 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
768 #else
769 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
770 #endif
771 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
772 #if PY_MAJOR_VERSION >= 3
773 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
774 #else
775 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
776 #endif
777 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
778 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
779 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)780 static int __Pyx_init_sys_getdefaultencoding_params(void) {
781     PyObject* sys;
782     PyObject* default_encoding = NULL;
783     PyObject* ascii_chars_u = NULL;
784     PyObject* ascii_chars_b = NULL;
785     const char* default_encoding_c;
786     sys = PyImport_ImportModule("sys");
787     if (!sys) goto bad;
788     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
789     Py_DECREF(sys);
790     if (!default_encoding) goto bad;
791     default_encoding_c = PyBytes_AsString(default_encoding);
792     if (!default_encoding_c) goto bad;
793     if (strcmp(default_encoding_c, "ascii") == 0) {
794         __Pyx_sys_getdefaultencoding_not_ascii = 0;
795     } else {
796         char ascii_chars[128];
797         int c;
798         for (c = 0; c < 128; c++) {
799             ascii_chars[c] = c;
800         }
801         __Pyx_sys_getdefaultencoding_not_ascii = 1;
802         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
803         if (!ascii_chars_u) goto bad;
804         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
805         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
806             PyErr_Format(
807                 PyExc_ValueError,
808                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
809                 default_encoding_c);
810             goto bad;
811         }
812         Py_DECREF(ascii_chars_u);
813         Py_DECREF(ascii_chars_b);
814     }
815     Py_DECREF(default_encoding);
816     return 0;
817 bad:
818     Py_XDECREF(default_encoding);
819     Py_XDECREF(ascii_chars_u);
820     Py_XDECREF(ascii_chars_b);
821     return -1;
822 }
823 #endif
824 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
825 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
826 #else
827 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
828 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
829 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)830 static int __Pyx_init_sys_getdefaultencoding_params(void) {
831     PyObject* sys;
832     PyObject* default_encoding = NULL;
833     char* default_encoding_c;
834     sys = PyImport_ImportModule("sys");
835     if (!sys) goto bad;
836     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
837     Py_DECREF(sys);
838     if (!default_encoding) goto bad;
839     default_encoding_c = PyBytes_AsString(default_encoding);
840     if (!default_encoding_c) goto bad;
841     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
842     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
843     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
844     Py_DECREF(default_encoding);
845     return 0;
846 bad:
847     Py_XDECREF(default_encoding);
848     return -1;
849 }
850 #endif
851 #endif
852 
853 
854 /* Test for GCC > 2.95 */
855 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
856   #define likely(x)   __builtin_expect(!!(x), 1)
857   #define unlikely(x) __builtin_expect(!!(x), 0)
858 #else /* !__GNUC__ or GCC < 2.95 */
859   #define likely(x)   (x)
860   #define unlikely(x) (x)
861 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)862 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
863 
864 static PyObject *__pyx_m = NULL;
865 static PyObject *__pyx_d;
866 static PyObject *__pyx_b;
867 static PyObject *__pyx_cython_runtime = NULL;
868 static PyObject *__pyx_empty_tuple;
869 static PyObject *__pyx_empty_bytes;
870 static PyObject *__pyx_empty_unicode;
871 static int __pyx_lineno;
872 static int __pyx_clineno = 0;
873 static const char * __pyx_cfilenm= __FILE__;
874 static const char *__pyx_filename;
875 
876 /* Header.proto */
877 #if !defined(CYTHON_CCOMPLEX)
878   #if defined(__cplusplus)
879     #define CYTHON_CCOMPLEX 1
880   #elif defined(_Complex_I)
881     #define CYTHON_CCOMPLEX 1
882   #else
883     #define CYTHON_CCOMPLEX 0
884   #endif
885 #endif
886 #if CYTHON_CCOMPLEX
887   #ifdef __cplusplus
888     #include <complex>
889   #else
890     #include <complex.h>
891   #endif
892 #endif
893 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
894   #undef _Complex_I
895   #define _Complex_I 1.0fj
896 #endif
897 
898 
899 static const char *__pyx_f[] = {
900   "statsmodels\\tsa\\holtwinters\\_exponential_smoothers.pyx",
901   "stringsource",
902   "__init__.pxd",
903   "type.pxd",
904 };
905 /* MemviewSliceStruct.proto */
906 struct __pyx_memoryview_obj;
907 typedef struct {
908   struct __pyx_memoryview_obj *memview;
909   char *data;
910   Py_ssize_t shape[8];
911   Py_ssize_t strides[8];
912   Py_ssize_t suboffsets[8];
913 } __Pyx_memviewslice;
914 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
915 
916 /* Atomics.proto */
917 #include <pythread.h>
918 #ifndef CYTHON_ATOMICS
919     #define CYTHON_ATOMICS 1
920 #endif
921 #define __pyx_atomic_int_type int
922 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
923                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
924                     !defined(__i386__)
925     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
926     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
927     #ifdef __PYX_DEBUG_ATOMICS
928         #warning "Using GNU atomics"
929     #endif
930 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
931     #include <Windows.h>
932     #undef __pyx_atomic_int_type
933     #define __pyx_atomic_int_type LONG
934     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
935     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
936     #ifdef __PYX_DEBUG_ATOMICS
937         #pragma message ("Using MSVC atomics")
938     #endif
939 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
940     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
941     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
942     #ifdef __PYX_DEBUG_ATOMICS
943         #warning "Using Intel atomics"
944     #endif
945 #else
946     #undef CYTHON_ATOMICS
947     #define CYTHON_ATOMICS 0
948     #ifdef __PYX_DEBUG_ATOMICS
949         #warning "Not using atomics"
950     #endif
951 #endif
952 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
953 #if CYTHON_ATOMICS
954     #define __pyx_add_acquisition_count(memview)\
955              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
956     #define __pyx_sub_acquisition_count(memview)\
957             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
958 #else
959     #define __pyx_add_acquisition_count(memview)\
960             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
961     #define __pyx_sub_acquisition_count(memview)\
962             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
963 #endif
964 
965 /* ForceInitThreads.proto */
966 #ifndef __PYX_FORCE_INIT_THREADS
967   #define __PYX_FORCE_INIT_THREADS 0
968 #endif
969 
970 /* NoFastGil.proto */
971 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
972 #define __Pyx_PyGILState_Release PyGILState_Release
973 #define __Pyx_FastGIL_Remember()
974 #define __Pyx_FastGIL_Forget()
975 #define __Pyx_FastGilFuncInit()
976 
977 /* BufferFormatStructs.proto */
978 #define IS_UNSIGNED(type) (((type) -1) > 0)
979 struct __Pyx_StructField_;
980 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
981 typedef struct {
982   const char* name;
983   struct __Pyx_StructField_* fields;
984   size_t size;
985   size_t arraysize[8];
986   int ndim;
987   char typegroup;
988   char is_unsigned;
989   int flags;
990 } __Pyx_TypeInfo;
991 typedef struct __Pyx_StructField_ {
992   __Pyx_TypeInfo* type;
993   const char* name;
994   size_t offset;
995 } __Pyx_StructField;
996 typedef struct {
997   __Pyx_StructField* field;
998   size_t parent_offset;
999 } __Pyx_BufFmt_StackElem;
1000 typedef struct {
1001   __Pyx_StructField root;
1002   __Pyx_BufFmt_StackElem* head;
1003   size_t fmt_offset;
1004   size_t new_count, enc_count;
1005   size_t struct_alignment;
1006   int is_complex;
1007   char enc_type;
1008   char new_packmode;
1009   char enc_packmode;
1010   char is_valid_array;
1011 } __Pyx_BufFmt_Context;
1012 
1013 
1014 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":690
1015  * # in Cython to enable them only on the right systems.
1016  *
1017  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
1018  * ctypedef npy_int16      int16_t
1019  * ctypedef npy_int32      int32_t
1020  */
1021 typedef npy_int8 __pyx_t_5numpy_int8_t;
1022 
1023 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":691
1024  *
1025  * ctypedef npy_int8       int8_t
1026  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
1027  * ctypedef npy_int32      int32_t
1028  * ctypedef npy_int64      int64_t
1029  */
1030 typedef npy_int16 __pyx_t_5numpy_int16_t;
1031 
1032 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":692
1033  * ctypedef npy_int8       int8_t
1034  * ctypedef npy_int16      int16_t
1035  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1036  * ctypedef npy_int64      int64_t
1037  * #ctypedef npy_int96      int96_t
1038  */
1039 typedef npy_int32 __pyx_t_5numpy_int32_t;
1040 
1041 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":693
1042  * ctypedef npy_int16      int16_t
1043  * ctypedef npy_int32      int32_t
1044  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1045  * #ctypedef npy_int96      int96_t
1046  * #ctypedef npy_int128     int128_t
1047  */
1048 typedef npy_int64 __pyx_t_5numpy_int64_t;
1049 
1050 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":697
1051  * #ctypedef npy_int128     int128_t
1052  *
1053  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1054  * ctypedef npy_uint16     uint16_t
1055  * ctypedef npy_uint32     uint32_t
1056  */
1057 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1058 
1059 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":698
1060  *
1061  * ctypedef npy_uint8      uint8_t
1062  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1063  * ctypedef npy_uint32     uint32_t
1064  * ctypedef npy_uint64     uint64_t
1065  */
1066 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1067 
1068 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":699
1069  * ctypedef npy_uint8      uint8_t
1070  * ctypedef npy_uint16     uint16_t
1071  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1072  * ctypedef npy_uint64     uint64_t
1073  * #ctypedef npy_uint96     uint96_t
1074  */
1075 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1076 
1077 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":700
1078  * ctypedef npy_uint16     uint16_t
1079  * ctypedef npy_uint32     uint32_t
1080  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1081  * #ctypedef npy_uint96     uint96_t
1082  * #ctypedef npy_uint128    uint128_t
1083  */
1084 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1085 
1086 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":704
1087  * #ctypedef npy_uint128    uint128_t
1088  *
1089  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1090  * ctypedef npy_float64    float64_t
1091  * #ctypedef npy_float80    float80_t
1092  */
1093 typedef npy_float32 __pyx_t_5numpy_float32_t;
1094 
1095 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":705
1096  *
1097  * ctypedef npy_float32    float32_t
1098  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1099  * #ctypedef npy_float80    float80_t
1100  * #ctypedef npy_float128   float128_t
1101  */
1102 typedef npy_float64 __pyx_t_5numpy_float64_t;
1103 
1104 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":714
1105  * # The int types are mapped a bit surprising --
1106  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1107  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1108  * ctypedef npy_longlong   long_t
1109  * ctypedef npy_longlong   longlong_t
1110  */
1111 typedef npy_long __pyx_t_5numpy_int_t;
1112 
1113 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":715
1114  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1115  * ctypedef npy_long       int_t
1116  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1117  * ctypedef npy_longlong   longlong_t
1118  *
1119  */
1120 typedef npy_longlong __pyx_t_5numpy_long_t;
1121 
1122 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":716
1123  * ctypedef npy_long       int_t
1124  * ctypedef npy_longlong   long_t
1125  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1126  *
1127  * ctypedef npy_ulong      uint_t
1128  */
1129 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1130 
1131 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":718
1132  * ctypedef npy_longlong   longlong_t
1133  *
1134  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1135  * ctypedef npy_ulonglong  ulong_t
1136  * ctypedef npy_ulonglong  ulonglong_t
1137  */
1138 typedef npy_ulong __pyx_t_5numpy_uint_t;
1139 
1140 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":719
1141  *
1142  * ctypedef npy_ulong      uint_t
1143  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1144  * ctypedef npy_ulonglong  ulonglong_t
1145  *
1146  */
1147 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1148 
1149 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":720
1150  * ctypedef npy_ulong      uint_t
1151  * ctypedef npy_ulonglong  ulong_t
1152  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1153  *
1154  * ctypedef npy_intp       intp_t
1155  */
1156 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1157 
1158 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":722
1159  * ctypedef npy_ulonglong  ulonglong_t
1160  *
1161  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1162  * ctypedef npy_uintp      uintp_t
1163  *
1164  */
1165 typedef npy_intp __pyx_t_5numpy_intp_t;
1166 
1167 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":723
1168  *
1169  * ctypedef npy_intp       intp_t
1170  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1171  *
1172  * ctypedef npy_double     float_t
1173  */
1174 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1175 
1176 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":725
1177  * ctypedef npy_uintp      uintp_t
1178  *
1179  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1180  * ctypedef npy_double     double_t
1181  * ctypedef npy_longdouble longdouble_t
1182  */
1183 typedef npy_double __pyx_t_5numpy_float_t;
1184 
1185 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":726
1186  *
1187  * ctypedef npy_double     float_t
1188  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1189  * ctypedef npy_longdouble longdouble_t
1190  *
1191  */
1192 typedef npy_double __pyx_t_5numpy_double_t;
1193 
1194 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":727
1195  * ctypedef npy_double     float_t
1196  * ctypedef npy_double     double_t
1197  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1198  *
1199  * ctypedef npy_cfloat      cfloat_t
1200  */
1201 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1202 /* Declarations.proto */
1203 #if CYTHON_CCOMPLEX
1204   #ifdef __cplusplus
1205     typedef ::std::complex< float > __pyx_t_float_complex;
1206   #else
1207     typedef float _Complex __pyx_t_float_complex;
1208   #endif
1209 #else
1210     typedef struct { float real, imag; } __pyx_t_float_complex;
1211 #endif
1212 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1213 
1214 /* Declarations.proto */
1215 #if CYTHON_CCOMPLEX
1216   #ifdef __cplusplus
1217     typedef ::std::complex< double > __pyx_t_double_complex;
1218   #else
1219     typedef double _Complex __pyx_t_double_complex;
1220   #endif
1221 #else
1222     typedef struct { double real, imag; } __pyx_t_double_complex;
1223 #endif
1224 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1225 
1226 
1227 /*--- Type declarations ---*/
1228 struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs;
1229 struct __pyx_array_obj;
1230 struct __pyx_MemviewEnum_obj;
1231 struct __pyx_memoryview_obj;
1232 struct __pyx_memoryviewslice_obj;
1233 
1234 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":729
1235  * ctypedef npy_longdouble longdouble_t
1236  *
1237  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1238  * ctypedef npy_cdouble     cdouble_t
1239  * ctypedef npy_clongdouble clongdouble_t
1240  */
1241 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1242 
1243 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":730
1244  *
1245  * ctypedef npy_cfloat      cfloat_t
1246  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1247  * ctypedef npy_clongdouble clongdouble_t
1248  *
1249  */
1250 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1251 
1252 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":731
1253  * ctypedef npy_cfloat      cfloat_t
1254  * ctypedef npy_cdouble     cdouble_t
1255  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1256  *
1257  * ctypedef npy_cdouble     complex_t
1258  */
1259 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1260 
1261 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":733
1262  * ctypedef npy_clongdouble clongdouble_t
1263  *
1264  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1265  *
1266  * cdef inline object PyArray_MultiIterNew1(a):
1267  */
1268 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1269 
1270 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":13
1271  *
1272  *
1273  * cdef class HoltWintersArgs:             # <<<<<<<<<<<<<<
1274  *     cdef long[::1] _xi
1275  *     cdef double[::1] _p, _y, _l, _b, _s
1276  */
1277 struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs {
1278   PyObject_HEAD
1279   __Pyx_memviewslice _xi;
1280   __Pyx_memviewslice _p;
1281   __Pyx_memviewslice _y;
1282   __Pyx_memviewslice _l;
1283   __Pyx_memviewslice _b;
1284   __Pyx_memviewslice _s;
1285   __Pyx_memviewslice _bounds;
1286   Py_ssize_t _m;
1287   Py_ssize_t _n;
1288   int _transform;
1289 };
1290 
1291 
1292 /* "View.MemoryView":105
1293  *
1294  * @cname("__pyx_array")
1295  * cdef class array:             # <<<<<<<<<<<<<<
1296  *
1297  *     cdef:
1298  */
1299 struct __pyx_array_obj {
1300   PyObject_HEAD
1301   struct __pyx_vtabstruct_array *__pyx_vtab;
1302   char *data;
1303   Py_ssize_t len;
1304   char *format;
1305   int ndim;
1306   Py_ssize_t *_shape;
1307   Py_ssize_t *_strides;
1308   Py_ssize_t itemsize;
1309   PyObject *mode;
1310   PyObject *_format;
1311   void (*callback_free_data)(void *);
1312   int free_data;
1313   int dtype_is_object;
1314 };
1315 
1316 
1317 /* "View.MemoryView":279
1318  *
1319  * @cname('__pyx_MemviewEnum')
1320  * cdef class Enum(object):             # <<<<<<<<<<<<<<
1321  *     cdef object name
1322  *     def __init__(self, name):
1323  */
1324 struct __pyx_MemviewEnum_obj {
1325   PyObject_HEAD
1326   PyObject *name;
1327 };
1328 
1329 
1330 /* "View.MemoryView":330
1331  *
1332  * @cname('__pyx_memoryview')
1333  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1334  *
1335  *     cdef object obj
1336  */
1337 struct __pyx_memoryview_obj {
1338   PyObject_HEAD
1339   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1340   PyObject *obj;
1341   PyObject *_size;
1342   PyObject *_array_interface;
1343   PyThread_type_lock lock;
1344   __pyx_atomic_int acquisition_count[2];
1345   __pyx_atomic_int *acquisition_count_aligned_p;
1346   Py_buffer view;
1347   int flags;
1348   int dtype_is_object;
1349   __Pyx_TypeInfo *typeinfo;
1350 };
1351 
1352 
1353 /* "View.MemoryView":965
1354  *
1355  * @cname('__pyx_memoryviewslice')
1356  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1357  *     "Internal class for passing memoryview slices to Python"
1358  *
1359  */
1360 struct __pyx_memoryviewslice_obj {
1361   struct __pyx_memoryview_obj __pyx_base;
1362   __Pyx_memviewslice from_slice;
1363   PyObject *from_object;
1364   PyObject *(*to_object_func)(char *);
1365   int (*to_dtype_func)(char *, PyObject *);
1366 };
1367 
1368 
1369 
1370 /* "View.MemoryView":105
1371  *
1372  * @cname("__pyx_array")
1373  * cdef class array:             # <<<<<<<<<<<<<<
1374  *
1375  *     cdef:
1376  */
1377 
1378 struct __pyx_vtabstruct_array {
1379   PyObject *(*get_memview)(struct __pyx_array_obj *);
1380 };
1381 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1382 
1383 
1384 /* "View.MemoryView":330
1385  *
1386  * @cname('__pyx_memoryview')
1387  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
1388  *
1389  *     cdef object obj
1390  */
1391 
1392 struct __pyx_vtabstruct_memoryview {
1393   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1394   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1395   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1396   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1397   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1398   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1399   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1400 };
1401 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1402 
1403 
1404 /* "View.MemoryView":965
1405  *
1406  * @cname('__pyx_memoryviewslice')
1407  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
1408  *     "Internal class for passing memoryview slices to Python"
1409  *
1410  */
1411 
1412 struct __pyx_vtabstruct__memoryviewslice {
1413   struct __pyx_vtabstruct_memoryview __pyx_base;
1414 };
1415 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1416 
1417 /* --- Runtime support code (head) --- */
1418 /* Refnanny.proto */
1419 #ifndef CYTHON_REFNANNY
1420   #define CYTHON_REFNANNY 0
1421 #endif
1422 #if CYTHON_REFNANNY
1423   typedef struct {
1424     void (*INCREF)(void*, PyObject*, int);
1425     void (*DECREF)(void*, PyObject*, int);
1426     void (*GOTREF)(void*, PyObject*, int);
1427     void (*GIVEREF)(void*, PyObject*, int);
1428     void* (*SetupContext)(const char*, int, const char*);
1429     void (*FinishContext)(void**);
1430   } __Pyx_RefNannyAPIStruct;
1431   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1432   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1433   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1434 #ifdef WITH_THREAD
1435   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1436           if (acquire_gil) {\
1437               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1438               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1439               PyGILState_Release(__pyx_gilstate_save);\
1440           } else {\
1441               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1442           }
1443 #else
1444   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1445           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1446 #endif
1447   #define __Pyx_RefNannyFinishContext()\
1448           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1449   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1450   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1451   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1452   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1453   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1454   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1455   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1456   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1457 #else
1458   #define __Pyx_RefNannyDeclarations
1459   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1460   #define __Pyx_RefNannyFinishContext()
1461   #define __Pyx_INCREF(r) Py_INCREF(r)
1462   #define __Pyx_DECREF(r) Py_DECREF(r)
1463   #define __Pyx_GOTREF(r)
1464   #define __Pyx_GIVEREF(r)
1465   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1466   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1467   #define __Pyx_XGOTREF(r)
1468   #define __Pyx_XGIVEREF(r)
1469 #endif
1470 #define __Pyx_XDECREF_SET(r, v) do {\
1471         PyObject *tmp = (PyObject *) r;\
1472         r = v; __Pyx_XDECREF(tmp);\
1473     } while (0)
1474 #define __Pyx_DECREF_SET(r, v) do {\
1475         PyObject *tmp = (PyObject *) r;\
1476         r = v; __Pyx_DECREF(tmp);\
1477     } while (0)
1478 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1479 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1480 
1481 /* PyObjectGetAttrStr.proto */
1482 #if CYTHON_USE_TYPE_SLOTS
1483 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1484 #else
1485 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1486 #endif
1487 
1488 /* GetBuiltinName.proto */
1489 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1490 
1491 /* RaiseArgTupleInvalid.proto */
1492 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1493     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1494 
1495 /* RaiseDoubleKeywords.proto */
1496 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1497 
1498 /* ParseKeywords.proto */
1499 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1500     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1501     const char* function_name);
1502 
1503 /* MemviewSliceInit.proto */
1504 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1505 #define __Pyx_MEMVIEW_DIRECT   1
1506 #define __Pyx_MEMVIEW_PTR      2
1507 #define __Pyx_MEMVIEW_FULL     4
1508 #define __Pyx_MEMVIEW_CONTIG   8
1509 #define __Pyx_MEMVIEW_STRIDED  16
1510 #define __Pyx_MEMVIEW_FOLLOW   32
1511 #define __Pyx_IS_C_CONTIG 1
1512 #define __Pyx_IS_F_CONTIG 2
1513 static int __Pyx_init_memviewslice(
1514                 struct __pyx_memoryview_obj *memview,
1515                 int ndim,
1516                 __Pyx_memviewslice *memviewslice,
1517                 int memview_is_new_reference);
1518 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1519     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1520 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1521     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1522 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1523 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1524 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1525 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1526 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1527 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1528 
1529 /* PyDictVersioning.proto */
1530 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1531 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1532 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1533 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1534     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1535     (cache_var) = (value);
1536 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1537     static PY_UINT64_T __pyx_dict_version = 0;\
1538     static PyObject *__pyx_dict_cached_value = NULL;\
1539     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1540         (VAR) = __pyx_dict_cached_value;\
1541     } else {\
1542         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1543         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1544     }\
1545 }
1546 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1547 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1548 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1549 #else
1550 #define __PYX_GET_DICT_VERSION(dict)  (0)
1551 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1552 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1553 #endif
1554 
1555 /* GetModuleGlobalName.proto */
1556 #if CYTHON_USE_DICT_VERSIONS
1557 #define __Pyx_GetModuleGlobalName(var, name)  {\
1558     static PY_UINT64_T __pyx_dict_version = 0;\
1559     static PyObject *__pyx_dict_cached_value = NULL;\
1560     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1561         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1562         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1563 }
1564 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1565     PY_UINT64_T __pyx_dict_version;\
1566     PyObject *__pyx_dict_cached_value;\
1567     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1568 }
1569 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1570 #else
1571 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1572 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1573 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1574 #endif
1575 
1576 /* PyCFunctionFastCall.proto */
1577 #if CYTHON_FAST_PYCCALL
1578 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1579 #else
1580 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1581 #endif
1582 
1583 /* PyFunctionFastCall.proto */
1584 #if CYTHON_FAST_PYCALL
1585 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1586     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1587 #if 1 || PY_VERSION_HEX < 0x030600B1
1588 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1589 #else
1590 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1591 #endif
1592 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1593     (sizeof(char [1 - 2*!(cond)]) - 1)
1594 #ifndef Py_MEMBER_SIZE
1595 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1596 #endif
1597   static size_t __pyx_pyframe_localsplus_offset = 0;
1598   #include "frameobject.h"
1599   #define __Pxy_PyFrame_Initialize_Offsets()\
1600     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1601      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1602   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1603     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1604 #endif
1605 
1606 /* PyObjectCall.proto */
1607 #if CYTHON_COMPILING_IN_CPYTHON
1608 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1609 #else
1610 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1611 #endif
1612 
1613 /* PyObjectCall2Args.proto */
1614 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1615 
1616 /* PyObjectCallMethO.proto */
1617 #if CYTHON_COMPILING_IN_CPYTHON
1618 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1619 #endif
1620 
1621 /* PyObjectCallOneArg.proto */
1622 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1623 
1624 /* PyErrExceptionMatches.proto */
1625 #if CYTHON_FAST_THREAD_STATE
1626 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1627 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1628 #else
1629 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1630 #endif
1631 
1632 /* PyThreadStateGet.proto */
1633 #if CYTHON_FAST_THREAD_STATE
1634 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1635 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1636 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1637 #else
1638 #define __Pyx_PyThreadState_declare
1639 #define __Pyx_PyThreadState_assign
1640 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1641 #endif
1642 
1643 /* PyErrFetchRestore.proto */
1644 #if CYTHON_FAST_THREAD_STATE
1645 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1646 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1647 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1648 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1649 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1650 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1651 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1652 #if CYTHON_COMPILING_IN_CPYTHON
1653 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1654 #else
1655 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1656 #endif
1657 #else
1658 #define __Pyx_PyErr_Clear() PyErr_Clear()
1659 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1660 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1661 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1662 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1663 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1664 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1665 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1666 #endif
1667 
1668 /* GetAttr.proto */
1669 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1670 
1671 /* GetAttr3.proto */
1672 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1673 
1674 /* RaiseTooManyValuesToUnpack.proto */
1675 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1676 
1677 /* RaiseNeedMoreValuesToUnpack.proto */
1678 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1679 
1680 /* IterFinish.proto */
1681 static CYTHON_INLINE int __Pyx_IterFinish(void);
1682 
1683 /* UnpackItemEndCheck.proto */
1684 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1685 
1686 /* ArgTypeTest.proto */
1687 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1688     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1689         __Pyx__ArgTypeTest(obj, type, name, exact))
1690 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1691 
1692 /* Import.proto */
1693 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1694 
1695 /* ImportFrom.proto */
1696 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1697 
1698 /* RaiseException.proto */
1699 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1700 
1701 /* HasAttr.proto */
1702 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1703 
1704 /* GetTopmostException.proto */
1705 #if CYTHON_USE_EXC_INFO_STACK
1706 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1707 #endif
1708 
1709 /* SaveResetException.proto */
1710 #if CYTHON_FAST_THREAD_STATE
1711 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1712 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1713 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1714 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1715 #else
1716 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1717 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1718 #endif
1719 
1720 /* GetException.proto */
1721 #if CYTHON_FAST_THREAD_STATE
1722 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1723 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1724 #else
1725 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1726 #endif
1727 
1728 /* IncludeStringH.proto */
1729 #include <string.h>
1730 
1731 /* BytesEquals.proto */
1732 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1733 
1734 /* UnicodeEquals.proto */
1735 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1736 
1737 /* StrEquals.proto */
1738 #if PY_MAJOR_VERSION >= 3
1739 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1740 #else
1741 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1742 #endif
1743 
1744 /* UnaryNegOverflows.proto */
1745 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1746         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1747 
1748 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1749 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1750 /* GetItemInt.proto */
1751 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1752     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1753     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1754     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1755                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1756 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1757     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1758     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1759     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1760 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1761                                                               int wraparound, int boundscheck);
1762 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1763     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1764     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1765     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1766 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1767                                                               int wraparound, int boundscheck);
1768 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1769 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1770                                                      int is_list, int wraparound, int boundscheck);
1771 
1772 /* ObjectGetItem.proto */
1773 #if CYTHON_USE_TYPE_SLOTS
1774 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1775 #else
1776 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1777 #endif
1778 
1779 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)1780 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1781     int byteorder = 0;
1782     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1783 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)1784 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1785     int byteorder = -1;
1786     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1787 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)1788 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1789     int byteorder = 1;
1790     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1791 }
1792 
1793 /* decode_c_string.proto */
1794 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1795          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1796          const char* encoding, const char* errors,
1797          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1798 
1799 /* RaiseNoneIterError.proto */
1800 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1801 
1802 /* ExtTypeTest.proto */
1803 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1804 
1805 /* SwapException.proto */
1806 #if CYTHON_FAST_THREAD_STATE
1807 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1808 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1809 #else
1810 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1811 #endif
1812 
1813 /* FastTypeChecks.proto */
1814 #if CYTHON_COMPILING_IN_CPYTHON
1815 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1816 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1817 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1818 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1819 #else
1820 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1821 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1822 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1823 #endif
1824 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1825 
1826 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1827 /* ListCompAppend.proto */
1828 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)1829 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1830     PyListObject* L = (PyListObject*) list;
1831     Py_ssize_t len = Py_SIZE(list);
1832     if (likely(L->allocated > len)) {
1833         Py_INCREF(x);
1834         PyList_SET_ITEM(list, len, x);
1835         __Pyx_SET_SIZE(list, len + 1);
1836         return 0;
1837     }
1838     return PyList_Append(list, x);
1839 }
1840 #else
1841 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1842 #endif
1843 
1844 /* PyIntBinop.proto */
1845 #if !CYTHON_COMPILING_IN_PYPY
1846 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1847 #else
1848 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1849     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1850 #endif
1851 
1852 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)1853 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1854 #if CYTHON_COMPILING_IN_CPYTHON
1855     PyObject* none = _PyList_Extend((PyListObject*)L, v);
1856     if (unlikely(!none))
1857         return -1;
1858     Py_DECREF(none);
1859     return 0;
1860 #else
1861     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1862 #endif
1863 }
1864 
1865 /* ListAppend.proto */
1866 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1867 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1868     PyListObject* L = (PyListObject*) list;
1869     Py_ssize_t len = Py_SIZE(list);
1870     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1871         Py_INCREF(x);
1872         PyList_SET_ITEM(list, len, x);
1873         __Pyx_SET_SIZE(list, len + 1);
1874         return 0;
1875     }
1876     return PyList_Append(list, x);
1877 }
1878 #else
1879 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1880 #endif
1881 
1882 /* None.proto */
1883 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1884 
1885 /* PyObject_GenericGetAttrNoDict.proto */
1886 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1887 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1888 #else
1889 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1890 #endif
1891 
1892 /* PyObject_GenericGetAttr.proto */
1893 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1894 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1895 #else
1896 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1897 #endif
1898 
1899 /* PyObjectGetAttrStrNoError.proto */
1900 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1901 
1902 /* SetupReduce.proto */
1903 static int __Pyx_setup_reduce(PyObject* type_obj);
1904 
1905 /* SetVTable.proto */
1906 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1907 
1908 /* TypeImport.proto */
1909 #ifndef __PYX_HAVE_RT_ImportType_proto
1910 #define __PYX_HAVE_RT_ImportType_proto
1911 enum __Pyx_ImportType_CheckSize {
1912    __Pyx_ImportType_CheckSize_Error = 0,
1913    __Pyx_ImportType_CheckSize_Warn = 1,
1914    __Pyx_ImportType_CheckSize_Ignore = 2
1915 };
1916 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1917 #endif
1918 
1919 /* CLineInTraceback.proto */
1920 #ifdef CYTHON_CLINE_IN_TRACEBACK
1921 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1922 #else
1923 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1924 #endif
1925 
1926 /* CodeObjectCache.proto */
1927 typedef struct {
1928     PyCodeObject* code_object;
1929     int code_line;
1930 } __Pyx_CodeObjectCacheEntry;
1931 struct __Pyx_CodeObjectCache {
1932     int count;
1933     int max_count;
1934     __Pyx_CodeObjectCacheEntry* entries;
1935 };
1936 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1937 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1938 static PyCodeObject *__pyx_find_code_object(int code_line);
1939 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1940 
1941 /* AddTraceback.proto */
1942 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1943                                int py_line, const char *filename);
1944 
1945 #if PY_MAJOR_VERSION < 3
1946     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1947     static void __Pyx_ReleaseBuffer(Py_buffer *view);
1948 #else
1949     #define __Pyx_GetBuffer PyObject_GetBuffer
1950     #define __Pyx_ReleaseBuffer PyBuffer_Release
1951 #endif
1952 
1953 
1954 /* BufferStructDeclare.proto */
1955 typedef struct {
1956   Py_ssize_t shape, strides, suboffsets;
1957 } __Pyx_Buf_DimInfo;
1958 typedef struct {
1959   size_t refcount;
1960   Py_buffer pybuffer;
1961 } __Pyx_Buffer;
1962 typedef struct {
1963   __Pyx_Buffer *rcbuffer;
1964   char *data;
1965   __Pyx_Buf_DimInfo diminfo[8];
1966 } __Pyx_LocalBuf_ND;
1967 
1968 /* MemviewSliceIsContig.proto */
1969 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
1970 
1971 /* OverlappingSlices.proto */
1972 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
1973                                 __Pyx_memviewslice *slice2,
1974                                 int ndim, size_t itemsize);
1975 
1976 /* Capsule.proto */
1977 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
1978 
1979 /* MemviewDtypeToObject.proto */
1980 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
1981 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
1982 
1983 /* IsLittleEndian.proto */
1984 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1985 
1986 /* BufferFormatCheck.proto */
1987 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1988 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1989                               __Pyx_BufFmt_StackElem* stack,
1990                               __Pyx_TypeInfo* type);
1991 
1992 /* TypeInfoCompare.proto */
1993 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
1994 
1995 /* MemviewSliceValidateAndInit.proto */
1996 static int __Pyx_ValidateAndInit_memviewslice(
1997                 int *axes_specs,
1998                 int c_or_f_flag,
1999                 int buf_flags,
2000                 int ndim,
2001                 __Pyx_TypeInfo *dtype,
2002                 __Pyx_BufFmt_StackElem stack[],
2003                 __Pyx_memviewslice *memviewslice,
2004                 PyObject *original_obj);
2005 
2006 /* ObjectToMemviewSlice.proto */
2007 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *, int writable_flag);
2008 
2009 /* ObjectToMemviewSlice.proto */
2010 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2011 
2012 /* GCCDiagnostics.proto */
2013 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2014 #define __Pyx_HAS_GCC_DIAGNOSTIC
2015 #endif
2016 
2017 /* MemviewDtypeToObject.proto */
2018 static CYTHON_INLINE PyObject *__pyx_memview_get_long(const char *itemp);
2019 static CYTHON_INLINE int __pyx_memview_set_long(const char *itemp, PyObject *obj);
2020 
2021 /* ObjectToMemviewSlice.proto */
2022 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_long(PyObject *, int writable_flag);
2023 
2024 /* RealImag.proto */
2025 #if CYTHON_CCOMPLEX
2026   #ifdef __cplusplus
2027     #define __Pyx_CREAL(z) ((z).real())
2028     #define __Pyx_CIMAG(z) ((z).imag())
2029   #else
2030     #define __Pyx_CREAL(z) (__real__(z))
2031     #define __Pyx_CIMAG(z) (__imag__(z))
2032   #endif
2033 #else
2034     #define __Pyx_CREAL(z) ((z).real)
2035     #define __Pyx_CIMAG(z) ((z).imag)
2036 #endif
2037 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2038         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2039     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2040     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2041 #else
2042     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2043     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2044 #endif
2045 
2046 /* Arithmetic.proto */
2047 #if CYTHON_CCOMPLEX
2048     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
2049     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
2050     #define __Pyx_c_diff_float(a, b) ((a)-(b))
2051     #define __Pyx_c_prod_float(a, b) ((a)*(b))
2052     #define __Pyx_c_quot_float(a, b) ((a)/(b))
2053     #define __Pyx_c_neg_float(a)     (-(a))
2054   #ifdef __cplusplus
2055     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2056     #define __Pyx_c_conj_float(z)    (::std::conj(z))
2057     #if 1
2058         #define __Pyx_c_abs_float(z)     (::std::abs(z))
2059         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
2060     #endif
2061   #else
2062     #define __Pyx_c_is_zero_float(z) ((z)==0)
2063     #define __Pyx_c_conj_float(z)    (conjf(z))
2064     #if 1
2065         #define __Pyx_c_abs_float(z)     (cabsf(z))
2066         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
2067     #endif
2068  #endif
2069 #else
2070     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2071     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2072     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2073     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2074     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2075     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2076     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2077     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2078     #if 1
2079         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2080         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2081     #endif
2082 #endif
2083 
2084 /* Arithmetic.proto */
2085 #if CYTHON_CCOMPLEX
2086     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2087     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2088     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2089     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2090     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2091     #define __Pyx_c_neg_double(a)     (-(a))
2092   #ifdef __cplusplus
2093     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2094     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2095     #if 1
2096         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2097         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2098     #endif
2099   #else
2100     #define __Pyx_c_is_zero_double(z) ((z)==0)
2101     #define __Pyx_c_conj_double(z)    (conj(z))
2102     #if 1
2103         #define __Pyx_c_abs_double(z)     (cabs(z))
2104         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2105     #endif
2106  #endif
2107 #else
2108     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2109     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2110     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2111     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2112     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2113     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2114     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2115     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2116     #if 1
2117         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2118         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2119     #endif
2120 #endif
2121 
2122 /* MemviewSliceCopyTemplate.proto */
2123 static __Pyx_memviewslice
2124 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2125                                  const char *mode, int ndim,
2126                                  size_t sizeof_dtype, int contig_flag,
2127                                  int dtype_is_object);
2128 
2129 /* CIntToPy.proto */
2130 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2131 
2132 /* CIntFromPy.proto */
2133 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2134 
2135 /* CIntFromPy.proto */
2136 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2137 
2138 /* CIntToPy.proto */
2139 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2140 
2141 /* CIntFromPy.proto */
2142 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2143 
2144 /* CheckBinaryVersion.proto */
2145 static int __Pyx_check_binary_version(void);
2146 
2147 /* InitStrings.proto */
2148 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2149 
2150 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2151 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2152 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2153 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2154 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2155 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2156 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2157 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2158 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2159 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2160 
2161 /* Module declarations from 'cpython.buffer' */
2162 
2163 /* Module declarations from 'libc.string' */
2164 
2165 /* Module declarations from 'libc.stdio' */
2166 
2167 /* Module declarations from '__builtin__' */
2168 
2169 /* Module declarations from 'cpython.type' */
2170 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2171 
2172 /* Module declarations from 'cpython' */
2173 
2174 /* Module declarations from 'cpython.object' */
2175 
2176 /* Module declarations from 'cpython.ref' */
2177 
2178 /* Module declarations from 'cpython.mem' */
2179 
2180 /* Module declarations from 'numpy' */
2181 
2182 /* Module declarations from 'numpy' */
2183 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2184 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2185 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2186 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2187 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2188 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2189 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2190 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2191 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2192 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2193 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2194 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2195 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2196 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2197 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2198 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
2199 
2200 /* Module declarations from 'statsmodels.tsa.holtwinters._exponential_smoothers' */
2201 static PyTypeObject *__pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs = 0;
2202 static PyTypeObject *__pyx_array_type = 0;
2203 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2204 static PyTypeObject *__pyx_memoryview_type = 0;
2205 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2206 static double __pyx_v_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_LOWER_BOUND;
2207 static PyObject *generic = 0;
2208 static PyObject *strided = 0;
2209 static PyObject *indirect = 0;
2210 static PyObject *contiguous = 0;
2211 static PyObject *indirect_contiguous = 0;
2212 static int __pyx_memoryview_thread_locks_used;
2213 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2214 static PyObject *__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_to_restricted(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice); /*proto*/
2215 static PyObject *__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_init(__Pyx_memviewslice, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *); /*proto*/
2216 static PyObject *__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__Pyx_memviewslice, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *); /*proto*/
2217 static PyObject *__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers___pyx_unpickle_HoltWintersArgs__set_state(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *, PyObject *); /*proto*/
2218 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2219 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2220 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2221 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2222 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2223 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2224 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2225 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2226 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2227 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2228 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2229 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2230 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2231 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2232 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2233 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2234 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2235 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2236 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2237 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2238 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2239 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2240 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2241 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2242 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2243 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2244 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2245 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2246 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2247 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2248 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2249 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2250 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2251 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2252 static __Pyx_TypeInfo __Pyx_TypeInfo_long = { "long", NULL, sizeof(long), { 0 }, 0, IS_UNSIGNED(long) ? 'U' : 'I', IS_UNSIGNED(long), 0 };
2253 #define __Pyx_MODULE_NAME "statsmodels.tsa.holtwinters._exponential_smoothers"
2254 extern int __pyx_module_is_main_statsmodels__tsa__holtwinters___exponential_smoothers;
2255 int __pyx_module_is_main_statsmodels__tsa__holtwinters___exponential_smoothers = 0;
2256 
2257 /* Implementation of 'statsmodels.tsa.holtwinters._exponential_smoothers' */
2258 static PyObject *__pyx_builtin_range;
2259 static PyObject *__pyx_builtin_ImportError;
2260 static PyObject *__pyx_builtin_ValueError;
2261 static PyObject *__pyx_builtin_MemoryError;
2262 static PyObject *__pyx_builtin_enumerate;
2263 static PyObject *__pyx_builtin_TypeError;
2264 static PyObject *__pyx_builtin_Ellipsis;
2265 static PyObject *__pyx_builtin_id;
2266 static PyObject *__pyx_builtin_IndexError;
2267 static const char __pyx_k_O[] = "O";
2268 static const char __pyx_k_b[] = "b";
2269 static const char __pyx_k_c[] = "c";
2270 static const char __pyx_k_i[] = "i";
2271 static const char __pyx_k_l[] = "l";
2272 static const char __pyx_k_m[] = "m";
2273 static const char __pyx_k_n[] = "n";
2274 static const char __pyx_k_p[] = "p";
2275 static const char __pyx_k_s[] = "s";
2276 static const char __pyx_k_x[] = "x";
2277 static const char __pyx_k_y[] = "y";
2278 static const char __pyx_k_id[] = "id";
2279 static const char __pyx_k_np[] = "np";
2280 static const char __pyx_k_xi[] = "xi";
2281 static const char __pyx_k_eps[] = "eps";
2282 static const char __pyx_k_err[] = "err";
2283 static const char __pyx_k_new[] = "__new__";
2284 static const char __pyx_k_obj[] = "obj";
2285 static const char __pyx_k_phi[] = "phi";
2286 static const char __pyx_k_sel[] = "sel";
2287 static const char __pyx_k_base[] = "base";
2288 static const char __pyx_k_beta[] = "beta";
2289 static const char __pyx_k_dict[] = "__dict__";
2290 static const char __pyx_k_holt[] = "holt__";
2291 static const char __pyx_k_main[] = "__main__";
2292 static const char __pyx_k_mode[] = "mode";
2293 static const char __pyx_k_name[] = "name";
2294 static const char __pyx_k_ndim[] = "ndim";
2295 static const char __pyx_k_pack[] = "pack";
2296 static const char __pyx_k_size[] = "size";
2297 static const char __pyx_k_sqrt[] = "sqrt";
2298 static const char __pyx_k_step[] = "step";
2299 static const char __pyx_k_stop[] = "stop";
2300 static const char __pyx_k_test[] = "__test__";
2301 static const char __pyx_k_ASCII[] = "ASCII";
2302 static const char __pyx_k_alpha[] = "alpha";
2303 static const char __pyx_k_betac[] = "betac";
2304 static const char __pyx_k_class[] = "__class__";
2305 static const char __pyx_k_empty[] = "empty";
2306 static const char __pyx_k_error[] = "error";
2307 static const char __pyx_k_finfo[] = "finfo";
2308 static const char __pyx_k_flags[] = "flags";
2309 static const char __pyx_k_gamma[] = "gamma";
2310 static const char __pyx_k_numpy[] = "numpy";
2311 static const char __pyx_k_range[] = "range";
2312 static const char __pyx_k_shape[] = "shape";
2313 static const char __pyx_k_start[] = "start";
2314 static const char __pyx_k_alphac[] = "alphac";
2315 static const char __pyx_k_bounds[] = "bounds";
2316 static const char __pyx_k_encode[] = "encode";
2317 static const char __pyx_k_format[] = "format";
2318 static const char __pyx_k_gammac[] = "gammac";
2319 static const char __pyx_k_import[] = "__import__";
2320 static const char __pyx_k_name_2[] = "__name__";
2321 static const char __pyx_k_pickle[] = "pickle";
2322 static const char __pyx_k_reduce[] = "__reduce__";
2323 static const char __pyx_k_struct[] = "struct";
2324 static const char __pyx_k_unpack[] = "unpack";
2325 static const char __pyx_k_update[] = "update";
2326 static const char __pyx_k_asarray[] = "asarray";
2327 static const char __pyx_k_fortran[] = "fortran";
2328 static const char __pyx_k_hw_args[] = "hw_args";
2329 static const char __pyx_k_memview[] = "memview";
2330 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2331 static const char __pyx_k_getstate[] = "__getstate__";
2332 static const char __pyx_k_itemsize[] = "itemsize";
2333 static const char __pyx_k_pyx_type[] = "__pyx_type";
2334 static const char __pyx_k_setstate[] = "__setstate__";
2335 static const char __pyx_k_TypeError[] = "TypeError";
2336 static const char __pyx_k_enumerate[] = "enumerate";
2337 static const char __pyx_k_pyx_state[] = "__pyx_state";
2338 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2339 static const char __pyx_k_transform[] = "transform";
2340 static const char __pyx_k_IndexError[] = "IndexError";
2341 static const char __pyx_k_ValueError[] = "ValueError";
2342 static const char __pyx_k_pyx_result[] = "__pyx_result";
2343 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2344 static const char __pyx_k_ImportError[] = "ImportError";
2345 static const char __pyx_k_MemoryError[] = "MemoryError";
2346 static const char __pyx_k_PickleError[] = "PickleError";
2347 static const char __pyx_k_holt_add_dam[] = "holt_add_dam";
2348 static const char __pyx_k_holt_mul_dam[] = "holt_mul_dam";
2349 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2350 static const char __pyx_k_stringsource[] = "stringsource";
2351 static const char __pyx_k_holt_win__add[] = "holt_win__add";
2352 static const char __pyx_k_holt_win__mul[] = "holt_win__mul";
2353 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2354 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2355 static const char __pyx_k_HoltWintersArgs[] = "HoltWintersArgs";
2356 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2357 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2358 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2359 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2360 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2361 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2362 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2363 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2364 static const char __pyx_k_test_to_restricted[] = "_test_to_restricted";
2365 static const char __pyx_k_holt_win_add_add_dam[] = "holt_win_add_add_dam";
2366 static const char __pyx_k_holt_win_add_mul_dam[] = "holt_win_add_mul_dam";
2367 static const char __pyx_k_holt_win_mul_add_dam[] = "holt_win_mul_add_dam";
2368 static const char __pyx_k_holt_win_mul_mul_dam[] = "holt_win_mul_mul_dam";
2369 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2370 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2371 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2372 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2373 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2374 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2375 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2376 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2377 static const char __pyx_k_pyx_unpickle_HoltWintersArgs[] = "__pyx_unpickle_HoltWintersArgs";
2378 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2379 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2380 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2381 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2382 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2383 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2384 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2385 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2386 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2387 static const char __pyx_k_Incompatible_checksums_s_vs_0xb9[] = "Incompatible checksums (%s vs 0xb9b4cdd = (_b, _bounds, _l, _m, _n, _p, _s, _transform, _xi, _y))";
2388 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2389 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2390 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2391 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2392 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2393 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2394 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2395 static const char __pyx_k_statsmodels_tsa_holtwinters__exp[] = "statsmodels\\tsa\\holtwinters\\_exponential_smoothers.pyx";
2396 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2397 static const char __pyx_k_statsmodels_tsa_holtwinters__exp_2[] = "statsmodels.tsa.holtwinters._exponential_smoothers";
2398 static PyObject *__pyx_n_s_ASCII;
2399 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2400 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2401 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2402 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2403 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2404 static PyObject *__pyx_n_s_Ellipsis;
2405 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2406 static PyObject *__pyx_n_s_HoltWintersArgs;
2407 static PyObject *__pyx_n_s_ImportError;
2408 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2409 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb9;
2410 static PyObject *__pyx_n_s_IndexError;
2411 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2412 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2413 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2414 static PyObject *__pyx_n_s_MemoryError;
2415 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2416 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2417 static PyObject *__pyx_n_b_O;
2418 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2419 static PyObject *__pyx_n_s_PickleError;
2420 static PyObject *__pyx_n_s_TypeError;
2421 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2422 static PyObject *__pyx_n_s_ValueError;
2423 static PyObject *__pyx_n_s_View_MemoryView;
2424 static PyObject *__pyx_n_s_allocate_buffer;
2425 static PyObject *__pyx_n_s_alpha;
2426 static PyObject *__pyx_n_s_alphac;
2427 static PyObject *__pyx_n_s_asarray;
2428 static PyObject *__pyx_n_s_b;
2429 static PyObject *__pyx_n_s_base;
2430 static PyObject *__pyx_n_s_beta;
2431 static PyObject *__pyx_n_s_betac;
2432 static PyObject *__pyx_n_s_bounds;
2433 static PyObject *__pyx_n_s_c;
2434 static PyObject *__pyx_n_u_c;
2435 static PyObject *__pyx_n_s_class;
2436 static PyObject *__pyx_n_s_cline_in_traceback;
2437 static PyObject *__pyx_kp_s_contiguous_and_direct;
2438 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2439 static PyObject *__pyx_n_s_dict;
2440 static PyObject *__pyx_n_s_dtype_is_object;
2441 static PyObject *__pyx_n_s_empty;
2442 static PyObject *__pyx_n_s_encode;
2443 static PyObject *__pyx_n_s_enumerate;
2444 static PyObject *__pyx_n_s_eps;
2445 static PyObject *__pyx_n_s_err;
2446 static PyObject *__pyx_n_s_error;
2447 static PyObject *__pyx_n_s_finfo;
2448 static PyObject *__pyx_n_s_flags;
2449 static PyObject *__pyx_n_s_format;
2450 static PyObject *__pyx_n_s_fortran;
2451 static PyObject *__pyx_n_u_fortran;
2452 static PyObject *__pyx_n_s_gamma;
2453 static PyObject *__pyx_n_s_gammac;
2454 static PyObject *__pyx_n_s_getstate;
2455 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2456 static PyObject *__pyx_n_s_holt;
2457 static PyObject *__pyx_n_s_holt_add_dam;
2458 static PyObject *__pyx_n_s_holt_mul_dam;
2459 static PyObject *__pyx_n_s_holt_win__add;
2460 static PyObject *__pyx_n_s_holt_win__mul;
2461 static PyObject *__pyx_n_s_holt_win_add_add_dam;
2462 static PyObject *__pyx_n_s_holt_win_add_mul_dam;
2463 static PyObject *__pyx_n_s_holt_win_mul_add_dam;
2464 static PyObject *__pyx_n_s_holt_win_mul_mul_dam;
2465 static PyObject *__pyx_n_s_hw_args;
2466 static PyObject *__pyx_n_s_i;
2467 static PyObject *__pyx_n_s_id;
2468 static PyObject *__pyx_n_s_import;
2469 static PyObject *__pyx_n_s_itemsize;
2470 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2471 static PyObject *__pyx_n_s_l;
2472 static PyObject *__pyx_n_s_m;
2473 static PyObject *__pyx_n_s_main;
2474 static PyObject *__pyx_n_s_memview;
2475 static PyObject *__pyx_n_s_mode;
2476 static PyObject *__pyx_n_s_n;
2477 static PyObject *__pyx_n_s_name;
2478 static PyObject *__pyx_n_s_name_2;
2479 static PyObject *__pyx_n_s_ndim;
2480 static PyObject *__pyx_n_s_new;
2481 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2482 static PyObject *__pyx_n_s_np;
2483 static PyObject *__pyx_n_s_numpy;
2484 static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
2485 static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
2486 static PyObject *__pyx_n_s_obj;
2487 static PyObject *__pyx_n_s_p;
2488 static PyObject *__pyx_n_s_pack;
2489 static PyObject *__pyx_n_s_phi;
2490 static PyObject *__pyx_n_s_pickle;
2491 static PyObject *__pyx_n_s_pyx_PickleError;
2492 static PyObject *__pyx_n_s_pyx_checksum;
2493 static PyObject *__pyx_n_s_pyx_getbuffer;
2494 static PyObject *__pyx_n_s_pyx_result;
2495 static PyObject *__pyx_n_s_pyx_state;
2496 static PyObject *__pyx_n_s_pyx_type;
2497 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2498 static PyObject *__pyx_n_s_pyx_unpickle_HoltWintersArgs;
2499 static PyObject *__pyx_n_s_pyx_vtable;
2500 static PyObject *__pyx_n_s_range;
2501 static PyObject *__pyx_n_s_reduce;
2502 static PyObject *__pyx_n_s_reduce_cython;
2503 static PyObject *__pyx_n_s_reduce_ex;
2504 static PyObject *__pyx_n_s_s;
2505 static PyObject *__pyx_n_s_sel;
2506 static PyObject *__pyx_n_s_setstate;
2507 static PyObject *__pyx_n_s_setstate_cython;
2508 static PyObject *__pyx_n_s_shape;
2509 static PyObject *__pyx_n_s_size;
2510 static PyObject *__pyx_n_s_sqrt;
2511 static PyObject *__pyx_n_s_start;
2512 static PyObject *__pyx_kp_s_statsmodels_tsa_holtwinters__exp;
2513 static PyObject *__pyx_n_s_statsmodels_tsa_holtwinters__exp_2;
2514 static PyObject *__pyx_n_s_step;
2515 static PyObject *__pyx_n_s_stop;
2516 static PyObject *__pyx_kp_s_strided_and_direct;
2517 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2518 static PyObject *__pyx_kp_s_strided_and_indirect;
2519 static PyObject *__pyx_kp_s_stringsource;
2520 static PyObject *__pyx_n_s_struct;
2521 static PyObject *__pyx_n_s_test;
2522 static PyObject *__pyx_n_s_test_to_restricted;
2523 static PyObject *__pyx_n_s_transform;
2524 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2525 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2526 static PyObject *__pyx_n_s_unpack;
2527 static PyObject *__pyx_n_s_update;
2528 static PyObject *__pyx_n_s_x;
2529 static PyObject *__pyx_n_s_xi;
2530 static PyObject *__pyx_n_s_y;
2531 static int __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs___init__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self, __Pyx_memviewslice __pyx_v_xi, __Pyx_memviewslice __pyx_v_p, __Pyx_memviewslice __pyx_v_bounds, __Pyx_memviewslice __pyx_v_y, Py_ssize_t __pyx_v_m, Py_ssize_t __pyx_v_n, int __pyx_v_transform); /* proto */
2532 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2533 static int __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_2__set__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2534 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1p___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2535 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_6bounds___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2536 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1y___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2537 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3lvl___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2538 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1b___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2539 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1s___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2540 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1m___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2541 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1n___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2542 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2543 static int __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_2__set__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2544 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2__reduce_cython__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self); /* proto */
2545 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_4__setstate_cython__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2546 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers__test_to_restricted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_sel, PyObject *__pyx_v_bounds); /* proto */
2547 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_2holt__(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2548 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_4holt_mul_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2549 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_6holt_add_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2550 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_8holt_win_add_add_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2551 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_10holt_win__add(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2552 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_12holt_win__mul(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2553 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_14holt_win_mul_mul_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2554 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_16holt_win_add_mul_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2555 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_18holt_win_mul_add_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args); /* proto */
2556 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_20__pyx_unpickle_HoltWintersArgs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2557 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2558 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2559 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2560 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2561 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2562 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2563 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2564 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2565 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2566 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2567 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2568 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2569 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2570 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2571 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2572 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2573 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2574 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2575 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2576 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2577 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2578 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2579 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2580 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2581 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2582 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2583 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2584 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2585 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2586 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2587 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2588 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2589 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2590 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2591 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2592 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2593 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2594 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2595 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2596 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2597 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2598 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2599 static PyObject *__pyx_tp_new_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2600 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2601 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2602 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2603 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2604 static PyObject *__pyx_int_0;
2605 static PyObject *__pyx_int_1;
2606 static PyObject *__pyx_int_184977713;
2607 static PyObject *__pyx_int_194727133;
2608 static PyObject *__pyx_int_neg_1;
2609 static PyObject *__pyx_tuple_;
2610 static PyObject *__pyx_tuple__2;
2611 static PyObject *__pyx_tuple__3;
2612 static PyObject *__pyx_tuple__4;
2613 static PyObject *__pyx_tuple__5;
2614 static PyObject *__pyx_tuple__6;
2615 static PyObject *__pyx_tuple__7;
2616 static PyObject *__pyx_tuple__8;
2617 static PyObject *__pyx_tuple__9;
2618 static PyObject *__pyx_slice__17;
2619 static PyObject *__pyx_tuple__10;
2620 static PyObject *__pyx_tuple__11;
2621 static PyObject *__pyx_tuple__12;
2622 static PyObject *__pyx_tuple__13;
2623 static PyObject *__pyx_tuple__14;
2624 static PyObject *__pyx_tuple__15;
2625 static PyObject *__pyx_tuple__16;
2626 static PyObject *__pyx_tuple__18;
2627 static PyObject *__pyx_tuple__19;
2628 static PyObject *__pyx_tuple__20;
2629 static PyObject *__pyx_tuple__21;
2630 static PyObject *__pyx_tuple__23;
2631 static PyObject *__pyx_tuple__25;
2632 static PyObject *__pyx_tuple__27;
2633 static PyObject *__pyx_tuple__29;
2634 static PyObject *__pyx_tuple__31;
2635 static PyObject *__pyx_tuple__33;
2636 static PyObject *__pyx_tuple__35;
2637 static PyObject *__pyx_tuple__37;
2638 static PyObject *__pyx_tuple__39;
2639 static PyObject *__pyx_tuple__41;
2640 static PyObject *__pyx_tuple__43;
2641 static PyObject *__pyx_tuple__44;
2642 static PyObject *__pyx_tuple__45;
2643 static PyObject *__pyx_tuple__46;
2644 static PyObject *__pyx_tuple__47;
2645 static PyObject *__pyx_tuple__48;
2646 static PyObject *__pyx_codeobj__22;
2647 static PyObject *__pyx_codeobj__24;
2648 static PyObject *__pyx_codeobj__26;
2649 static PyObject *__pyx_codeobj__28;
2650 static PyObject *__pyx_codeobj__30;
2651 static PyObject *__pyx_codeobj__32;
2652 static PyObject *__pyx_codeobj__34;
2653 static PyObject *__pyx_codeobj__36;
2654 static PyObject *__pyx_codeobj__38;
2655 static PyObject *__pyx_codeobj__40;
2656 static PyObject *__pyx_codeobj__42;
2657 static PyObject *__pyx_codeobj__49;
2658 /* Late includes */
2659 
2660 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":20
2661  *     cdef bint _transform
2662  *
2663  *     def __init__(             # <<<<<<<<<<<<<<
2664  *         self,
2665  *         long[::1] xi,
2666  */
2667 
2668 /* Python wrapper */
2669 static int __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2670 static int __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2671   __Pyx_memviewslice __pyx_v_xi = { 0, 0, { 0 }, { 0 }, { 0 } };
2672   __Pyx_memviewslice __pyx_v_p = { 0, 0, { 0 }, { 0 }, { 0 } };
2673   __Pyx_memviewslice __pyx_v_bounds = { 0, 0, { 0 }, { 0 }, { 0 } };
2674   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
2675   Py_ssize_t __pyx_v_m;
2676   Py_ssize_t __pyx_v_n;
2677   int __pyx_v_transform;
2678   int __pyx_lineno = 0;
2679   const char *__pyx_filename = NULL;
2680   int __pyx_clineno = 0;
2681   int __pyx_r;
2682   __Pyx_RefNannyDeclarations
2683   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2684   {
2685     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xi,&__pyx_n_s_p,&__pyx_n_s_bounds,&__pyx_n_s_y,&__pyx_n_s_m,&__pyx_n_s_n,&__pyx_n_s_transform,0};
2686     PyObject* values[7] = {0,0,0,0,0,0,0};
2687     if (unlikely(__pyx_kwds)) {
2688       Py_ssize_t kw_args;
2689       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2690       switch (pos_args) {
2691         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2692         CYTHON_FALLTHROUGH;
2693         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2694         CYTHON_FALLTHROUGH;
2695         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2696         CYTHON_FALLTHROUGH;
2697         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2698         CYTHON_FALLTHROUGH;
2699         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2700         CYTHON_FALLTHROUGH;
2701         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2702         CYTHON_FALLTHROUGH;
2703         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2704         CYTHON_FALLTHROUGH;
2705         case  0: break;
2706         default: goto __pyx_L5_argtuple_error;
2707       }
2708       kw_args = PyDict_Size(__pyx_kwds);
2709       switch (pos_args) {
2710         case  0:
2711         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xi)) != 0)) kw_args--;
2712         else goto __pyx_L5_argtuple_error;
2713         CYTHON_FALLTHROUGH;
2714         case  1:
2715         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
2716         else {
2717           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 1); __PYX_ERR(0, 20, __pyx_L3_error)
2718         }
2719         CYTHON_FALLTHROUGH;
2720         case  2:
2721         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--;
2722         else {
2723           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 2); __PYX_ERR(0, 20, __pyx_L3_error)
2724         }
2725         CYTHON_FALLTHROUGH;
2726         case  3:
2727         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
2728         else {
2729           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 3); __PYX_ERR(0, 20, __pyx_L3_error)
2730         }
2731         CYTHON_FALLTHROUGH;
2732         case  4:
2733         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
2734         else {
2735           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 4); __PYX_ERR(0, 20, __pyx_L3_error)
2736         }
2737         CYTHON_FALLTHROUGH;
2738         case  5:
2739         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
2740         else {
2741           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 5); __PYX_ERR(0, 20, __pyx_L3_error)
2742         }
2743         CYTHON_FALLTHROUGH;
2744         case  6:
2745         if (kw_args > 0) {
2746           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transform);
2747           if (value) { values[6] = value; kw_args--; }
2748         }
2749       }
2750       if (unlikely(kw_args > 0)) {
2751         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 20, __pyx_L3_error)
2752       }
2753     } else {
2754       switch (PyTuple_GET_SIZE(__pyx_args)) {
2755         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2756         CYTHON_FALLTHROUGH;
2757         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2758         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2759         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2760         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2761         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2762         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2763         break;
2764         default: goto __pyx_L5_argtuple_error;
2765       }
2766     }
2767     __pyx_v_xi = __Pyx_PyObject_to_MemoryviewSlice_dc_long(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_xi.memview)) __PYX_ERR(0, 22, __pyx_L3_error)
2768     __pyx_v_p = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_p.memview)) __PYX_ERR(0, 23, __pyx_L3_error)
2769     __pyx_v_bounds = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_bounds.memview)) __PYX_ERR(0, 24, __pyx_L3_error)
2770     __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 25, __pyx_L3_error)
2771     __pyx_v_m = __Pyx_PyIndex_AsSsize_t(values[4]); if (unlikely((__pyx_v_m == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error)
2772     __pyx_v_n = __Pyx_PyIndex_AsSsize_t(values[5]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
2773     if (values[6]) {
2774       __pyx_v_transform = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_transform == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
2775     } else {
2776 
2777       /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":28
2778  *         Py_ssize_t m,
2779  *         Py_ssize_t n,
2780  *         bint transform=False,             # <<<<<<<<<<<<<<
2781  *     ):
2782  *         self._xi = xi
2783  */
2784       __pyx_v_transform = ((int)0);
2785     }
2786   }
2787   goto __pyx_L4_argument_unpacking_done;
2788   __pyx_L5_argtuple_error:;
2789   __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 20, __pyx_L3_error)
2790   __pyx_L3_error:;
2791   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2792   __Pyx_RefNannyFinishContext();
2793   return -1;
2794   __pyx_L4_argument_unpacking_done:;
2795   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs___init__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self), __pyx_v_xi, __pyx_v_p, __pyx_v_bounds, __pyx_v_y, __pyx_v_m, __pyx_v_n, __pyx_v_transform);
2796 
2797   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":20
2798  *     cdef bint _transform
2799  *
2800  *     def __init__(             # <<<<<<<<<<<<<<
2801  *         self,
2802  *         long[::1] xi,
2803  */
2804 
2805   /* function exit code */
2806   __Pyx_RefNannyFinishContext();
2807   return __pyx_r;
2808 }
2809 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs___init__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self,__Pyx_memviewslice __pyx_v_xi,__Pyx_memviewslice __pyx_v_p,__Pyx_memviewslice __pyx_v_bounds,__Pyx_memviewslice __pyx_v_y,Py_ssize_t __pyx_v_m,Py_ssize_t __pyx_v_n,int __pyx_v_transform)2810 static int __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs___init__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self, __Pyx_memviewslice __pyx_v_xi, __Pyx_memviewslice __pyx_v_p, __Pyx_memviewslice __pyx_v_bounds, __Pyx_memviewslice __pyx_v_y, Py_ssize_t __pyx_v_m, Py_ssize_t __pyx_v_n, int __pyx_v_transform) {
2811   int __pyx_r;
2812   __Pyx_RefNannyDeclarations
2813   PyObject *__pyx_t_1 = NULL;
2814   PyObject *__pyx_t_2 = NULL;
2815   PyObject *__pyx_t_3 = NULL;
2816   PyObject *__pyx_t_4 = NULL;
2817   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
2818   int __pyx_lineno = 0;
2819   const char *__pyx_filename = NULL;
2820   int __pyx_clineno = 0;
2821   __Pyx_RefNannySetupContext("__init__", 0);
2822 
2823   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":30
2824  *         bint transform=False,
2825  *     ):
2826  *         self._xi = xi             # <<<<<<<<<<<<<<
2827  *         self._p = p
2828  *         self._bounds = bounds
2829  */
2830   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_xi, 0);
2831   __PYX_INC_MEMVIEW(&__pyx_v_xi, 0);
2832   __pyx_v_self->_xi = __pyx_v_xi;
2833 
2834   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":31
2835  *     ):
2836  *         self._xi = xi
2837  *         self._p = p             # <<<<<<<<<<<<<<
2838  *         self._bounds = bounds
2839  *         self._y = y
2840  */
2841   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_p, 0);
2842   __PYX_INC_MEMVIEW(&__pyx_v_p, 0);
2843   __pyx_v_self->_p = __pyx_v_p;
2844 
2845   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":32
2846  *         self._xi = xi
2847  *         self._p = p
2848  *         self._bounds = bounds             # <<<<<<<<<<<<<<
2849  *         self._y = y
2850  *         self._l = np.empty(n)
2851  */
2852   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_bounds, 0);
2853   __PYX_INC_MEMVIEW(&__pyx_v_bounds, 0);
2854   __pyx_v_self->_bounds = __pyx_v_bounds;
2855 
2856   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":33
2857  *         self._p = p
2858  *         self._bounds = bounds
2859  *         self._y = y             # <<<<<<<<<<<<<<
2860  *         self._l = np.empty(n)
2861  *         self._b = np.empty(n)
2862  */
2863   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_y, 0);
2864   __PYX_INC_MEMVIEW(&__pyx_v_y, 0);
2865   __pyx_v_self->_y = __pyx_v_y;
2866 
2867   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":34
2868  *         self._bounds = bounds
2869  *         self._y = y
2870  *         self._l = np.empty(n)             # <<<<<<<<<<<<<<
2871  *         self._b = np.empty(n)
2872  *         self._s = np.empty(n + m - 1)
2873  */
2874   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
2875   __Pyx_GOTREF(__pyx_t_2);
2876   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
2877   __Pyx_GOTREF(__pyx_t_3);
2878   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2879   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
2880   __Pyx_GOTREF(__pyx_t_2);
2881   __pyx_t_4 = NULL;
2882   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2883     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2884     if (likely(__pyx_t_4)) {
2885       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2886       __Pyx_INCREF(__pyx_t_4);
2887       __Pyx_INCREF(function);
2888       __Pyx_DECREF_SET(__pyx_t_3, function);
2889     }
2890   }
2891   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
2892   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2893   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2894   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
2895   __Pyx_GOTREF(__pyx_t_1);
2896   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2897   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 34, __pyx_L1_error)
2898   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2899   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_l, 0);
2900   __pyx_v_self->_l = __pyx_t_5;
2901   __pyx_t_5.memview = NULL;
2902   __pyx_t_5.data = NULL;
2903 
2904   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":35
2905  *         self._y = y
2906  *         self._l = np.empty(n)
2907  *         self._b = np.empty(n)             # <<<<<<<<<<<<<<
2908  *         self._s = np.empty(n + m - 1)
2909  *         self._m = m
2910  */
2911   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
2912   __Pyx_GOTREF(__pyx_t_3);
2913   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
2914   __Pyx_GOTREF(__pyx_t_2);
2915   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2916   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
2917   __Pyx_GOTREF(__pyx_t_3);
2918   __pyx_t_4 = NULL;
2919   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
2920     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
2921     if (likely(__pyx_t_4)) {
2922       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2923       __Pyx_INCREF(__pyx_t_4);
2924       __Pyx_INCREF(function);
2925       __Pyx_DECREF_SET(__pyx_t_2, function);
2926     }
2927   }
2928   __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);
2929   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2930   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2931   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
2932   __Pyx_GOTREF(__pyx_t_1);
2933   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2934   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
2935   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2936   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b, 0);
2937   __pyx_v_self->_b = __pyx_t_5;
2938   __pyx_t_5.memview = NULL;
2939   __pyx_t_5.data = NULL;
2940 
2941   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":36
2942  *         self._l = np.empty(n)
2943  *         self._b = np.empty(n)
2944  *         self._s = np.empty(n + m - 1)             # <<<<<<<<<<<<<<
2945  *         self._m = m
2946  *         self._n = n
2947  */
2948   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
2949   __Pyx_GOTREF(__pyx_t_2);
2950   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
2951   __Pyx_GOTREF(__pyx_t_3);
2952   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2953   __pyx_t_2 = PyInt_FromSsize_t(((__pyx_v_n + __pyx_v_m) - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
2954   __Pyx_GOTREF(__pyx_t_2);
2955   __pyx_t_4 = NULL;
2956   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2957     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2958     if (likely(__pyx_t_4)) {
2959       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2960       __Pyx_INCREF(__pyx_t_4);
2961       __Pyx_INCREF(function);
2962       __Pyx_DECREF_SET(__pyx_t_3, function);
2963     }
2964   }
2965   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
2966   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2967   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2968   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
2969   __Pyx_GOTREF(__pyx_t_1);
2970   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2971   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 36, __pyx_L1_error)
2972   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2973   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_s, 0);
2974   __pyx_v_self->_s = __pyx_t_5;
2975   __pyx_t_5.memview = NULL;
2976   __pyx_t_5.data = NULL;
2977 
2978   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":37
2979  *         self._b = np.empty(n)
2980  *         self._s = np.empty(n + m - 1)
2981  *         self._m = m             # <<<<<<<<<<<<<<
2982  *         self._n = n
2983  *         self._transform = transform
2984  */
2985   __pyx_v_self->_m = __pyx_v_m;
2986 
2987   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":38
2988  *         self._s = np.empty(n + m - 1)
2989  *         self._m = m
2990  *         self._n = n             # <<<<<<<<<<<<<<
2991  *         self._transform = transform
2992  *
2993  */
2994   __pyx_v_self->_n = __pyx_v_n;
2995 
2996   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":39
2997  *         self._m = m
2998  *         self._n = n
2999  *         self._transform = transform             # <<<<<<<<<<<<<<
3000  *
3001  *     @property
3002  */
3003   __pyx_v_self->_transform = __pyx_v_transform;
3004 
3005   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":20
3006  *     cdef bint _transform
3007  *
3008  *     def __init__(             # <<<<<<<<<<<<<<
3009  *         self,
3010  *         long[::1] xi,
3011  */
3012 
3013   /* function exit code */
3014   __pyx_r = 0;
3015   goto __pyx_L0;
3016   __pyx_L1_error:;
3017   __Pyx_XDECREF(__pyx_t_1);
3018   __Pyx_XDECREF(__pyx_t_2);
3019   __Pyx_XDECREF(__pyx_t_3);
3020   __Pyx_XDECREF(__pyx_t_4);
3021   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
3022   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3023   __pyx_r = -1;
3024   __pyx_L0:;
3025   __PYX_XDEC_MEMVIEW(&__pyx_v_xi, 1);
3026   __PYX_XDEC_MEMVIEW(&__pyx_v_p, 1);
3027   __PYX_XDEC_MEMVIEW(&__pyx_v_bounds, 1);
3028   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
3029   __Pyx_RefNannyFinishContext();
3030   return __pyx_r;
3031 }
3032 
3033 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":42
3034  *
3035  *     @property
3036  *     def xi(self):             # <<<<<<<<<<<<<<
3037  *         return np.asarray(self._xi)
3038  *
3039  */
3040 
3041 /* Python wrapper */
3042 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_1__get__(PyObject * __pyx_v_self)3043 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_1__get__(PyObject *__pyx_v_self) {
3044   PyObject *__pyx_r = 0;
3045   __Pyx_RefNannyDeclarations
3046   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3047   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3048 
3049   /* function exit code */
3050   __Pyx_RefNannyFinishContext();
3051   return __pyx_r;
3052 }
3053 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3054 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3055   PyObject *__pyx_r = NULL;
3056   __Pyx_RefNannyDeclarations
3057   PyObject *__pyx_t_1 = NULL;
3058   PyObject *__pyx_t_2 = NULL;
3059   PyObject *__pyx_t_3 = NULL;
3060   PyObject *__pyx_t_4 = NULL;
3061   int __pyx_lineno = 0;
3062   const char *__pyx_filename = NULL;
3063   int __pyx_clineno = 0;
3064   __Pyx_RefNannySetupContext("__get__", 0);
3065 
3066   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":43
3067  *     @property
3068  *     def xi(self):
3069  *         return np.asarray(self._xi)             # <<<<<<<<<<<<<<
3070  *
3071  *     @xi.setter
3072  */
3073   __Pyx_XDECREF(__pyx_r);
3074   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3075   __Pyx_GOTREF(__pyx_t_2);
3076   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
3077   __Pyx_GOTREF(__pyx_t_3);
3078   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3079   if (unlikely(!__pyx_v_self->_xi.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 43, __pyx_L1_error)}
3080   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_xi, 1, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3081   __Pyx_GOTREF(__pyx_t_2);
3082   __pyx_t_4 = NULL;
3083   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3084     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3085     if (likely(__pyx_t_4)) {
3086       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3087       __Pyx_INCREF(__pyx_t_4);
3088       __Pyx_INCREF(function);
3089       __Pyx_DECREF_SET(__pyx_t_3, function);
3090     }
3091   }
3092   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3093   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3094   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3095   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
3096   __Pyx_GOTREF(__pyx_t_1);
3097   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3098   __pyx_r = __pyx_t_1;
3099   __pyx_t_1 = 0;
3100   goto __pyx_L0;
3101 
3102   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":42
3103  *
3104  *     @property
3105  *     def xi(self):             # <<<<<<<<<<<<<<
3106  *         return np.asarray(self._xi)
3107  *
3108  */
3109 
3110   /* function exit code */
3111   __pyx_L1_error:;
3112   __Pyx_XDECREF(__pyx_t_1);
3113   __Pyx_XDECREF(__pyx_t_2);
3114   __Pyx_XDECREF(__pyx_t_3);
3115   __Pyx_XDECREF(__pyx_t_4);
3116   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.xi.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3117   __pyx_r = NULL;
3118   __pyx_L0:;
3119   __Pyx_XGIVEREF(__pyx_r);
3120   __Pyx_RefNannyFinishContext();
3121   return __pyx_r;
3122 }
3123 
3124 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":46
3125  *
3126  *     @xi.setter
3127  *     def xi(self, value):             # <<<<<<<<<<<<<<
3128  *         self._xi = value
3129  *
3130  */
3131 
3132 /* Python wrapper */
3133 static int __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3134 static int __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3135   int __pyx_r;
3136   __Pyx_RefNannyDeclarations
3137   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3138   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_2__set__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3139 
3140   /* function exit code */
3141   __Pyx_RefNannyFinishContext();
3142   return __pyx_r;
3143 }
3144 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_2__set__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self,PyObject * __pyx_v_value)3145 static int __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_2__set__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self, PyObject *__pyx_v_value) {
3146   int __pyx_r;
3147   __Pyx_RefNannyDeclarations
3148   __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
3149   int __pyx_lineno = 0;
3150   const char *__pyx_filename = NULL;
3151   int __pyx_clineno = 0;
3152   __Pyx_RefNannySetupContext("__set__", 0);
3153 
3154   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":47
3155  *     @xi.setter
3156  *     def xi(self, value):
3157  *         self._xi = value             # <<<<<<<<<<<<<<
3158  *
3159  *     @property
3160  */
3161   __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_v_value, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 47, __pyx_L1_error)
3162   __PYX_XDEC_MEMVIEW(&__pyx_v_self->_xi, 0);
3163   __pyx_v_self->_xi = __pyx_t_1;
3164   __pyx_t_1.memview = NULL;
3165   __pyx_t_1.data = NULL;
3166 
3167   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":46
3168  *
3169  *     @xi.setter
3170  *     def xi(self, value):             # <<<<<<<<<<<<<<
3171  *         self._xi = value
3172  *
3173  */
3174 
3175   /* function exit code */
3176   __pyx_r = 0;
3177   goto __pyx_L0;
3178   __pyx_L1_error:;
3179   __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
3180   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.xi.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3181   __pyx_r = -1;
3182   __pyx_L0:;
3183   __Pyx_RefNannyFinishContext();
3184   return __pyx_r;
3185 }
3186 
3187 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":50
3188  *
3189  *     @property
3190  *     def p(self):             # <<<<<<<<<<<<<<
3191  *         return np.asarray(self._p)
3192  *
3193  */
3194 
3195 /* Python wrapper */
3196 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1p_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1p_1__get__(PyObject * __pyx_v_self)3197 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1p_1__get__(PyObject *__pyx_v_self) {
3198   PyObject *__pyx_r = 0;
3199   __Pyx_RefNannyDeclarations
3200   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3201   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1p___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3202 
3203   /* function exit code */
3204   __Pyx_RefNannyFinishContext();
3205   return __pyx_r;
3206 }
3207 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1p___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3208 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1p___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3209   PyObject *__pyx_r = NULL;
3210   __Pyx_RefNannyDeclarations
3211   PyObject *__pyx_t_1 = NULL;
3212   PyObject *__pyx_t_2 = NULL;
3213   PyObject *__pyx_t_3 = NULL;
3214   PyObject *__pyx_t_4 = NULL;
3215   int __pyx_lineno = 0;
3216   const char *__pyx_filename = NULL;
3217   int __pyx_clineno = 0;
3218   __Pyx_RefNannySetupContext("__get__", 0);
3219 
3220   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":51
3221  *     @property
3222  *     def p(self):
3223  *         return np.asarray(self._p)             # <<<<<<<<<<<<<<
3224  *
3225  *     @property
3226  */
3227   __Pyx_XDECREF(__pyx_r);
3228   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
3229   __Pyx_GOTREF(__pyx_t_2);
3230   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)
3231   __Pyx_GOTREF(__pyx_t_3);
3232   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3233   if (unlikely(!__pyx_v_self->_p.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 51, __pyx_L1_error)}
3234   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_p, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
3235   __Pyx_GOTREF(__pyx_t_2);
3236   __pyx_t_4 = NULL;
3237   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3238     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3239     if (likely(__pyx_t_4)) {
3240       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3241       __Pyx_INCREF(__pyx_t_4);
3242       __Pyx_INCREF(function);
3243       __Pyx_DECREF_SET(__pyx_t_3, function);
3244     }
3245   }
3246   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3247   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3248   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3249   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
3250   __Pyx_GOTREF(__pyx_t_1);
3251   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3252   __pyx_r = __pyx_t_1;
3253   __pyx_t_1 = 0;
3254   goto __pyx_L0;
3255 
3256   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":50
3257  *
3258  *     @property
3259  *     def p(self):             # <<<<<<<<<<<<<<
3260  *         return np.asarray(self._p)
3261  *
3262  */
3263 
3264   /* function exit code */
3265   __pyx_L1_error:;
3266   __Pyx_XDECREF(__pyx_t_1);
3267   __Pyx_XDECREF(__pyx_t_2);
3268   __Pyx_XDECREF(__pyx_t_3);
3269   __Pyx_XDECREF(__pyx_t_4);
3270   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.p.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3271   __pyx_r = NULL;
3272   __pyx_L0:;
3273   __Pyx_XGIVEREF(__pyx_r);
3274   __Pyx_RefNannyFinishContext();
3275   return __pyx_r;
3276 }
3277 
3278 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":54
3279  *
3280  *     @property
3281  *     def bounds(self):             # <<<<<<<<<<<<<<
3282  *         return np.asarray(self._bounds)
3283  *
3284  */
3285 
3286 /* Python wrapper */
3287 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_6bounds_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_6bounds_1__get__(PyObject * __pyx_v_self)3288 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_6bounds_1__get__(PyObject *__pyx_v_self) {
3289   PyObject *__pyx_r = 0;
3290   __Pyx_RefNannyDeclarations
3291   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3292   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_6bounds___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3293 
3294   /* function exit code */
3295   __Pyx_RefNannyFinishContext();
3296   return __pyx_r;
3297 }
3298 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_6bounds___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3299 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_6bounds___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3300   PyObject *__pyx_r = NULL;
3301   __Pyx_RefNannyDeclarations
3302   PyObject *__pyx_t_1 = NULL;
3303   PyObject *__pyx_t_2 = NULL;
3304   PyObject *__pyx_t_3 = NULL;
3305   PyObject *__pyx_t_4 = NULL;
3306   int __pyx_lineno = 0;
3307   const char *__pyx_filename = NULL;
3308   int __pyx_clineno = 0;
3309   __Pyx_RefNannySetupContext("__get__", 0);
3310 
3311   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":55
3312  *     @property
3313  *     def bounds(self):
3314  *         return np.asarray(self._bounds)             # <<<<<<<<<<<<<<
3315  *
3316  *     @property
3317  */
3318   __Pyx_XDECREF(__pyx_r);
3319   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
3320   __Pyx_GOTREF(__pyx_t_2);
3321   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
3322   __Pyx_GOTREF(__pyx_t_3);
3323   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3324   if (unlikely(!__pyx_v_self->_bounds.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 55, __pyx_L1_error)}
3325   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_bounds, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
3326   __Pyx_GOTREF(__pyx_t_2);
3327   __pyx_t_4 = NULL;
3328   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3329     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3330     if (likely(__pyx_t_4)) {
3331       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3332       __Pyx_INCREF(__pyx_t_4);
3333       __Pyx_INCREF(function);
3334       __Pyx_DECREF_SET(__pyx_t_3, function);
3335     }
3336   }
3337   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3338   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3339   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3340   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
3341   __Pyx_GOTREF(__pyx_t_1);
3342   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3343   __pyx_r = __pyx_t_1;
3344   __pyx_t_1 = 0;
3345   goto __pyx_L0;
3346 
3347   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":54
3348  *
3349  *     @property
3350  *     def bounds(self):             # <<<<<<<<<<<<<<
3351  *         return np.asarray(self._bounds)
3352  *
3353  */
3354 
3355   /* function exit code */
3356   __pyx_L1_error:;
3357   __Pyx_XDECREF(__pyx_t_1);
3358   __Pyx_XDECREF(__pyx_t_2);
3359   __Pyx_XDECREF(__pyx_t_3);
3360   __Pyx_XDECREF(__pyx_t_4);
3361   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.bounds.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3362   __pyx_r = NULL;
3363   __pyx_L0:;
3364   __Pyx_XGIVEREF(__pyx_r);
3365   __Pyx_RefNannyFinishContext();
3366   return __pyx_r;
3367 }
3368 
3369 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":58
3370  *
3371  *     @property
3372  *     def y(self):             # <<<<<<<<<<<<<<
3373  *         return np.asarray(self._y)
3374  *
3375  */
3376 
3377 /* Python wrapper */
3378 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1y_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1y_1__get__(PyObject * __pyx_v_self)3379 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1y_1__get__(PyObject *__pyx_v_self) {
3380   PyObject *__pyx_r = 0;
3381   __Pyx_RefNannyDeclarations
3382   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3383   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1y___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3384 
3385   /* function exit code */
3386   __Pyx_RefNannyFinishContext();
3387   return __pyx_r;
3388 }
3389 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1y___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3390 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1y___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3391   PyObject *__pyx_r = NULL;
3392   __Pyx_RefNannyDeclarations
3393   PyObject *__pyx_t_1 = NULL;
3394   PyObject *__pyx_t_2 = NULL;
3395   PyObject *__pyx_t_3 = NULL;
3396   PyObject *__pyx_t_4 = NULL;
3397   int __pyx_lineno = 0;
3398   const char *__pyx_filename = NULL;
3399   int __pyx_clineno = 0;
3400   __Pyx_RefNannySetupContext("__get__", 0);
3401 
3402   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":59
3403  *     @property
3404  *     def y(self):
3405  *         return np.asarray(self._y)             # <<<<<<<<<<<<<<
3406  *
3407  *     @property
3408  */
3409   __Pyx_XDECREF(__pyx_r);
3410   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
3411   __Pyx_GOTREF(__pyx_t_2);
3412   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
3413   __Pyx_GOTREF(__pyx_t_3);
3414   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3415   if (unlikely(!__pyx_v_self->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 59, __pyx_L1_error)}
3416   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_y, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
3417   __Pyx_GOTREF(__pyx_t_2);
3418   __pyx_t_4 = NULL;
3419   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3420     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3421     if (likely(__pyx_t_4)) {
3422       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3423       __Pyx_INCREF(__pyx_t_4);
3424       __Pyx_INCREF(function);
3425       __Pyx_DECREF_SET(__pyx_t_3, function);
3426     }
3427   }
3428   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3429   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3430   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3431   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
3432   __Pyx_GOTREF(__pyx_t_1);
3433   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3434   __pyx_r = __pyx_t_1;
3435   __pyx_t_1 = 0;
3436   goto __pyx_L0;
3437 
3438   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":58
3439  *
3440  *     @property
3441  *     def y(self):             # <<<<<<<<<<<<<<
3442  *         return np.asarray(self._y)
3443  *
3444  */
3445 
3446   /* function exit code */
3447   __pyx_L1_error:;
3448   __Pyx_XDECREF(__pyx_t_1);
3449   __Pyx_XDECREF(__pyx_t_2);
3450   __Pyx_XDECREF(__pyx_t_3);
3451   __Pyx_XDECREF(__pyx_t_4);
3452   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3453   __pyx_r = NULL;
3454   __pyx_L0:;
3455   __Pyx_XGIVEREF(__pyx_r);
3456   __Pyx_RefNannyFinishContext();
3457   return __pyx_r;
3458 }
3459 
3460 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":62
3461  *
3462  *     @property
3463  *     def lvl(self):             # <<<<<<<<<<<<<<
3464  *         return np.asarray(self._l)
3465  *
3466  */
3467 
3468 /* Python wrapper */
3469 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3lvl_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3lvl_1__get__(PyObject * __pyx_v_self)3470 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3lvl_1__get__(PyObject *__pyx_v_self) {
3471   PyObject *__pyx_r = 0;
3472   __Pyx_RefNannyDeclarations
3473   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3474   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3lvl___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3475 
3476   /* function exit code */
3477   __Pyx_RefNannyFinishContext();
3478   return __pyx_r;
3479 }
3480 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3lvl___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3481 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3lvl___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3482   PyObject *__pyx_r = NULL;
3483   __Pyx_RefNannyDeclarations
3484   PyObject *__pyx_t_1 = NULL;
3485   PyObject *__pyx_t_2 = NULL;
3486   PyObject *__pyx_t_3 = NULL;
3487   PyObject *__pyx_t_4 = NULL;
3488   int __pyx_lineno = 0;
3489   const char *__pyx_filename = NULL;
3490   int __pyx_clineno = 0;
3491   __Pyx_RefNannySetupContext("__get__", 0);
3492 
3493   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":63
3494  *     @property
3495  *     def lvl(self):
3496  *         return np.asarray(self._l)             # <<<<<<<<<<<<<<
3497  *
3498  *     @property
3499  */
3500   __Pyx_XDECREF(__pyx_r);
3501   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3502   __Pyx_GOTREF(__pyx_t_2);
3503   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3504   __Pyx_GOTREF(__pyx_t_3);
3505   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3506   if (unlikely(!__pyx_v_self->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 63, __pyx_L1_error)}
3507   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_l, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3508   __Pyx_GOTREF(__pyx_t_2);
3509   __pyx_t_4 = NULL;
3510   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3511     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3512     if (likely(__pyx_t_4)) {
3513       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3514       __Pyx_INCREF(__pyx_t_4);
3515       __Pyx_INCREF(function);
3516       __Pyx_DECREF_SET(__pyx_t_3, function);
3517     }
3518   }
3519   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3520   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3521   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3522   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
3523   __Pyx_GOTREF(__pyx_t_1);
3524   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3525   __pyx_r = __pyx_t_1;
3526   __pyx_t_1 = 0;
3527   goto __pyx_L0;
3528 
3529   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":62
3530  *
3531  *     @property
3532  *     def lvl(self):             # <<<<<<<<<<<<<<
3533  *         return np.asarray(self._l)
3534  *
3535  */
3536 
3537   /* function exit code */
3538   __pyx_L1_error:;
3539   __Pyx_XDECREF(__pyx_t_1);
3540   __Pyx_XDECREF(__pyx_t_2);
3541   __Pyx_XDECREF(__pyx_t_3);
3542   __Pyx_XDECREF(__pyx_t_4);
3543   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.lvl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3544   __pyx_r = NULL;
3545   __pyx_L0:;
3546   __Pyx_XGIVEREF(__pyx_r);
3547   __Pyx_RefNannyFinishContext();
3548   return __pyx_r;
3549 }
3550 
3551 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":66
3552  *
3553  *     @property
3554  *     def b(self):             # <<<<<<<<<<<<<<
3555  *         return np.asarray(self._b)
3556  *
3557  */
3558 
3559 /* Python wrapper */
3560 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1b_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1b_1__get__(PyObject * __pyx_v_self)3561 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1b_1__get__(PyObject *__pyx_v_self) {
3562   PyObject *__pyx_r = 0;
3563   __Pyx_RefNannyDeclarations
3564   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3565   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1b___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3566 
3567   /* function exit code */
3568   __Pyx_RefNannyFinishContext();
3569   return __pyx_r;
3570 }
3571 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1b___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3572 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1b___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3573   PyObject *__pyx_r = NULL;
3574   __Pyx_RefNannyDeclarations
3575   PyObject *__pyx_t_1 = NULL;
3576   PyObject *__pyx_t_2 = NULL;
3577   PyObject *__pyx_t_3 = NULL;
3578   PyObject *__pyx_t_4 = NULL;
3579   int __pyx_lineno = 0;
3580   const char *__pyx_filename = NULL;
3581   int __pyx_clineno = 0;
3582   __Pyx_RefNannySetupContext("__get__", 0);
3583 
3584   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":67
3585  *     @property
3586  *     def b(self):
3587  *         return np.asarray(self._b)             # <<<<<<<<<<<<<<
3588  *
3589  *     @property
3590  */
3591   __Pyx_XDECREF(__pyx_r);
3592   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
3593   __Pyx_GOTREF(__pyx_t_2);
3594   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
3595   __Pyx_GOTREF(__pyx_t_3);
3596   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3597   if (unlikely(!__pyx_v_self->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 67, __pyx_L1_error)}
3598   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_b, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
3599   __Pyx_GOTREF(__pyx_t_2);
3600   __pyx_t_4 = NULL;
3601   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3602     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3603     if (likely(__pyx_t_4)) {
3604       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3605       __Pyx_INCREF(__pyx_t_4);
3606       __Pyx_INCREF(function);
3607       __Pyx_DECREF_SET(__pyx_t_3, function);
3608     }
3609   }
3610   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3611   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3612   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3613   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
3614   __Pyx_GOTREF(__pyx_t_1);
3615   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3616   __pyx_r = __pyx_t_1;
3617   __pyx_t_1 = 0;
3618   goto __pyx_L0;
3619 
3620   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":66
3621  *
3622  *     @property
3623  *     def b(self):             # <<<<<<<<<<<<<<
3624  *         return np.asarray(self._b)
3625  *
3626  */
3627 
3628   /* function exit code */
3629   __pyx_L1_error:;
3630   __Pyx_XDECREF(__pyx_t_1);
3631   __Pyx_XDECREF(__pyx_t_2);
3632   __Pyx_XDECREF(__pyx_t_3);
3633   __Pyx_XDECREF(__pyx_t_4);
3634   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.b.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3635   __pyx_r = NULL;
3636   __pyx_L0:;
3637   __Pyx_XGIVEREF(__pyx_r);
3638   __Pyx_RefNannyFinishContext();
3639   return __pyx_r;
3640 }
3641 
3642 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":70
3643  *
3644  *     @property
3645  *     def s(self):             # <<<<<<<<<<<<<<
3646  *         return np.asarray(self._s)
3647  *
3648  */
3649 
3650 /* Python wrapper */
3651 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1s_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1s_1__get__(PyObject * __pyx_v_self)3652 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1s_1__get__(PyObject *__pyx_v_self) {
3653   PyObject *__pyx_r = 0;
3654   __Pyx_RefNannyDeclarations
3655   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3656   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1s___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3657 
3658   /* function exit code */
3659   __Pyx_RefNannyFinishContext();
3660   return __pyx_r;
3661 }
3662 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1s___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3663 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1s___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3664   PyObject *__pyx_r = NULL;
3665   __Pyx_RefNannyDeclarations
3666   PyObject *__pyx_t_1 = NULL;
3667   PyObject *__pyx_t_2 = NULL;
3668   PyObject *__pyx_t_3 = NULL;
3669   PyObject *__pyx_t_4 = NULL;
3670   int __pyx_lineno = 0;
3671   const char *__pyx_filename = NULL;
3672   int __pyx_clineno = 0;
3673   __Pyx_RefNannySetupContext("__get__", 0);
3674 
3675   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":71
3676  *     @property
3677  *     def s(self):
3678  *         return np.asarray(self._s)             # <<<<<<<<<<<<<<
3679  *
3680  *     @property
3681  */
3682   __Pyx_XDECREF(__pyx_r);
3683   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
3684   __Pyx_GOTREF(__pyx_t_2);
3685   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
3686   __Pyx_GOTREF(__pyx_t_3);
3687   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3688   if (unlikely(!__pyx_v_self->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 71, __pyx_L1_error)}
3689   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
3690   __Pyx_GOTREF(__pyx_t_2);
3691   __pyx_t_4 = NULL;
3692   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3693     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3694     if (likely(__pyx_t_4)) {
3695       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3696       __Pyx_INCREF(__pyx_t_4);
3697       __Pyx_INCREF(function);
3698       __Pyx_DECREF_SET(__pyx_t_3, function);
3699     }
3700   }
3701   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
3702   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3703   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3704   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
3705   __Pyx_GOTREF(__pyx_t_1);
3706   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3707   __pyx_r = __pyx_t_1;
3708   __pyx_t_1 = 0;
3709   goto __pyx_L0;
3710 
3711   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":70
3712  *
3713  *     @property
3714  *     def s(self):             # <<<<<<<<<<<<<<
3715  *         return np.asarray(self._s)
3716  *
3717  */
3718 
3719   /* function exit code */
3720   __pyx_L1_error:;
3721   __Pyx_XDECREF(__pyx_t_1);
3722   __Pyx_XDECREF(__pyx_t_2);
3723   __Pyx_XDECREF(__pyx_t_3);
3724   __Pyx_XDECREF(__pyx_t_4);
3725   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.s.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3726   __pyx_r = NULL;
3727   __pyx_L0:;
3728   __Pyx_XGIVEREF(__pyx_r);
3729   __Pyx_RefNannyFinishContext();
3730   return __pyx_r;
3731 }
3732 
3733 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":74
3734  *
3735  *     @property
3736  *     def m(self):             # <<<<<<<<<<<<<<
3737  *         return self._m
3738  *
3739  */
3740 
3741 /* Python wrapper */
3742 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1m_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1m_1__get__(PyObject * __pyx_v_self)3743 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1m_1__get__(PyObject *__pyx_v_self) {
3744   PyObject *__pyx_r = 0;
3745   __Pyx_RefNannyDeclarations
3746   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3747   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1m___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3748 
3749   /* function exit code */
3750   __Pyx_RefNannyFinishContext();
3751   return __pyx_r;
3752 }
3753 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1m___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3754 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1m___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3755   PyObject *__pyx_r = NULL;
3756   __Pyx_RefNannyDeclarations
3757   PyObject *__pyx_t_1 = NULL;
3758   int __pyx_lineno = 0;
3759   const char *__pyx_filename = NULL;
3760   int __pyx_clineno = 0;
3761   __Pyx_RefNannySetupContext("__get__", 0);
3762 
3763   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":75
3764  *     @property
3765  *     def m(self):
3766  *         return self._m             # <<<<<<<<<<<<<<
3767  *
3768  *     @property
3769  */
3770   __Pyx_XDECREF(__pyx_r);
3771   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
3772   __Pyx_GOTREF(__pyx_t_1);
3773   __pyx_r = __pyx_t_1;
3774   __pyx_t_1 = 0;
3775   goto __pyx_L0;
3776 
3777   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":74
3778  *
3779  *     @property
3780  *     def m(self):             # <<<<<<<<<<<<<<
3781  *         return self._m
3782  *
3783  */
3784 
3785   /* function exit code */
3786   __pyx_L1_error:;
3787   __Pyx_XDECREF(__pyx_t_1);
3788   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.m.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3789   __pyx_r = NULL;
3790   __pyx_L0:;
3791   __Pyx_XGIVEREF(__pyx_r);
3792   __Pyx_RefNannyFinishContext();
3793   return __pyx_r;
3794 }
3795 
3796 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":78
3797  *
3798  *     @property
3799  *     def n(self):             # <<<<<<<<<<<<<<
3800  *         return self._n
3801  *
3802  */
3803 
3804 /* Python wrapper */
3805 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1n_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1n_1__get__(PyObject * __pyx_v_self)3806 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1n_1__get__(PyObject *__pyx_v_self) {
3807   PyObject *__pyx_r = 0;
3808   __Pyx_RefNannyDeclarations
3809   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3810   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1n___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3811 
3812   /* function exit code */
3813   __Pyx_RefNannyFinishContext();
3814   return __pyx_r;
3815 }
3816 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1n___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3817 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1n___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3818   PyObject *__pyx_r = NULL;
3819   __Pyx_RefNannyDeclarations
3820   PyObject *__pyx_t_1 = NULL;
3821   int __pyx_lineno = 0;
3822   const char *__pyx_filename = NULL;
3823   int __pyx_clineno = 0;
3824   __Pyx_RefNannySetupContext("__get__", 0);
3825 
3826   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":79
3827  *     @property
3828  *     def n(self):
3829  *         return self._n             # <<<<<<<<<<<<<<
3830  *
3831  *     @property
3832  */
3833   __Pyx_XDECREF(__pyx_r);
3834   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
3835   __Pyx_GOTREF(__pyx_t_1);
3836   __pyx_r = __pyx_t_1;
3837   __pyx_t_1 = 0;
3838   goto __pyx_L0;
3839 
3840   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":78
3841  *
3842  *     @property
3843  *     def n(self):             # <<<<<<<<<<<<<<
3844  *         return self._n
3845  *
3846  */
3847 
3848   /* function exit code */
3849   __pyx_L1_error:;
3850   __Pyx_XDECREF(__pyx_t_1);
3851   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.n.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3852   __pyx_r = NULL;
3853   __pyx_L0:;
3854   __Pyx_XGIVEREF(__pyx_r);
3855   __Pyx_RefNannyFinishContext();
3856   return __pyx_r;
3857 }
3858 
3859 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":82
3860  *
3861  *     @property
3862  *     def transform(self):             # <<<<<<<<<<<<<<
3863  *         return self._transform
3864  *
3865  */
3866 
3867 /* Python wrapper */
3868 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_1__get__(PyObject * __pyx_v_self)3869 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_1__get__(PyObject *__pyx_v_self) {
3870   PyObject *__pyx_r = 0;
3871   __Pyx_RefNannyDeclarations
3872   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3873   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform___get__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3874 
3875   /* function exit code */
3876   __Pyx_RefNannyFinishContext();
3877   return __pyx_r;
3878 }
3879 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)3880 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform___get__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
3881   PyObject *__pyx_r = NULL;
3882   __Pyx_RefNannyDeclarations
3883   PyObject *__pyx_t_1 = NULL;
3884   int __pyx_lineno = 0;
3885   const char *__pyx_filename = NULL;
3886   int __pyx_clineno = 0;
3887   __Pyx_RefNannySetupContext("__get__", 0);
3888 
3889   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":83
3890  *     @property
3891  *     def transform(self):
3892  *         return self._transform             # <<<<<<<<<<<<<<
3893  *
3894  *     @transform.setter
3895  */
3896   __Pyx_XDECREF(__pyx_r);
3897   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_transform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
3898   __Pyx_GOTREF(__pyx_t_1);
3899   __pyx_r = __pyx_t_1;
3900   __pyx_t_1 = 0;
3901   goto __pyx_L0;
3902 
3903   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":82
3904  *
3905  *     @property
3906  *     def transform(self):             # <<<<<<<<<<<<<<
3907  *         return self._transform
3908  *
3909  */
3910 
3911   /* function exit code */
3912   __pyx_L1_error:;
3913   __Pyx_XDECREF(__pyx_t_1);
3914   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.transform.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3915   __pyx_r = NULL;
3916   __pyx_L0:;
3917   __Pyx_XGIVEREF(__pyx_r);
3918   __Pyx_RefNannyFinishContext();
3919   return __pyx_r;
3920 }
3921 
3922 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":86
3923  *
3924  *     @transform.setter
3925  *     def transform(self, value):             # <<<<<<<<<<<<<<
3926  *         self._transform = value
3927  *
3928  */
3929 
3930 /* Python wrapper */
3931 static int __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)3932 static int __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3933   int __pyx_r;
3934   __Pyx_RefNannyDeclarations
3935   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3936   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_2__set__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3937 
3938   /* function exit code */
3939   __Pyx_RefNannyFinishContext();
3940   return __pyx_r;
3941 }
3942 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_2__set__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self,PyObject * __pyx_v_value)3943 static int __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_2__set__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self, PyObject *__pyx_v_value) {
3944   int __pyx_r;
3945   __Pyx_RefNannyDeclarations
3946   int __pyx_t_1;
3947   int __pyx_lineno = 0;
3948   const char *__pyx_filename = NULL;
3949   int __pyx_clineno = 0;
3950   __Pyx_RefNannySetupContext("__set__", 0);
3951 
3952   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":87
3953  *     @transform.setter
3954  *     def transform(self, value):
3955  *         self._transform = value             # <<<<<<<<<<<<<<
3956  *
3957  * cdef to_restricted(double[::1] p, long[::1] sel, double[:, ::1] bounds):
3958  */
3959   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error)
3960   __pyx_v_self->_transform = __pyx_t_1;
3961 
3962   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":86
3963  *
3964  *     @transform.setter
3965  *     def transform(self, value):             # <<<<<<<<<<<<<<
3966  *         self._transform = value
3967  *
3968  */
3969 
3970   /* function exit code */
3971   __pyx_r = 0;
3972   goto __pyx_L0;
3973   __pyx_L1_error:;
3974   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.transform.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3975   __pyx_r = -1;
3976   __pyx_L0:;
3977   __Pyx_RefNannyFinishContext();
3978   return __pyx_r;
3979 }
3980 
3981 /* "(tree fragment)":1
3982  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
3983  *     cdef tuple state
3984  *     cdef object _dict
3985  */
3986 
3987 /* Python wrapper */
3988 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3989 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3990   PyObject *__pyx_r = 0;
3991   __Pyx_RefNannyDeclarations
3992   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3993   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2__reduce_cython__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self));
3994 
3995   /* function exit code */
3996   __Pyx_RefNannyFinishContext();
3997   return __pyx_r;
3998 }
3999 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2__reduce_cython__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self)4000 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2__reduce_cython__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self) {
4001   PyObject *__pyx_v_state = 0;
4002   PyObject *__pyx_v__dict = 0;
4003   int __pyx_v_use_setstate;
4004   PyObject *__pyx_r = NULL;
4005   __Pyx_RefNannyDeclarations
4006   PyObject *__pyx_t_1 = NULL;
4007   PyObject *__pyx_t_2 = NULL;
4008   PyObject *__pyx_t_3 = NULL;
4009   PyObject *__pyx_t_4 = NULL;
4010   PyObject *__pyx_t_5 = NULL;
4011   PyObject *__pyx_t_6 = NULL;
4012   PyObject *__pyx_t_7 = NULL;
4013   PyObject *__pyx_t_8 = NULL;
4014   PyObject *__pyx_t_9 = NULL;
4015   PyObject *__pyx_t_10 = NULL;
4016   PyObject *__pyx_t_11 = NULL;
4017   int __pyx_t_12;
4018   int __pyx_t_13;
4019   int __pyx_lineno = 0;
4020   const char *__pyx_filename = NULL;
4021   int __pyx_clineno = 0;
4022   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4023 
4024   /* "(tree fragment)":5
4025  *     cdef object _dict
4026  *     cdef bint use_setstate
4027  *     state = (self._b, self._bounds, self._l, self._m, self._n, self._p, self._s, self._transform, self._xi, self._y)             # <<<<<<<<<<<<<<
4028  *     _dict = getattr(self, '__dict__', None)
4029  *     if _dict is not None:
4030  */
4031   if (unlikely(!__pyx_v_self->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
4032   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4033   __Pyx_GOTREF(__pyx_t_1);
4034   if (unlikely(!__pyx_v_self->_bounds.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
4035   __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->_bounds, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4036   __Pyx_GOTREF(__pyx_t_2);
4037   if (unlikely(!__pyx_v_self->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
4038   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->_l, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4039   __Pyx_GOTREF(__pyx_t_3);
4040   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_self->_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
4041   __Pyx_GOTREF(__pyx_t_4);
4042   __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_self->_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
4043   __Pyx_GOTREF(__pyx_t_5);
4044   if (unlikely(!__pyx_v_self->_p.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
4045   __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_self->_p, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
4046   __Pyx_GOTREF(__pyx_t_6);
4047   if (unlikely(!__pyx_v_self->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
4048   __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_self->_s, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
4049   __Pyx_GOTREF(__pyx_t_7);
4050   __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->_transform); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error)
4051   __Pyx_GOTREF(__pyx_t_8);
4052   if (unlikely(!__pyx_v_self->_xi.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
4053   __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_self->_xi, 1, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5, __pyx_L1_error)
4054   __Pyx_GOTREF(__pyx_t_9);
4055   if (unlikely(!__pyx_v_self->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(1, 5, __pyx_L1_error)}
4056   __pyx_t_10 = __pyx_memoryview_fromslice(__pyx_v_self->_y, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 5, __pyx_L1_error)
4057   __Pyx_GOTREF(__pyx_t_10);
4058   __pyx_t_11 = PyTuple_New(10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 5, __pyx_L1_error)
4059   __Pyx_GOTREF(__pyx_t_11);
4060   __Pyx_GIVEREF(__pyx_t_1);
4061   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
4062   __Pyx_GIVEREF(__pyx_t_2);
4063   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2);
4064   __Pyx_GIVEREF(__pyx_t_3);
4065   PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3);
4066   __Pyx_GIVEREF(__pyx_t_4);
4067   PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4);
4068   __Pyx_GIVEREF(__pyx_t_5);
4069   PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5);
4070   __Pyx_GIVEREF(__pyx_t_6);
4071   PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_6);
4072   __Pyx_GIVEREF(__pyx_t_7);
4073   PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_7);
4074   __Pyx_GIVEREF(__pyx_t_8);
4075   PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_8);
4076   __Pyx_GIVEREF(__pyx_t_9);
4077   PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_9);
4078   __Pyx_GIVEREF(__pyx_t_10);
4079   PyTuple_SET_ITEM(__pyx_t_11, 9, __pyx_t_10);
4080   __pyx_t_1 = 0;
4081   __pyx_t_2 = 0;
4082   __pyx_t_3 = 0;
4083   __pyx_t_4 = 0;
4084   __pyx_t_5 = 0;
4085   __pyx_t_6 = 0;
4086   __pyx_t_7 = 0;
4087   __pyx_t_8 = 0;
4088   __pyx_t_9 = 0;
4089   __pyx_t_10 = 0;
4090   __pyx_v_state = ((PyObject*)__pyx_t_11);
4091   __pyx_t_11 = 0;
4092 
4093   /* "(tree fragment)":6
4094  *     cdef bint use_setstate
4095  *     state = (self._b, self._bounds, self._l, self._m, self._n, self._p, self._s, self._transform, self._xi, self._y)
4096  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
4097  *     if _dict is not None:
4098  *         state += (_dict,)
4099  */
4100   __pyx_t_11 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 6, __pyx_L1_error)
4101   __Pyx_GOTREF(__pyx_t_11);
4102   __pyx_v__dict = __pyx_t_11;
4103   __pyx_t_11 = 0;
4104 
4105   /* "(tree fragment)":7
4106  *     state = (self._b, self._bounds, self._l, self._m, self._n, self._p, self._s, self._transform, self._xi, self._y)
4107  *     _dict = getattr(self, '__dict__', None)
4108  *     if _dict is not None:             # <<<<<<<<<<<<<<
4109  *         state += (_dict,)
4110  *         use_setstate = True
4111  */
4112   __pyx_t_12 = (__pyx_v__dict != Py_None);
4113   __pyx_t_13 = (__pyx_t_12 != 0);
4114   if (__pyx_t_13) {
4115 
4116     /* "(tree fragment)":8
4117  *     _dict = getattr(self, '__dict__', None)
4118  *     if _dict is not None:
4119  *         state += (_dict,)             # <<<<<<<<<<<<<<
4120  *         use_setstate = True
4121  *     else:
4122  */
4123     __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 8, __pyx_L1_error)
4124     __Pyx_GOTREF(__pyx_t_11);
4125     __Pyx_INCREF(__pyx_v__dict);
4126     __Pyx_GIVEREF(__pyx_v__dict);
4127     PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v__dict);
4128     __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 8, __pyx_L1_error)
4129     __Pyx_GOTREF(__pyx_t_10);
4130     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4131     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_10));
4132     __pyx_t_10 = 0;
4133 
4134     /* "(tree fragment)":9
4135  *     if _dict is not None:
4136  *         state += (_dict,)
4137  *         use_setstate = True             # <<<<<<<<<<<<<<
4138  *     else:
4139  *         use_setstate = False
4140  */
4141     __pyx_v_use_setstate = 1;
4142 
4143     /* "(tree fragment)":7
4144  *     state = (self._b, self._bounds, self._l, self._m, self._n, self._p, self._s, self._transform, self._xi, self._y)
4145  *     _dict = getattr(self, '__dict__', None)
4146  *     if _dict is not None:             # <<<<<<<<<<<<<<
4147  *         state += (_dict,)
4148  *         use_setstate = True
4149  */
4150     goto __pyx_L3;
4151   }
4152 
4153   /* "(tree fragment)":11
4154  *         use_setstate = True
4155  *     else:
4156  *         use_setstate = False             # <<<<<<<<<<<<<<
4157  *     if use_setstate:
4158  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, None), state
4159  */
4160   /*else*/ {
4161     __pyx_v_use_setstate = 0;
4162   }
4163   __pyx_L3:;
4164 
4165   /* "(tree fragment)":12
4166  *     else:
4167  *         use_setstate = False
4168  *     if use_setstate:             # <<<<<<<<<<<<<<
4169  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, None), state
4170  *     else:
4171  */
4172   __pyx_t_13 = (__pyx_v_use_setstate != 0);
4173   if (__pyx_t_13) {
4174 
4175     /* "(tree fragment)":13
4176  *         use_setstate = False
4177  *     if use_setstate:
4178  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, None), state             # <<<<<<<<<<<<<<
4179  *     else:
4180  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, state)
4181  */
4182     __Pyx_XDECREF(__pyx_r);
4183     __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_pyx_unpickle_HoltWintersArgs); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error)
4184     __Pyx_GOTREF(__pyx_t_10);
4185     __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error)
4186     __Pyx_GOTREF(__pyx_t_11);
4187     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4188     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4189     PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4190     __Pyx_INCREF(__pyx_int_194727133);
4191     __Pyx_GIVEREF(__pyx_int_194727133);
4192     PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_194727133);
4193     __Pyx_INCREF(Py_None);
4194     __Pyx_GIVEREF(Py_None);
4195     PyTuple_SET_ITEM(__pyx_t_11, 2, Py_None);
4196     __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error)
4197     __Pyx_GOTREF(__pyx_t_9);
4198     __Pyx_GIVEREF(__pyx_t_10);
4199     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
4200     __Pyx_GIVEREF(__pyx_t_11);
4201     PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11);
4202     __Pyx_INCREF(__pyx_v_state);
4203     __Pyx_GIVEREF(__pyx_v_state);
4204     PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_state);
4205     __pyx_t_10 = 0;
4206     __pyx_t_11 = 0;
4207     __pyx_r = __pyx_t_9;
4208     __pyx_t_9 = 0;
4209     goto __pyx_L0;
4210 
4211     /* "(tree fragment)":12
4212  *     else:
4213  *         use_setstate = False
4214  *     if use_setstate:             # <<<<<<<<<<<<<<
4215  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, None), state
4216  *     else:
4217  */
4218   }
4219 
4220   /* "(tree fragment)":15
4221  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, None), state
4222  *     else:
4223  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, state)             # <<<<<<<<<<<<<<
4224  * def __setstate_cython__(self, __pyx_state):
4225  *     __pyx_unpickle_HoltWintersArgs__set_state(self, __pyx_state)
4226  */
4227   /*else*/ {
4228     __Pyx_XDECREF(__pyx_r);
4229     __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pyx_unpickle_HoltWintersArgs); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 15, __pyx_L1_error)
4230     __Pyx_GOTREF(__pyx_t_9);
4231     __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 15, __pyx_L1_error)
4232     __Pyx_GOTREF(__pyx_t_11);
4233     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4234     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4235     PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4236     __Pyx_INCREF(__pyx_int_194727133);
4237     __Pyx_GIVEREF(__pyx_int_194727133);
4238     PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_194727133);
4239     __Pyx_INCREF(__pyx_v_state);
4240     __Pyx_GIVEREF(__pyx_v_state);
4241     PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_state);
4242     __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 15, __pyx_L1_error)
4243     __Pyx_GOTREF(__pyx_t_10);
4244     __Pyx_GIVEREF(__pyx_t_9);
4245     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
4246     __Pyx_GIVEREF(__pyx_t_11);
4247     PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
4248     __pyx_t_9 = 0;
4249     __pyx_t_11 = 0;
4250     __pyx_r = __pyx_t_10;
4251     __pyx_t_10 = 0;
4252     goto __pyx_L0;
4253   }
4254 
4255   /* "(tree fragment)":1
4256  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4257  *     cdef tuple state
4258  *     cdef object _dict
4259  */
4260 
4261   /* function exit code */
4262   __pyx_L1_error:;
4263   __Pyx_XDECREF(__pyx_t_1);
4264   __Pyx_XDECREF(__pyx_t_2);
4265   __Pyx_XDECREF(__pyx_t_3);
4266   __Pyx_XDECREF(__pyx_t_4);
4267   __Pyx_XDECREF(__pyx_t_5);
4268   __Pyx_XDECREF(__pyx_t_6);
4269   __Pyx_XDECREF(__pyx_t_7);
4270   __Pyx_XDECREF(__pyx_t_8);
4271   __Pyx_XDECREF(__pyx_t_9);
4272   __Pyx_XDECREF(__pyx_t_10);
4273   __Pyx_XDECREF(__pyx_t_11);
4274   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4275   __pyx_r = NULL;
4276   __pyx_L0:;
4277   __Pyx_XDECREF(__pyx_v_state);
4278   __Pyx_XDECREF(__pyx_v__dict);
4279   __Pyx_XGIVEREF(__pyx_r);
4280   __Pyx_RefNannyFinishContext();
4281   return __pyx_r;
4282 }
4283 
4284 /* "(tree fragment)":16
4285  *     else:
4286  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, state)
4287  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4288  *     __pyx_unpickle_HoltWintersArgs__set_state(self, __pyx_state)
4289  */
4290 
4291 /* Python wrapper */
4292 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)4293 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4294   PyObject *__pyx_r = 0;
4295   __Pyx_RefNannyDeclarations
4296   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4297   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_4__setstate_cython__(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4298 
4299   /* function exit code */
4300   __Pyx_RefNannyFinishContext();
4301   return __pyx_r;
4302 }
4303 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_4__setstate_cython__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_self,PyObject * __pyx_v___pyx_state)4304 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_4__setstate_cython__(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4305   PyObject *__pyx_r = NULL;
4306   __Pyx_RefNannyDeclarations
4307   PyObject *__pyx_t_1 = NULL;
4308   int __pyx_lineno = 0;
4309   const char *__pyx_filename = NULL;
4310   int __pyx_clineno = 0;
4311   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4312 
4313   /* "(tree fragment)":17
4314  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, state)
4315  * def __setstate_cython__(self, __pyx_state):
4316  *     __pyx_unpickle_HoltWintersArgs__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
4317  */
4318   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4319   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers___pyx_unpickle_HoltWintersArgs__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4320   __Pyx_GOTREF(__pyx_t_1);
4321   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4322 
4323   /* "(tree fragment)":16
4324  *     else:
4325  *         return __pyx_unpickle_HoltWintersArgs, (type(self), 0xb9b4cdd, state)
4326  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4327  *     __pyx_unpickle_HoltWintersArgs__set_state(self, __pyx_state)
4328  */
4329 
4330   /* function exit code */
4331   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4332   goto __pyx_L0;
4333   __pyx_L1_error:;
4334   __Pyx_XDECREF(__pyx_t_1);
4335   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4336   __pyx_r = NULL;
4337   __pyx_L0:;
4338   __Pyx_XGIVEREF(__pyx_r);
4339   __Pyx_RefNannyFinishContext();
4340   return __pyx_r;
4341 }
4342 
4343 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":89
4344  *         self._transform = value
4345  *
4346  * cdef to_restricted(double[::1] p, long[::1] sel, double[:, ::1] bounds):             # <<<<<<<<<<<<<<
4347  *     """
4348  *     Transform parameters from the unrestricted [0,1] space
4349  */
4350 
__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_to_restricted(__Pyx_memviewslice __pyx_v_p,__Pyx_memviewslice __pyx_v_sel,__Pyx_memviewslice __pyx_v_bounds)4351 static PyObject *__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_to_restricted(__Pyx_memviewslice __pyx_v_p, __Pyx_memviewslice __pyx_v_sel, __Pyx_memviewslice __pyx_v_bounds) {
4352   double __pyx_v_a;
4353   double __pyx_v_b;
4354   double __pyx_v_g;
4355   double __pyx_v_ub;
4356   double __pyx_v_lb;
4357   PyObject *__pyx_r = NULL;
4358   __Pyx_RefNannyDeclarations
4359   Py_ssize_t __pyx_t_1;
4360   int __pyx_t_2;
4361   Py_ssize_t __pyx_t_3;
4362   double __pyx_t_4;
4363   double __pyx_t_5;
4364   double __pyx_t_6;
4365   PyObject *__pyx_t_7 = NULL;
4366   PyObject *__pyx_t_8 = NULL;
4367   PyObject *__pyx_t_9 = NULL;
4368   PyObject *__pyx_t_10 = NULL;
4369   int __pyx_lineno = 0;
4370   const char *__pyx_filename = NULL;
4371   int __pyx_clineno = 0;
4372   __Pyx_RefNannySetupContext("to_restricted", 0);
4373 
4374   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":108
4375  *     """
4376  *     cdef double a, b, g, ub, lb
4377  *     a = p[0]             # <<<<<<<<<<<<<<
4378  *     b = p[1]
4379  *     g = p[2]
4380  */
4381   __pyx_t_1 = 0;
4382   __pyx_v_a = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_1)) )));
4383 
4384   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":109
4385  *     cdef double a, b, g, ub, lb
4386  *     a = p[0]
4387  *     b = p[1]             # <<<<<<<<<<<<<<
4388  *     g = p[2]
4389  *
4390  */
4391   __pyx_t_1 = 1;
4392   __pyx_v_b = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_1)) )));
4393 
4394   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":110
4395  *     a = p[0]
4396  *     b = p[1]
4397  *     g = p[2]             # <<<<<<<<<<<<<<
4398  *
4399  *     if sel[0]:
4400  */
4401   __pyx_t_1 = 2;
4402   __pyx_v_g = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_1)) )));
4403 
4404   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":112
4405  *     g = p[2]
4406  *
4407  *     if sel[0]:             # <<<<<<<<<<<<<<
4408  *         lb = max(LOWER_BOUND, bounds[0, 0])
4409  *         ub = min(1 - LOWER_BOUND, bounds[0, 1])
4410  */
4411   __pyx_t_1 = 0;
4412   __pyx_t_2 = ((*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_sel.data) + __pyx_t_1)) ))) != 0);
4413   if (__pyx_t_2) {
4414 
4415     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":113
4416  *
4417  *     if sel[0]:
4418  *         lb = max(LOWER_BOUND, bounds[0, 0])             # <<<<<<<<<<<<<<
4419  *         ub = min(1 - LOWER_BOUND, bounds[0, 1])
4420  *         a = lb + a * (ub - lb)
4421  */
4422     __pyx_t_1 = 0;
4423     __pyx_t_3 = 0;
4424     __pyx_t_4 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_bounds.data + __pyx_t_1 * __pyx_v_bounds.strides[0]) )) + __pyx_t_3)) )));
4425     __pyx_t_5 = __pyx_v_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_LOWER_BOUND;
4426     if (((__pyx_t_4 > __pyx_t_5) != 0)) {
4427       __pyx_t_6 = __pyx_t_4;
4428     } else {
4429       __pyx_t_6 = __pyx_t_5;
4430     }
4431     __pyx_v_lb = __pyx_t_6;
4432 
4433     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":114
4434  *     if sel[0]:
4435  *         lb = max(LOWER_BOUND, bounds[0, 0])
4436  *         ub = min(1 - LOWER_BOUND, bounds[0, 1])             # <<<<<<<<<<<<<<
4437  *         a = lb + a * (ub - lb)
4438  *     if sel[1]:
4439  */
4440     __pyx_t_3 = 0;
4441     __pyx_t_1 = 1;
4442     __pyx_t_6 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_bounds.data + __pyx_t_3 * __pyx_v_bounds.strides[0]) )) + __pyx_t_1)) )));
4443     __pyx_t_4 = (1.0 - __pyx_v_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_LOWER_BOUND);
4444     if (((__pyx_t_6 < __pyx_t_4) != 0)) {
4445       __pyx_t_5 = __pyx_t_6;
4446     } else {
4447       __pyx_t_5 = __pyx_t_4;
4448     }
4449     __pyx_v_ub = __pyx_t_5;
4450 
4451     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":115
4452  *         lb = max(LOWER_BOUND, bounds[0, 0])
4453  *         ub = min(1 - LOWER_BOUND, bounds[0, 1])
4454  *         a = lb + a * (ub - lb)             # <<<<<<<<<<<<<<
4455  *     if sel[1]:
4456  *         lb = bounds[1, 0]
4457  */
4458     __pyx_v_a = (__pyx_v_lb + (__pyx_v_a * (__pyx_v_ub - __pyx_v_lb)));
4459 
4460     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":112
4461  *     g = p[2]
4462  *
4463  *     if sel[0]:             # <<<<<<<<<<<<<<
4464  *         lb = max(LOWER_BOUND, bounds[0, 0])
4465  *         ub = min(1 - LOWER_BOUND, bounds[0, 1])
4466  */
4467   }
4468 
4469   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":116
4470  *         ub = min(1 - LOWER_BOUND, bounds[0, 1])
4471  *         a = lb + a * (ub - lb)
4472  *     if sel[1]:             # <<<<<<<<<<<<<<
4473  *         lb = bounds[1, 0]
4474  *         ub = min(a, bounds[1, 1])
4475  */
4476   __pyx_t_1 = 1;
4477   __pyx_t_2 = ((*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_sel.data) + __pyx_t_1)) ))) != 0);
4478   if (__pyx_t_2) {
4479 
4480     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":117
4481  *         a = lb + a * (ub - lb)
4482  *     if sel[1]:
4483  *         lb = bounds[1, 0]             # <<<<<<<<<<<<<<
4484  *         ub = min(a, bounds[1, 1])
4485  *         b = lb + b * (ub - lb)
4486  */
4487     __pyx_t_1 = 1;
4488     __pyx_t_3 = 0;
4489     __pyx_v_lb = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_bounds.data + __pyx_t_1 * __pyx_v_bounds.strides[0]) )) + __pyx_t_3)) )));
4490 
4491     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":118
4492  *     if sel[1]:
4493  *         lb = bounds[1, 0]
4494  *         ub = min(a, bounds[1, 1])             # <<<<<<<<<<<<<<
4495  *         b = lb + b * (ub - lb)
4496  *     if sel[2]:
4497  */
4498     __pyx_t_3 = 1;
4499     __pyx_t_1 = 1;
4500     __pyx_t_5 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_bounds.data + __pyx_t_3 * __pyx_v_bounds.strides[0]) )) + __pyx_t_1)) )));
4501     __pyx_t_6 = __pyx_v_a;
4502     if (((__pyx_t_5 < __pyx_t_6) != 0)) {
4503       __pyx_t_4 = __pyx_t_5;
4504     } else {
4505       __pyx_t_4 = __pyx_t_6;
4506     }
4507     __pyx_v_ub = __pyx_t_4;
4508 
4509     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":119
4510  *         lb = bounds[1, 0]
4511  *         ub = min(a, bounds[1, 1])
4512  *         b = lb + b * (ub - lb)             # <<<<<<<<<<<<<<
4513  *     if sel[2]:
4514  *         lb = bounds[2, 0]
4515  */
4516     __pyx_v_b = (__pyx_v_lb + (__pyx_v_b * (__pyx_v_ub - __pyx_v_lb)));
4517 
4518     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":116
4519  *         ub = min(1 - LOWER_BOUND, bounds[0, 1])
4520  *         a = lb + a * (ub - lb)
4521  *     if sel[1]:             # <<<<<<<<<<<<<<
4522  *         lb = bounds[1, 0]
4523  *         ub = min(a, bounds[1, 1])
4524  */
4525   }
4526 
4527   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":120
4528  *         ub = min(a, bounds[1, 1])
4529  *         b = lb + b * (ub - lb)
4530  *     if sel[2]:             # <<<<<<<<<<<<<<
4531  *         lb = bounds[2, 0]
4532  *         ub = min(1. - a, bounds[2, 1])
4533  */
4534   __pyx_t_1 = 2;
4535   __pyx_t_2 = ((*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_sel.data) + __pyx_t_1)) ))) != 0);
4536   if (__pyx_t_2) {
4537 
4538     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":121
4539  *         b = lb + b * (ub - lb)
4540  *     if sel[2]:
4541  *         lb = bounds[2, 0]             # <<<<<<<<<<<<<<
4542  *         ub = min(1. - a, bounds[2, 1])
4543  *         g = lb + g * (ub - lb)
4544  */
4545     __pyx_t_1 = 2;
4546     __pyx_t_3 = 0;
4547     __pyx_v_lb = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_bounds.data + __pyx_t_1 * __pyx_v_bounds.strides[0]) )) + __pyx_t_3)) )));
4548 
4549     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":122
4550  *     if sel[2]:
4551  *         lb = bounds[2, 0]
4552  *         ub = min(1. - a, bounds[2, 1])             # <<<<<<<<<<<<<<
4553  *         g = lb + g * (ub - lb)
4554  *
4555  */
4556     __pyx_t_3 = 2;
4557     __pyx_t_1 = 1;
4558     __pyx_t_4 = (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_bounds.data + __pyx_t_3 * __pyx_v_bounds.strides[0]) )) + __pyx_t_1)) )));
4559     __pyx_t_5 = (1. - __pyx_v_a);
4560     if (((__pyx_t_4 < __pyx_t_5) != 0)) {
4561       __pyx_t_6 = __pyx_t_4;
4562     } else {
4563       __pyx_t_6 = __pyx_t_5;
4564     }
4565     __pyx_v_ub = __pyx_t_6;
4566 
4567     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":123
4568  *         lb = bounds[2, 0]
4569  *         ub = min(1. - a, bounds[2, 1])
4570  *         g = lb + g * (ub - lb)             # <<<<<<<<<<<<<<
4571  *
4572  *     return a, b, g
4573  */
4574     __pyx_v_g = (__pyx_v_lb + (__pyx_v_g * (__pyx_v_ub - __pyx_v_lb)));
4575 
4576     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":120
4577  *         ub = min(a, bounds[1, 1])
4578  *         b = lb + b * (ub - lb)
4579  *     if sel[2]:             # <<<<<<<<<<<<<<
4580  *         lb = bounds[2, 0]
4581  *         ub = min(1. - a, bounds[2, 1])
4582  */
4583   }
4584 
4585   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":125
4586  *         g = lb + g * (ub - lb)
4587  *
4588  *     return a, b, g             # <<<<<<<<<<<<<<
4589  *
4590  * def _test_to_restricted(p, sel, bounds):
4591  */
4592   __Pyx_XDECREF(__pyx_r);
4593   __pyx_t_7 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
4594   __Pyx_GOTREF(__pyx_t_7);
4595   __pyx_t_8 = PyFloat_FromDouble(__pyx_v_b); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error)
4596   __Pyx_GOTREF(__pyx_t_8);
4597   __pyx_t_9 = PyFloat_FromDouble(__pyx_v_g); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error)
4598   __Pyx_GOTREF(__pyx_t_9);
4599   __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 125, __pyx_L1_error)
4600   __Pyx_GOTREF(__pyx_t_10);
4601   __Pyx_GIVEREF(__pyx_t_7);
4602   PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
4603   __Pyx_GIVEREF(__pyx_t_8);
4604   PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
4605   __Pyx_GIVEREF(__pyx_t_9);
4606   PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
4607   __pyx_t_7 = 0;
4608   __pyx_t_8 = 0;
4609   __pyx_t_9 = 0;
4610   __pyx_r = __pyx_t_10;
4611   __pyx_t_10 = 0;
4612   goto __pyx_L0;
4613 
4614   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":89
4615  *         self._transform = value
4616  *
4617  * cdef to_restricted(double[::1] p, long[::1] sel, double[:, ::1] bounds):             # <<<<<<<<<<<<<<
4618  *     """
4619  *     Transform parameters from the unrestricted [0,1] space
4620  */
4621 
4622   /* function exit code */
4623   __pyx_L1_error:;
4624   __Pyx_XDECREF(__pyx_t_7);
4625   __Pyx_XDECREF(__pyx_t_8);
4626   __Pyx_XDECREF(__pyx_t_9);
4627   __Pyx_XDECREF(__pyx_t_10);
4628   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.to_restricted", __pyx_clineno, __pyx_lineno, __pyx_filename);
4629   __pyx_r = 0;
4630   __pyx_L0:;
4631   __Pyx_XGIVEREF(__pyx_r);
4632   __Pyx_RefNannyFinishContext();
4633   return __pyx_r;
4634 }
4635 
4636 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":127
4637  *     return a, b, g
4638  *
4639  * def _test_to_restricted(p, sel, bounds):             # <<<<<<<<<<<<<<
4640  *     """Testing harness"""
4641  *     return to_restricted(p, sel, bounds)
4642  */
4643 
4644 /* Python wrapper */
4645 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_1_test_to_restricted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4646 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers__test_to_restricted[] = "Testing harness";
4647 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_1_test_to_restricted = {"_test_to_restricted", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_1_test_to_restricted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers__test_to_restricted};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_1_test_to_restricted(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4648 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_1_test_to_restricted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4649   PyObject *__pyx_v_p = 0;
4650   PyObject *__pyx_v_sel = 0;
4651   PyObject *__pyx_v_bounds = 0;
4652   int __pyx_lineno = 0;
4653   const char *__pyx_filename = NULL;
4654   int __pyx_clineno = 0;
4655   PyObject *__pyx_r = 0;
4656   __Pyx_RefNannyDeclarations
4657   __Pyx_RefNannySetupContext("_test_to_restricted (wrapper)", 0);
4658   {
4659     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_sel,&__pyx_n_s_bounds,0};
4660     PyObject* values[3] = {0,0,0};
4661     if (unlikely(__pyx_kwds)) {
4662       Py_ssize_t kw_args;
4663       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4664       switch (pos_args) {
4665         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4666         CYTHON_FALLTHROUGH;
4667         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4668         CYTHON_FALLTHROUGH;
4669         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4670         CYTHON_FALLTHROUGH;
4671         case  0: break;
4672         default: goto __pyx_L5_argtuple_error;
4673       }
4674       kw_args = PyDict_Size(__pyx_kwds);
4675       switch (pos_args) {
4676         case  0:
4677         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
4678         else goto __pyx_L5_argtuple_error;
4679         CYTHON_FALLTHROUGH;
4680         case  1:
4681         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sel)) != 0)) kw_args--;
4682         else {
4683           __Pyx_RaiseArgtupleInvalid("_test_to_restricted", 1, 3, 3, 1); __PYX_ERR(0, 127, __pyx_L3_error)
4684         }
4685         CYTHON_FALLTHROUGH;
4686         case  2:
4687         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bounds)) != 0)) kw_args--;
4688         else {
4689           __Pyx_RaiseArgtupleInvalid("_test_to_restricted", 1, 3, 3, 2); __PYX_ERR(0, 127, __pyx_L3_error)
4690         }
4691       }
4692       if (unlikely(kw_args > 0)) {
4693         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_test_to_restricted") < 0)) __PYX_ERR(0, 127, __pyx_L3_error)
4694       }
4695     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4696       goto __pyx_L5_argtuple_error;
4697     } else {
4698       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4699       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4700       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4701     }
4702     __pyx_v_p = values[0];
4703     __pyx_v_sel = values[1];
4704     __pyx_v_bounds = values[2];
4705   }
4706   goto __pyx_L4_argument_unpacking_done;
4707   __pyx_L5_argtuple_error:;
4708   __Pyx_RaiseArgtupleInvalid("_test_to_restricted", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 127, __pyx_L3_error)
4709   __pyx_L3_error:;
4710   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers._test_to_restricted", __pyx_clineno, __pyx_lineno, __pyx_filename);
4711   __Pyx_RefNannyFinishContext();
4712   return NULL;
4713   __pyx_L4_argument_unpacking_done:;
4714   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers__test_to_restricted(__pyx_self, __pyx_v_p, __pyx_v_sel, __pyx_v_bounds);
4715 
4716   /* function exit code */
4717   __Pyx_RefNannyFinishContext();
4718   return __pyx_r;
4719 }
4720 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers__test_to_restricted(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_p,PyObject * __pyx_v_sel,PyObject * __pyx_v_bounds)4721 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers__test_to_restricted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_sel, PyObject *__pyx_v_bounds) {
4722   PyObject *__pyx_r = NULL;
4723   __Pyx_RefNannyDeclarations
4724   __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
4725   __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4726   __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4727   PyObject *__pyx_t_4 = NULL;
4728   int __pyx_lineno = 0;
4729   const char *__pyx_filename = NULL;
4730   int __pyx_clineno = 0;
4731   __Pyx_RefNannySetupContext("_test_to_restricted", 0);
4732 
4733   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":129
4734  * def _test_to_restricted(p, sel, bounds):
4735  *     """Testing harness"""
4736  *     return to_restricted(p, sel, bounds)             # <<<<<<<<<<<<<<
4737  *
4738  *
4739  */
4740   __Pyx_XDECREF(__pyx_r);
4741   __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_p, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 129, __pyx_L1_error)
4742   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_v_sel, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 129, __pyx_L1_error)
4743   __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_bounds, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 129, __pyx_L1_error)
4744   __pyx_t_4 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_to_restricted(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
4745   __Pyx_GOTREF(__pyx_t_4);
4746   __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
4747   __pyx_t_1.memview = NULL;
4748   __pyx_t_1.data = NULL;
4749   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4750   __pyx_t_2.memview = NULL;
4751   __pyx_t_2.data = NULL;
4752   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4753   __pyx_t_3.memview = NULL;
4754   __pyx_t_3.data = NULL;
4755   __pyx_r = __pyx_t_4;
4756   __pyx_t_4 = 0;
4757   goto __pyx_L0;
4758 
4759   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":127
4760  *     return a, b, g
4761  *
4762  * def _test_to_restricted(p, sel, bounds):             # <<<<<<<<<<<<<<
4763  *     """Testing harness"""
4764  *     return to_restricted(p, sel, bounds)
4765  */
4766 
4767   /* function exit code */
4768   __pyx_L1_error:;
4769   __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
4770   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4771   __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4772   __Pyx_XDECREF(__pyx_t_4);
4773   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers._test_to_restricted", __pyx_clineno, __pyx_lineno, __pyx_filename);
4774   __pyx_r = NULL;
4775   __pyx_L0:;
4776   __Pyx_XGIVEREF(__pyx_r);
4777   __Pyx_RefNannyFinishContext();
4778   return __pyx_r;
4779 }
4780 
4781 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":133
4782  *
4783  * # noinspection PyProtectedMember
4784  * cdef object holt_init(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
4785  *     """Initialization for the Holt Models"""
4786  *     cdef double alpha, beta, phi, alphac, betac, l0, b0, _
4787  */
4788 
__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_init(__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)4789 static PyObject *__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_init(__Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
4790   double __pyx_v_alpha;
4791   double __pyx_v_beta;
4792   double __pyx_v_phi;
4793   double __pyx_v_alphac;
4794   double __pyx_v_betac;
4795   double __pyx_v_l0;
4796   double __pyx_v_b0;
4797   CYTHON_UNUSED double __pyx_v__;
4798   Py_ssize_t __pyx_v_i;
4799   Py_ssize_t __pyx_v_n;
4800   Py_ssize_t __pyx_v_idx;
4801   __Pyx_memviewslice __pyx_v_p = { 0, 0, { 0 }, { 0 }, { 0 } };
4802   __Pyx_memviewslice __pyx_v_xi = { 0, 0, { 0 }, { 0 }, { 0 } };
4803   PyObject *__pyx_r = NULL;
4804   __Pyx_RefNannyDeclarations
4805   __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
4806   __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4807   Py_ssize_t __pyx_t_3;
4808   Py_ssize_t __pyx_t_4;
4809   Py_ssize_t __pyx_t_5;
4810   Py_ssize_t __pyx_t_6;
4811   int __pyx_t_7;
4812   Py_ssize_t __pyx_t_8;
4813   PyObject *__pyx_t_9 = NULL;
4814   PyObject *__pyx_t_10 = NULL;
4815   PyObject *__pyx_t_11 = NULL;
4816   PyObject *__pyx_t_12 = NULL;
4817   PyObject *__pyx_t_13 = NULL;
4818   PyObject *(*__pyx_t_14)(PyObject *);
4819   double __pyx_t_15;
4820   double __pyx_t_16;
4821   double __pyx_t_17;
4822   PyObject *__pyx_t_18 = NULL;
4823   int __pyx_lineno = 0;
4824   const char *__pyx_filename = NULL;
4825   int __pyx_clineno = 0;
4826   __Pyx_RefNannySetupContext("holt_init", 0);
4827 
4828   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":136
4829  *     """Initialization for the Holt Models"""
4830  *     cdef double alpha, beta, phi, alphac, betac, l0, b0, _
4831  *     cdef Py_ssize_t i, n, idx = 0             # <<<<<<<<<<<<<<
4832  *     cdef double[::1] p
4833  *     cdef long[::1] xi
4834  */
4835   __pyx_v_idx = 0;
4836 
4837   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":140
4838  *     cdef long[::1] xi
4839  *
4840  *     p = hw_args._p             # <<<<<<<<<<<<<<
4841  *     xi = hw_args._xi
4842  *     n = p.shape[0]
4843  */
4844   if (unlikely(!__pyx_v_hw_args->_p.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 140, __pyx_L1_error)}
4845   __pyx_t_1 = __pyx_v_hw_args->_p;
4846   __PYX_INC_MEMVIEW(&__pyx_t_1, 1);
4847   __pyx_v_p = __pyx_t_1;
4848   __pyx_t_1.memview = NULL;
4849   __pyx_t_1.data = NULL;
4850 
4851   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":141
4852  *
4853  *     p = hw_args._p
4854  *     xi = hw_args._xi             # <<<<<<<<<<<<<<
4855  *     n = p.shape[0]
4856  *     for i in range(n):
4857  */
4858   if (unlikely(!__pyx_v_hw_args->_xi.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 141, __pyx_L1_error)}
4859   __pyx_t_2 = __pyx_v_hw_args->_xi;
4860   __PYX_INC_MEMVIEW(&__pyx_t_2, 1);
4861   __pyx_v_xi = __pyx_t_2;
4862   __pyx_t_2.memview = NULL;
4863   __pyx_t_2.data = NULL;
4864 
4865   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":142
4866  *     p = hw_args._p
4867  *     xi = hw_args._xi
4868  *     n = p.shape[0]             # <<<<<<<<<<<<<<
4869  *     for i in range(n):
4870  *         if xi[i]:
4871  */
4872   __pyx_v_n = (__pyx_v_p.shape[0]);
4873 
4874   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":143
4875  *     xi = hw_args._xi
4876  *     n = p.shape[0]
4877  *     for i in range(n):             # <<<<<<<<<<<<<<
4878  *         if xi[i]:
4879  *             p[i] = x[idx]
4880  */
4881   __pyx_t_3 = __pyx_v_n;
4882   __pyx_t_4 = __pyx_t_3;
4883   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
4884     __pyx_v_i = __pyx_t_5;
4885 
4886     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":144
4887  *     n = p.shape[0]
4888  *     for i in range(n):
4889  *         if xi[i]:             # <<<<<<<<<<<<<<
4890  *             p[i] = x[idx]
4891  *             idx += 1
4892  */
4893     __pyx_t_6 = __pyx_v_i;
4894     __pyx_t_7 = ((*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_xi.data) + __pyx_t_6)) ))) != 0);
4895     if (__pyx_t_7) {
4896 
4897       /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":145
4898  *     for i in range(n):
4899  *         if xi[i]:
4900  *             p[i] = x[idx]             # <<<<<<<<<<<<<<
4901  *             idx += 1
4902  *     if hw_args._transform:
4903  */
4904       __pyx_t_6 = __pyx_v_idx;
4905       __pyx_t_8 = __pyx_v_i;
4906       *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_8)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_6)) )));
4907 
4908       /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":146
4909  *         if xi[i]:
4910  *             p[i] = x[idx]
4911  *             idx += 1             # <<<<<<<<<<<<<<
4912  *     if hw_args._transform:
4913  *         alpha, beta, _ = to_restricted(p, xi, hw_args._bounds)
4914  */
4915       __pyx_v_idx = (__pyx_v_idx + 1);
4916 
4917       /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":144
4918  *     n = p.shape[0]
4919  *     for i in range(n):
4920  *         if xi[i]:             # <<<<<<<<<<<<<<
4921  *             p[i] = x[idx]
4922  *             idx += 1
4923  */
4924     }
4925   }
4926 
4927   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":147
4928  *             p[i] = x[idx]
4929  *             idx += 1
4930  *     if hw_args._transform:             # <<<<<<<<<<<<<<
4931  *         alpha, beta, _ = to_restricted(p, xi, hw_args._bounds)
4932  *     else:
4933  */
4934   __pyx_t_7 = (__pyx_v_hw_args->_transform != 0);
4935   if (__pyx_t_7) {
4936 
4937     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":148
4938  *             idx += 1
4939  *     if hw_args._transform:
4940  *         alpha, beta, _ = to_restricted(p, xi, hw_args._bounds)             # <<<<<<<<<<<<<<
4941  *     else:
4942  *         alpha = p[0]
4943  */
4944     if (unlikely(!__pyx_v_hw_args->_bounds.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 148, __pyx_L1_error)}
4945     __pyx_t_9 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_to_restricted(__pyx_v_p, __pyx_v_xi, __pyx_v_hw_args->_bounds); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error)
4946     __Pyx_GOTREF(__pyx_t_9);
4947     if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
4948       PyObject* sequence = __pyx_t_9;
4949       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4950       if (unlikely(size != 3)) {
4951         if (size > 3) __Pyx_RaiseTooManyValuesError(3);
4952         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4953         __PYX_ERR(0, 148, __pyx_L1_error)
4954       }
4955       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4956       if (likely(PyTuple_CheckExact(sequence))) {
4957         __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
4958         __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
4959         __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2);
4960       } else {
4961         __pyx_t_10 = PyList_GET_ITEM(sequence, 0);
4962         __pyx_t_11 = PyList_GET_ITEM(sequence, 1);
4963         __pyx_t_12 = PyList_GET_ITEM(sequence, 2);
4964       }
4965       __Pyx_INCREF(__pyx_t_10);
4966       __Pyx_INCREF(__pyx_t_11);
4967       __Pyx_INCREF(__pyx_t_12);
4968       #else
4969       __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 148, __pyx_L1_error)
4970       __Pyx_GOTREF(__pyx_t_10);
4971       __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 148, __pyx_L1_error)
4972       __Pyx_GOTREF(__pyx_t_11);
4973       __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 148, __pyx_L1_error)
4974       __Pyx_GOTREF(__pyx_t_12);
4975       #endif
4976       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4977     } else {
4978       Py_ssize_t index = -1;
4979       __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 148, __pyx_L1_error)
4980       __Pyx_GOTREF(__pyx_t_13);
4981       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4982       __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
4983       index = 0; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L7_unpacking_failed;
4984       __Pyx_GOTREF(__pyx_t_10);
4985       index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L7_unpacking_failed;
4986       __Pyx_GOTREF(__pyx_t_11);
4987       index = 2; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L7_unpacking_failed;
4988       __Pyx_GOTREF(__pyx_t_12);
4989       if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
4990       __pyx_t_14 = NULL;
4991       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4992       goto __pyx_L8_unpacking_done;
4993       __pyx_L7_unpacking_failed:;
4994       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4995       __pyx_t_14 = NULL;
4996       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4997       __PYX_ERR(0, 148, __pyx_L1_error)
4998       __pyx_L8_unpacking_done:;
4999     }
5000     __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
5001     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5002     __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
5003     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5004     __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
5005     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5006     __pyx_v_alpha = __pyx_t_15;
5007     __pyx_v_beta = __pyx_t_16;
5008     __pyx_v__ = __pyx_t_17;
5009 
5010     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":147
5011  *             p[i] = x[idx]
5012  *             idx += 1
5013  *     if hw_args._transform:             # <<<<<<<<<<<<<<
5014  *         alpha, beta, _ = to_restricted(p, xi, hw_args._bounds)
5015  *     else:
5016  */
5017     goto __pyx_L6;
5018   }
5019 
5020   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":150
5021  *         alpha, beta, _ = to_restricted(p, xi, hw_args._bounds)
5022  *     else:
5023  *         alpha = p[0]             # <<<<<<<<<<<<<<
5024  *         beta = p[1]
5025  *     l0 = p[3]
5026  */
5027   /*else*/ {
5028     __pyx_t_6 = 0;
5029     __pyx_v_alpha = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
5030 
5031     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":151
5032  *     else:
5033  *         alpha = p[0]
5034  *         beta = p[1]             # <<<<<<<<<<<<<<
5035  *     l0 = p[3]
5036  *     b0 = p[4]
5037  */
5038     __pyx_t_6 = 1;
5039     __pyx_v_beta = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
5040   }
5041   __pyx_L6:;
5042 
5043   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":152
5044  *         alpha = p[0]
5045  *         beta = p[1]
5046  *     l0 = p[3]             # <<<<<<<<<<<<<<
5047  *     b0 = p[4]
5048  *     phi = p[5]
5049  */
5050   __pyx_t_6 = 3;
5051   __pyx_v_l0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
5052 
5053   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":153
5054  *         beta = p[1]
5055  *     l0 = p[3]
5056  *     b0 = p[4]             # <<<<<<<<<<<<<<
5057  *     phi = p[5]
5058  *     alphac = 1 - alpha
5059  */
5060   __pyx_t_6 = 4;
5061   __pyx_v_b0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
5062 
5063   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":154
5064  *     l0 = p[3]
5065  *     b0 = p[4]
5066  *     phi = p[5]             # <<<<<<<<<<<<<<
5067  *     alphac = 1 - alpha
5068  *     betac = 1 - beta
5069  */
5070   __pyx_t_6 = 5;
5071   __pyx_v_phi = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
5072 
5073   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":155
5074  *     b0 = p[4]
5075  *     phi = p[5]
5076  *     alphac = 1 - alpha             # <<<<<<<<<<<<<<
5077  *     betac = 1 - beta
5078  *     hw_args._l[0] = l0
5079  */
5080   __pyx_v_alphac = (1.0 - __pyx_v_alpha);
5081 
5082   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":156
5083  *     phi = p[5]
5084  *     alphac = 1 - alpha
5085  *     betac = 1 - beta             # <<<<<<<<<<<<<<
5086  *     hw_args._l[0] = l0
5087  *     hw_args._b[0] = b0
5088  */
5089   __pyx_v_betac = (1.0 - __pyx_v_beta);
5090 
5091   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":157
5092  *     alphac = 1 - alpha
5093  *     betac = 1 - beta
5094  *     hw_args._l[0] = l0             # <<<<<<<<<<<<<<
5095  *     hw_args._b[0] = b0
5096  *     return alpha, beta, phi, alphac, betac
5097  */
5098   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 157, __pyx_L1_error)}
5099   __pyx_t_6 = 0;
5100   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_hw_args->_l.data) + __pyx_t_6)) )) = __pyx_v_l0;
5101 
5102   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":158
5103  *     betac = 1 - beta
5104  *     hw_args._l[0] = l0
5105  *     hw_args._b[0] = b0             # <<<<<<<<<<<<<<
5106  *     return alpha, beta, phi, alphac, betac
5107  *
5108  */
5109   if (unlikely(!__pyx_v_hw_args->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 158, __pyx_L1_error)}
5110   __pyx_t_6 = 0;
5111   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_hw_args->_b.data) + __pyx_t_6)) )) = __pyx_v_b0;
5112 
5113   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":159
5114  *     hw_args._l[0] = l0
5115  *     hw_args._b[0] = b0
5116  *     return alpha, beta, phi, alphac, betac             # <<<<<<<<<<<<<<
5117  *
5118  *
5119  */
5120   __Pyx_XDECREF(__pyx_r);
5121   __pyx_t_9 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error)
5122   __Pyx_GOTREF(__pyx_t_9);
5123   __pyx_t_12 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error)
5124   __Pyx_GOTREF(__pyx_t_12);
5125   __pyx_t_11 = PyFloat_FromDouble(__pyx_v_phi); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 159, __pyx_L1_error)
5126   __Pyx_GOTREF(__pyx_t_11);
5127   __pyx_t_10 = PyFloat_FromDouble(__pyx_v_alphac); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 159, __pyx_L1_error)
5128   __Pyx_GOTREF(__pyx_t_10);
5129   __pyx_t_13 = PyFloat_FromDouble(__pyx_v_betac); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 159, __pyx_L1_error)
5130   __Pyx_GOTREF(__pyx_t_13);
5131   __pyx_t_18 = PyTuple_New(5); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 159, __pyx_L1_error)
5132   __Pyx_GOTREF(__pyx_t_18);
5133   __Pyx_GIVEREF(__pyx_t_9);
5134   PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_9);
5135   __Pyx_GIVEREF(__pyx_t_12);
5136   PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_12);
5137   __Pyx_GIVEREF(__pyx_t_11);
5138   PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_11);
5139   __Pyx_GIVEREF(__pyx_t_10);
5140   PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_10);
5141   __Pyx_GIVEREF(__pyx_t_13);
5142   PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_13);
5143   __pyx_t_9 = 0;
5144   __pyx_t_12 = 0;
5145   __pyx_t_11 = 0;
5146   __pyx_t_10 = 0;
5147   __pyx_t_13 = 0;
5148   __pyx_r = __pyx_t_18;
5149   __pyx_t_18 = 0;
5150   goto __pyx_L0;
5151 
5152   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":133
5153  *
5154  * # noinspection PyProtectedMember
5155  * cdef object holt_init(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
5156  *     """Initialization for the Holt Models"""
5157  *     cdef double alpha, beta, phi, alphac, betac, l0, b0, _
5158  */
5159 
5160   /* function exit code */
5161   __pyx_L1_error:;
5162   __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5163   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5164   __Pyx_XDECREF(__pyx_t_9);
5165   __Pyx_XDECREF(__pyx_t_10);
5166   __Pyx_XDECREF(__pyx_t_11);
5167   __Pyx_XDECREF(__pyx_t_12);
5168   __Pyx_XDECREF(__pyx_t_13);
5169   __Pyx_XDECREF(__pyx_t_18);
5170   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
5171   __pyx_r = 0;
5172   __pyx_L0:;
5173   __PYX_XDEC_MEMVIEW(&__pyx_v_p, 1);
5174   __PYX_XDEC_MEMVIEW(&__pyx_v_xi, 1);
5175   __Pyx_XGIVEREF(__pyx_r);
5176   __Pyx_RefNannyFinishContext();
5177   return __pyx_r;
5178 }
5179 
5180 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":163
5181  *
5182  * # noinspection PyProtectedMember
5183  * def holt__(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
5184  *     """
5185  *     Compute the sum of squared residuals for Simple Exponential Smoothing
5186  */
5187 
5188 /* Python wrapper */
5189 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_3holt__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5190 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_2holt__[] = "\n    Compute the sum of squared residuals for Simple Exponential Smoothing\n\n    Returns\n    -------\n    ndarray\n        Array containing model errors\n    ";
5191 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_3holt__ = {"holt__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_3holt__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_2holt__};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_3holt__(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5192 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_3holt__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5193   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
5194   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
5195   int __pyx_lineno = 0;
5196   const char *__pyx_filename = NULL;
5197   int __pyx_clineno = 0;
5198   PyObject *__pyx_r = 0;
5199   __Pyx_RefNannyDeclarations
5200   __Pyx_RefNannySetupContext("holt__ (wrapper)", 0);
5201   {
5202     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
5203     PyObject* values[2] = {0,0};
5204     if (unlikely(__pyx_kwds)) {
5205       Py_ssize_t kw_args;
5206       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5207       switch (pos_args) {
5208         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5209         CYTHON_FALLTHROUGH;
5210         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5211         CYTHON_FALLTHROUGH;
5212         case  0: break;
5213         default: goto __pyx_L5_argtuple_error;
5214       }
5215       kw_args = PyDict_Size(__pyx_kwds);
5216       switch (pos_args) {
5217         case  0:
5218         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5219         else goto __pyx_L5_argtuple_error;
5220         CYTHON_FALLTHROUGH;
5221         case  1:
5222         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
5223         else {
5224           __Pyx_RaiseArgtupleInvalid("holt__", 1, 2, 2, 1); __PYX_ERR(0, 163, __pyx_L3_error)
5225         }
5226       }
5227       if (unlikely(kw_args > 0)) {
5228         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt__") < 0)) __PYX_ERR(0, 163, __pyx_L3_error)
5229       }
5230     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5231       goto __pyx_L5_argtuple_error;
5232     } else {
5233       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5234       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5235     }
5236     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 163, __pyx_L3_error)
5237     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
5238   }
5239   goto __pyx_L4_argument_unpacking_done;
5240   __pyx_L5_argtuple_error:;
5241   __Pyx_RaiseArgtupleInvalid("holt__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 163, __pyx_L3_error)
5242   __pyx_L3_error:;
5243   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5244   __Pyx_RefNannyFinishContext();
5245   return NULL;
5246   __pyx_L4_argument_unpacking_done:;
5247   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 163, __pyx_L1_error)
5248   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_2holt__(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
5249 
5250   /* function exit code */
5251   goto __pyx_L0;
5252   __pyx_L1_error:;
5253   __pyx_r = NULL;
5254   __pyx_L0:;
5255   __Pyx_RefNannyFinishContext();
5256   return __pyx_r;
5257 }
5258 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_2holt__(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)5259 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_2holt__(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
5260   double __pyx_v_alpha;
5261   CYTHON_UNUSED double __pyx_v_beta;
5262   CYTHON_UNUSED double __pyx_v_phi;
5263   CYTHON_UNUSED double __pyx_v_betac;
5264   double __pyx_v_alphac;
5265   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
5266   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
5267   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
5268   Py_ssize_t __pyx_v_i;
5269   PyObject *__pyx_r = NULL;
5270   __Pyx_RefNannyDeclarations
5271   __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
5272   PyObject *__pyx_t_2 = NULL;
5273   PyObject *__pyx_t_3 = NULL;
5274   PyObject *__pyx_t_4 = NULL;
5275   PyObject *__pyx_t_5 = NULL;
5276   PyObject *__pyx_t_6 = NULL;
5277   PyObject *__pyx_t_7 = NULL;
5278   PyObject *__pyx_t_8 = NULL;
5279   PyObject *(*__pyx_t_9)(PyObject *);
5280   double __pyx_t_10;
5281   double __pyx_t_11;
5282   double __pyx_t_12;
5283   double __pyx_t_13;
5284   double __pyx_t_14;
5285   Py_ssize_t __pyx_t_15;
5286   Py_ssize_t __pyx_t_16;
5287   Py_ssize_t __pyx_t_17;
5288   Py_ssize_t __pyx_t_18;
5289   Py_ssize_t __pyx_t_19;
5290   Py_ssize_t __pyx_t_20;
5291   int __pyx_lineno = 0;
5292   const char *__pyx_filename = NULL;
5293   int __pyx_clineno = 0;
5294   __Pyx_RefNannySetupContext("holt__", 0);
5295 
5296   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":176
5297  *     cdef Py_ssize_t i
5298  *
5299  *     l = hw_args._l             # <<<<<<<<<<<<<<
5300  *     y = hw_args._y
5301  *     err = np.empty(hw_args._n)
5302  */
5303   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 176, __pyx_L1_error)}
5304   __pyx_t_1 = __pyx_v_hw_args->_l;
5305   __PYX_INC_MEMVIEW(&__pyx_t_1, 1);
5306   __pyx_v_l = __pyx_t_1;
5307   __pyx_t_1.memview = NULL;
5308   __pyx_t_1.data = NULL;
5309 
5310   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":177
5311  *
5312  *     l = hw_args._l
5313  *     y = hw_args._y             # <<<<<<<<<<<<<<
5314  *     err = np.empty(hw_args._n)
5315  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)
5316  */
5317   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 177, __pyx_L1_error)}
5318   __pyx_t_1 = __pyx_v_hw_args->_y;
5319   __PYX_INC_MEMVIEW(&__pyx_t_1, 1);
5320   __pyx_v_y = __pyx_t_1;
5321   __pyx_t_1.memview = NULL;
5322   __pyx_t_1.data = NULL;
5323 
5324   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":178
5325  *     l = hw_args._l
5326  *     y = hw_args._y
5327  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
5328  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)
5329  *
5330  */
5331   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
5332   __Pyx_GOTREF(__pyx_t_3);
5333   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
5334   __Pyx_GOTREF(__pyx_t_4);
5335   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5336   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
5337   __Pyx_GOTREF(__pyx_t_3);
5338   __pyx_t_5 = NULL;
5339   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5340     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5341     if (likely(__pyx_t_5)) {
5342       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5343       __Pyx_INCREF(__pyx_t_5);
5344       __Pyx_INCREF(function);
5345       __Pyx_DECREF_SET(__pyx_t_4, function);
5346     }
5347   }
5348   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
5349   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5350   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5351   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
5352   __Pyx_GOTREF(__pyx_t_2);
5353   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5354   __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 178, __pyx_L1_error)
5355   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5356   __pyx_v_err = __pyx_t_1;
5357   __pyx_t_1.memview = NULL;
5358   __pyx_t_1.data = NULL;
5359 
5360   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":179
5361  *     y = hw_args._y
5362  *     err = np.empty(hw_args._n)
5363  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)             # <<<<<<<<<<<<<<
5364  *
5365  *     err[0] = y[0] - l[0]
5366  */
5367   __pyx_t_2 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
5368   __Pyx_GOTREF(__pyx_t_2);
5369   if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
5370     PyObject* sequence = __pyx_t_2;
5371     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5372     if (unlikely(size != 5)) {
5373       if (size > 5) __Pyx_RaiseTooManyValuesError(5);
5374       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5375       __PYX_ERR(0, 179, __pyx_L1_error)
5376     }
5377     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5378     if (likely(PyTuple_CheckExact(sequence))) {
5379       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
5380       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
5381       __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
5382       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
5383       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
5384     } else {
5385       __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
5386       __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
5387       __pyx_t_5 = PyList_GET_ITEM(sequence, 2);
5388       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
5389       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
5390     }
5391     __Pyx_INCREF(__pyx_t_4);
5392     __Pyx_INCREF(__pyx_t_3);
5393     __Pyx_INCREF(__pyx_t_5);
5394     __Pyx_INCREF(__pyx_t_6);
5395     __Pyx_INCREF(__pyx_t_7);
5396     #else
5397     {
5398       Py_ssize_t i;
5399       PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7};
5400       for (i=0; i < 5; i++) {
5401         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 179, __pyx_L1_error)
5402         __Pyx_GOTREF(item);
5403         *(temps[i]) = item;
5404       }
5405     }
5406     #endif
5407     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5408   } else {
5409     Py_ssize_t index = -1;
5410     PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_3,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7};
5411     __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 179, __pyx_L1_error)
5412     __Pyx_GOTREF(__pyx_t_8);
5413     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5414     __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
5415     for (index=0; index < 5; index++) {
5416       PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
5417       __Pyx_GOTREF(item);
5418       *(temps[index]) = item;
5419     }
5420     if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 5) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
5421     __pyx_t_9 = NULL;
5422     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5423     goto __pyx_L4_unpacking_done;
5424     __pyx_L3_unpacking_failed:;
5425     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5426     __pyx_t_9 = NULL;
5427     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5428     __PYX_ERR(0, 179, __pyx_L1_error)
5429     __pyx_L4_unpacking_done:;
5430   }
5431   __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
5432   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5433   __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
5434   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5435   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
5436   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5437   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
5438   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5439   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
5440   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5441   __pyx_v_alpha = __pyx_t_10;
5442   __pyx_v_beta = __pyx_t_11;
5443   __pyx_v_phi = __pyx_t_12;
5444   __pyx_v_alphac = __pyx_t_13;
5445   __pyx_v_betac = __pyx_t_14;
5446 
5447   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":181
5448  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)
5449  *
5450  *     err[0] = y[0] - l[0]             # <<<<<<<<<<<<<<
5451  *     for i in range(1, hw_args._n):
5452  *         l[i] = (alpha * y[i - 1]) + (alphac * l[i - 1])
5453  */
5454   __pyx_t_15 = 0;
5455   __pyx_t_16 = 0;
5456   __pyx_t_17 = 0;
5457   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_17)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_15)) ))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))));
5458 
5459   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":182
5460  *
5461  *     err[0] = y[0] - l[0]
5462  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
5463  *         l[i] = (alpha * y[i - 1]) + (alphac * l[i - 1])
5464  *         err[i] = y[i] - l[i]
5465  */
5466   __pyx_t_18 = __pyx_v_hw_args->_n;
5467   __pyx_t_19 = __pyx_t_18;
5468   for (__pyx_t_20 = 1; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
5469     __pyx_v_i = __pyx_t_20;
5470 
5471     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":183
5472  *     err[0] = y[0] - l[0]
5473  *     for i in range(1, hw_args._n):
5474  *         l[i] = (alpha * y[i - 1]) + (alphac * l[i - 1])             # <<<<<<<<<<<<<<
5475  *         err[i] = y[i] - l[i]
5476  *     return np.asarray(err)
5477  */
5478     __pyx_t_16 = (__pyx_v_i - 1);
5479     __pyx_t_15 = (__pyx_v_i - 1);
5480     __pyx_t_17 = __pyx_v_i;
5481     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_17)) )) = ((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_16)) )))) + (__pyx_v_alphac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_15)) )))));
5482 
5483     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":184
5484  *     for i in range(1, hw_args._n):
5485  *         l[i] = (alpha * y[i - 1]) + (alphac * l[i - 1])
5486  *         err[i] = y[i] - l[i]             # <<<<<<<<<<<<<<
5487  *     return np.asarray(err)
5488  *
5489  */
5490     __pyx_t_15 = __pyx_v_i;
5491     __pyx_t_16 = __pyx_v_i;
5492     __pyx_t_17 = __pyx_v_i;
5493     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_17)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_15)) ))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))));
5494   }
5495 
5496   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":185
5497  *         l[i] = (alpha * y[i - 1]) + (alphac * l[i - 1])
5498  *         err[i] = y[i] - l[i]
5499  *     return np.asarray(err)             # <<<<<<<<<<<<<<
5500  *
5501  * # noinspection PyProtectedMember
5502  */
5503   __Pyx_XDECREF(__pyx_r);
5504   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error)
5505   __Pyx_GOTREF(__pyx_t_7);
5506   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error)
5507   __Pyx_GOTREF(__pyx_t_6);
5508   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5509   __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error)
5510   __Pyx_GOTREF(__pyx_t_7);
5511   __pyx_t_5 = NULL;
5512   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5513     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
5514     if (likely(__pyx_t_5)) {
5515       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5516       __Pyx_INCREF(__pyx_t_5);
5517       __Pyx_INCREF(function);
5518       __Pyx_DECREF_SET(__pyx_t_6, function);
5519     }
5520   }
5521   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
5522   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5523   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5524   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
5525   __Pyx_GOTREF(__pyx_t_2);
5526   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5527   __pyx_r = __pyx_t_2;
5528   __pyx_t_2 = 0;
5529   goto __pyx_L0;
5530 
5531   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":163
5532  *
5533  * # noinspection PyProtectedMember
5534  * def holt__(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
5535  *     """
5536  *     Compute the sum of squared residuals for Simple Exponential Smoothing
5537  */
5538 
5539   /* function exit code */
5540   __pyx_L1_error:;
5541   __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
5542   __Pyx_XDECREF(__pyx_t_2);
5543   __Pyx_XDECREF(__pyx_t_3);
5544   __Pyx_XDECREF(__pyx_t_4);
5545   __Pyx_XDECREF(__pyx_t_5);
5546   __Pyx_XDECREF(__pyx_t_6);
5547   __Pyx_XDECREF(__pyx_t_7);
5548   __Pyx_XDECREF(__pyx_t_8);
5549   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5550   __pyx_r = NULL;
5551   __pyx_L0:;
5552   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
5553   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
5554   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
5555   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
5556   __Pyx_XGIVEREF(__pyx_r);
5557   __Pyx_RefNannyFinishContext();
5558   return __pyx_r;
5559 }
5560 
5561 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":188
5562  *
5563  * # noinspection PyProtectedMember
5564  * def holt_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
5565  *     """
5566  *     Multiplicative and Multiplicative Damped
5567  */
5568 
5569 /* Python wrapper */
5570 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_5holt_mul_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5571 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_4holt_mul_dam[] = "\n    Multiplicative and Multiplicative Damped\n    Minimization Function\n    (M,) & (Md,)\n    ";
5572 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_5holt_mul_dam = {"holt_mul_dam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_5holt_mul_dam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_4holt_mul_dam};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_5holt_mul_dam(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5573 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_5holt_mul_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5574   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
5575   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
5576   int __pyx_lineno = 0;
5577   const char *__pyx_filename = NULL;
5578   int __pyx_clineno = 0;
5579   PyObject *__pyx_r = 0;
5580   __Pyx_RefNannyDeclarations
5581   __Pyx_RefNannySetupContext("holt_mul_dam (wrapper)", 0);
5582   {
5583     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
5584     PyObject* values[2] = {0,0};
5585     if (unlikely(__pyx_kwds)) {
5586       Py_ssize_t kw_args;
5587       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5588       switch (pos_args) {
5589         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5590         CYTHON_FALLTHROUGH;
5591         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5592         CYTHON_FALLTHROUGH;
5593         case  0: break;
5594         default: goto __pyx_L5_argtuple_error;
5595       }
5596       kw_args = PyDict_Size(__pyx_kwds);
5597       switch (pos_args) {
5598         case  0:
5599         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5600         else goto __pyx_L5_argtuple_error;
5601         CYTHON_FALLTHROUGH;
5602         case  1:
5603         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
5604         else {
5605           __Pyx_RaiseArgtupleInvalid("holt_mul_dam", 1, 2, 2, 1); __PYX_ERR(0, 188, __pyx_L3_error)
5606         }
5607       }
5608       if (unlikely(kw_args > 0)) {
5609         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt_mul_dam") < 0)) __PYX_ERR(0, 188, __pyx_L3_error)
5610       }
5611     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5612       goto __pyx_L5_argtuple_error;
5613     } else {
5614       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5615       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5616     }
5617     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 188, __pyx_L3_error)
5618     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
5619   }
5620   goto __pyx_L4_argument_unpacking_done;
5621   __pyx_L5_argtuple_error:;
5622   __Pyx_RaiseArgtupleInvalid("holt_mul_dam", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 188, __pyx_L3_error)
5623   __pyx_L3_error:;
5624   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_mul_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
5625   __Pyx_RefNannyFinishContext();
5626   return NULL;
5627   __pyx_L4_argument_unpacking_done:;
5628   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 188, __pyx_L1_error)
5629   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_4holt_mul_dam(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
5630 
5631   /* function exit code */
5632   goto __pyx_L0;
5633   __pyx_L1_error:;
5634   __pyx_r = NULL;
5635   __pyx_L0:;
5636   __Pyx_RefNannyFinishContext();
5637   return __pyx_r;
5638 }
5639 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_4holt_mul_dam(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)5640 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_4holt_mul_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
5641   double __pyx_v_alpha;
5642   double __pyx_v_beta;
5643   double __pyx_v_phi;
5644   double __pyx_v_betac;
5645   double __pyx_v_alphac;
5646   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
5647   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
5648   __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
5649   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
5650   Py_ssize_t __pyx_v_i;
5651   PyObject *__pyx_r = NULL;
5652   __Pyx_RefNannyDeclarations
5653   PyObject *__pyx_t_1 = NULL;
5654   PyObject *__pyx_t_2 = NULL;
5655   PyObject *__pyx_t_3 = NULL;
5656   PyObject *__pyx_t_4 = NULL;
5657   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5658   PyObject *__pyx_t_6 = NULL;
5659   PyObject *__pyx_t_7 = NULL;
5660   PyObject *__pyx_t_8 = NULL;
5661   PyObject *(*__pyx_t_9)(PyObject *);
5662   double __pyx_t_10;
5663   double __pyx_t_11;
5664   double __pyx_t_12;
5665   double __pyx_t_13;
5666   double __pyx_t_14;
5667   Py_ssize_t __pyx_t_15;
5668   Py_ssize_t __pyx_t_16;
5669   Py_ssize_t __pyx_t_17;
5670   Py_ssize_t __pyx_t_18;
5671   Py_ssize_t __pyx_t_19;
5672   Py_ssize_t __pyx_t_20;
5673   Py_ssize_t __pyx_t_21;
5674   int __pyx_lineno = 0;
5675   const char *__pyx_filename = NULL;
5676   int __pyx_clineno = 0;
5677   __Pyx_RefNannySetupContext("holt_mul_dam", 0);
5678 
5679   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":198
5680  *     cdef Py_ssize_t i
5681  *
5682  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
5683  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)
5684  *     y = hw_args._y
5685  */
5686   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
5687   __Pyx_GOTREF(__pyx_t_2);
5688   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
5689   __Pyx_GOTREF(__pyx_t_3);
5690   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5691   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
5692   __Pyx_GOTREF(__pyx_t_2);
5693   __pyx_t_4 = NULL;
5694   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5695     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
5696     if (likely(__pyx_t_4)) {
5697       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5698       __Pyx_INCREF(__pyx_t_4);
5699       __Pyx_INCREF(function);
5700       __Pyx_DECREF_SET(__pyx_t_3, function);
5701     }
5702   }
5703   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
5704   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5705   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5706   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
5707   __Pyx_GOTREF(__pyx_t_1);
5708   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5709   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 198, __pyx_L1_error)
5710   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5711   __pyx_v_err = __pyx_t_5;
5712   __pyx_t_5.memview = NULL;
5713   __pyx_t_5.data = NULL;
5714 
5715   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":199
5716  *
5717  *     err = np.empty(hw_args._n)
5718  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)             # <<<<<<<<<<<<<<
5719  *     y = hw_args._y
5720  *     l = hw_args._l
5721  */
5722   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
5723   __Pyx_GOTREF(__pyx_t_1);
5724   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
5725     PyObject* sequence = __pyx_t_1;
5726     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5727     if (unlikely(size != 5)) {
5728       if (size > 5) __Pyx_RaiseTooManyValuesError(5);
5729       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5730       __PYX_ERR(0, 199, __pyx_L1_error)
5731     }
5732     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5733     if (likely(PyTuple_CheckExact(sequence))) {
5734       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
5735       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
5736       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
5737       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
5738       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
5739     } else {
5740       __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
5741       __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
5742       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
5743       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
5744       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
5745     }
5746     __Pyx_INCREF(__pyx_t_3);
5747     __Pyx_INCREF(__pyx_t_2);
5748     __Pyx_INCREF(__pyx_t_4);
5749     __Pyx_INCREF(__pyx_t_6);
5750     __Pyx_INCREF(__pyx_t_7);
5751     #else
5752     {
5753       Py_ssize_t i;
5754       PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7};
5755       for (i=0; i < 5; i++) {
5756         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 199, __pyx_L1_error)
5757         __Pyx_GOTREF(item);
5758         *(temps[i]) = item;
5759       }
5760     }
5761     #endif
5762     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5763   } else {
5764     Py_ssize_t index = -1;
5765     PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7};
5766     __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L1_error)
5767     __Pyx_GOTREF(__pyx_t_8);
5768     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5769     __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
5770     for (index=0; index < 5; index++) {
5771       PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
5772       __Pyx_GOTREF(item);
5773       *(temps[index]) = item;
5774     }
5775     if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 5) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
5776     __pyx_t_9 = NULL;
5777     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5778     goto __pyx_L4_unpacking_done;
5779     __pyx_L3_unpacking_failed:;
5780     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5781     __pyx_t_9 = NULL;
5782     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5783     __PYX_ERR(0, 199, __pyx_L1_error)
5784     __pyx_L4_unpacking_done:;
5785   }
5786   __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
5787   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5788   __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
5789   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5790   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
5791   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5792   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
5793   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5794   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
5795   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5796   __pyx_v_alpha = __pyx_t_10;
5797   __pyx_v_beta = __pyx_t_11;
5798   __pyx_v_phi = __pyx_t_12;
5799   __pyx_v_alphac = __pyx_t_13;
5800   __pyx_v_betac = __pyx_t_14;
5801 
5802   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":200
5803  *     err = np.empty(hw_args._n)
5804  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)
5805  *     y = hw_args._y             # <<<<<<<<<<<<<<
5806  *     l = hw_args._l
5807  *     b = hw_args._b
5808  */
5809   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 200, __pyx_L1_error)}
5810   __pyx_t_5 = __pyx_v_hw_args->_y;
5811   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
5812   __pyx_v_y = __pyx_t_5;
5813   __pyx_t_5.memview = NULL;
5814   __pyx_t_5.data = NULL;
5815 
5816   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":201
5817  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)
5818  *     y = hw_args._y
5819  *     l = hw_args._l             # <<<<<<<<<<<<<<
5820  *     b = hw_args._b
5821  *     err[0] = y[0] - (l[0] * b[0]**phi)
5822  */
5823   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 201, __pyx_L1_error)}
5824   __pyx_t_5 = __pyx_v_hw_args->_l;
5825   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
5826   __pyx_v_l = __pyx_t_5;
5827   __pyx_t_5.memview = NULL;
5828   __pyx_t_5.data = NULL;
5829 
5830   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":202
5831  *     y = hw_args._y
5832  *     l = hw_args._l
5833  *     b = hw_args._b             # <<<<<<<<<<<<<<
5834  *     err[0] = y[0] - (l[0] * b[0]**phi)
5835  *     for i in range(1, hw_args._n):
5836  */
5837   if (unlikely(!__pyx_v_hw_args->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 202, __pyx_L1_error)}
5838   __pyx_t_5 = __pyx_v_hw_args->_b;
5839   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
5840   __pyx_v_b = __pyx_t_5;
5841   __pyx_t_5.memview = NULL;
5842   __pyx_t_5.data = NULL;
5843 
5844   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":203
5845  *     l = hw_args._l
5846  *     b = hw_args._b
5847  *     err[0] = y[0] - (l[0] * b[0]**phi)             # <<<<<<<<<<<<<<
5848  *     for i in range(1, hw_args._n):
5849  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] * b[i - 1]**phi))
5850  */
5851   __pyx_t_15 = 0;
5852   __pyx_t_16 = 0;
5853   __pyx_t_17 = 0;
5854   __pyx_t_18 = 0;
5855   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_18)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_15)) ))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_17)) ))), __pyx_v_phi)));
5856 
5857   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":204
5858  *     b = hw_args._b
5859  *     err[0] = y[0] - (l[0] * b[0]**phi)
5860  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
5861  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] * b[i - 1]**phi))
5862  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
5863  */
5864   __pyx_t_19 = __pyx_v_hw_args->_n;
5865   __pyx_t_20 = __pyx_t_19;
5866   for (__pyx_t_21 = 1; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
5867     __pyx_v_i = __pyx_t_21;
5868 
5869     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":205
5870  *     err[0] = y[0] - (l[0] * b[0]**phi)
5871  *     for i in range(1, hw_args._n):
5872  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] * b[i - 1]**phi))             # <<<<<<<<<<<<<<
5873  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
5874  *         err[i] = y[i] - (l[i] * b[i]**phi)
5875  */
5876     __pyx_t_17 = (__pyx_v_i - 1);
5877     __pyx_t_16 = (__pyx_v_i - 1);
5878     __pyx_t_15 = (__pyx_v_i - 1);
5879     __pyx_t_18 = __pyx_v_i;
5880     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_18)) )) = ((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_17)) )))) + (__pyx_v_alphac * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_15)) ))), __pyx_v_phi))));
5881 
5882     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":206
5883  *     for i in range(1, hw_args._n):
5884  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] * b[i - 1]**phi))
5885  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)             # <<<<<<<<<<<<<<
5886  *         err[i] = y[i] - (l[i] * b[i]**phi)
5887  *     return np.asarray(err)
5888  */
5889     __pyx_t_15 = __pyx_v_i;
5890     __pyx_t_16 = (__pyx_v_i - 1);
5891     __pyx_t_17 = (__pyx_v_i - 1);
5892     __pyx_t_18 = __pyx_v_i;
5893     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_18)) )) = ((__pyx_v_beta * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_15)) ))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))))) + (__pyx_v_betac * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_17)) ))), __pyx_v_phi)));
5894 
5895     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":207
5896  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] * b[i - 1]**phi))
5897  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
5898  *         err[i] = y[i] - (l[i] * b[i]**phi)             # <<<<<<<<<<<<<<
5899  *     return np.asarray(err)
5900  *
5901  */
5902     __pyx_t_17 = __pyx_v_i;
5903     __pyx_t_16 = __pyx_v_i;
5904     __pyx_t_15 = __pyx_v_i;
5905     __pyx_t_18 = __pyx_v_i;
5906     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_18)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_17)) ))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_15)) ))), __pyx_v_phi)));
5907   }
5908 
5909   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":208
5910  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
5911  *         err[i] = y[i] - (l[i] * b[i]**phi)
5912  *     return np.asarray(err)             # <<<<<<<<<<<<<<
5913  *
5914  * # noinspection PyProtectedMember
5915  */
5916   __Pyx_XDECREF(__pyx_r);
5917   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error)
5918   __Pyx_GOTREF(__pyx_t_7);
5919   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
5920   __Pyx_GOTREF(__pyx_t_6);
5921   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5922   __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error)
5923   __Pyx_GOTREF(__pyx_t_7);
5924   __pyx_t_4 = NULL;
5925   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5926     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
5927     if (likely(__pyx_t_4)) {
5928       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5929       __Pyx_INCREF(__pyx_t_4);
5930       __Pyx_INCREF(function);
5931       __Pyx_DECREF_SET(__pyx_t_6, function);
5932     }
5933   }
5934   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
5935   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5936   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5937   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
5938   __Pyx_GOTREF(__pyx_t_1);
5939   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5940   __pyx_r = __pyx_t_1;
5941   __pyx_t_1 = 0;
5942   goto __pyx_L0;
5943 
5944   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":188
5945  *
5946  * # noinspection PyProtectedMember
5947  * def holt_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
5948  *     """
5949  *     Multiplicative and Multiplicative Damped
5950  */
5951 
5952   /* function exit code */
5953   __pyx_L1_error:;
5954   __Pyx_XDECREF(__pyx_t_1);
5955   __Pyx_XDECREF(__pyx_t_2);
5956   __Pyx_XDECREF(__pyx_t_3);
5957   __Pyx_XDECREF(__pyx_t_4);
5958   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5959   __Pyx_XDECREF(__pyx_t_6);
5960   __Pyx_XDECREF(__pyx_t_7);
5961   __Pyx_XDECREF(__pyx_t_8);
5962   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_mul_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
5963   __pyx_r = NULL;
5964   __pyx_L0:;
5965   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
5966   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
5967   __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
5968   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
5969   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
5970   __Pyx_XGIVEREF(__pyx_r);
5971   __Pyx_RefNannyFinishContext();
5972   return __pyx_r;
5973 }
5974 
5975 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":211
5976  *
5977  * # noinspection PyProtectedMember
5978  * def holt_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
5979  *     """
5980  *     Additive and Additive Damped
5981  */
5982 
5983 /* Python wrapper */
5984 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_7holt_add_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5985 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_6holt_add_dam[] = "\n    Additive and Additive Damped\n    Minimization Function\n    (A,) & (Ad,)\n    ";
5986 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_7holt_add_dam = {"holt_add_dam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_7holt_add_dam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_6holt_add_dam};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_7holt_add_dam(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5987 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_7holt_add_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5988   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
5989   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
5990   int __pyx_lineno = 0;
5991   const char *__pyx_filename = NULL;
5992   int __pyx_clineno = 0;
5993   PyObject *__pyx_r = 0;
5994   __Pyx_RefNannyDeclarations
5995   __Pyx_RefNannySetupContext("holt_add_dam (wrapper)", 0);
5996   {
5997     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
5998     PyObject* values[2] = {0,0};
5999     if (unlikely(__pyx_kwds)) {
6000       Py_ssize_t kw_args;
6001       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6002       switch (pos_args) {
6003         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6004         CYTHON_FALLTHROUGH;
6005         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6006         CYTHON_FALLTHROUGH;
6007         case  0: break;
6008         default: goto __pyx_L5_argtuple_error;
6009       }
6010       kw_args = PyDict_Size(__pyx_kwds);
6011       switch (pos_args) {
6012         case  0:
6013         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6014         else goto __pyx_L5_argtuple_error;
6015         CYTHON_FALLTHROUGH;
6016         case  1:
6017         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
6018         else {
6019           __Pyx_RaiseArgtupleInvalid("holt_add_dam", 1, 2, 2, 1); __PYX_ERR(0, 211, __pyx_L3_error)
6020         }
6021       }
6022       if (unlikely(kw_args > 0)) {
6023         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt_add_dam") < 0)) __PYX_ERR(0, 211, __pyx_L3_error)
6024       }
6025     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6026       goto __pyx_L5_argtuple_error;
6027     } else {
6028       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6029       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6030     }
6031     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 211, __pyx_L3_error)
6032     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
6033   }
6034   goto __pyx_L4_argument_unpacking_done;
6035   __pyx_L5_argtuple_error:;
6036   __Pyx_RaiseArgtupleInvalid("holt_add_dam", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 211, __pyx_L3_error)
6037   __pyx_L3_error:;
6038   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_add_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
6039   __Pyx_RefNannyFinishContext();
6040   return NULL;
6041   __pyx_L4_argument_unpacking_done:;
6042   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 211, __pyx_L1_error)
6043   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_6holt_add_dam(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
6044 
6045   /* function exit code */
6046   goto __pyx_L0;
6047   __pyx_L1_error:;
6048   __pyx_r = NULL;
6049   __pyx_L0:;
6050   __Pyx_RefNannyFinishContext();
6051   return __pyx_r;
6052 }
6053 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_6holt_add_dam(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)6054 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_6holt_add_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
6055   double __pyx_v_alpha;
6056   double __pyx_v_beta;
6057   double __pyx_v_phi;
6058   double __pyx_v_betac;
6059   double __pyx_v_alphac;
6060   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
6061   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
6062   __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
6063   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
6064   Py_ssize_t __pyx_v_i;
6065   PyObject *__pyx_r = NULL;
6066   __Pyx_RefNannyDeclarations
6067   PyObject *__pyx_t_1 = NULL;
6068   PyObject *__pyx_t_2 = NULL;
6069   PyObject *__pyx_t_3 = NULL;
6070   PyObject *__pyx_t_4 = NULL;
6071   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6072   PyObject *__pyx_t_6 = NULL;
6073   PyObject *__pyx_t_7 = NULL;
6074   PyObject *__pyx_t_8 = NULL;
6075   PyObject *(*__pyx_t_9)(PyObject *);
6076   double __pyx_t_10;
6077   double __pyx_t_11;
6078   double __pyx_t_12;
6079   double __pyx_t_13;
6080   double __pyx_t_14;
6081   Py_ssize_t __pyx_t_15;
6082   Py_ssize_t __pyx_t_16;
6083   Py_ssize_t __pyx_t_17;
6084   Py_ssize_t __pyx_t_18;
6085   Py_ssize_t __pyx_t_19;
6086   Py_ssize_t __pyx_t_20;
6087   Py_ssize_t __pyx_t_21;
6088   int __pyx_lineno = 0;
6089   const char *__pyx_filename = NULL;
6090   int __pyx_clineno = 0;
6091   __Pyx_RefNannySetupContext("holt_add_dam", 0);
6092 
6093   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":221
6094  *     cdef Py_ssize_t i
6095  *
6096  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
6097  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)
6098  *
6099  */
6100   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
6101   __Pyx_GOTREF(__pyx_t_2);
6102   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
6103   __Pyx_GOTREF(__pyx_t_3);
6104   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6105   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
6106   __Pyx_GOTREF(__pyx_t_2);
6107   __pyx_t_4 = NULL;
6108   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6109     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6110     if (likely(__pyx_t_4)) {
6111       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6112       __Pyx_INCREF(__pyx_t_4);
6113       __Pyx_INCREF(function);
6114       __Pyx_DECREF_SET(__pyx_t_3, function);
6115     }
6116   }
6117   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
6118   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6119   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6120   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
6121   __Pyx_GOTREF(__pyx_t_1);
6122   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6123   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 221, __pyx_L1_error)
6124   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6125   __pyx_v_err = __pyx_t_5;
6126   __pyx_t_5.memview = NULL;
6127   __pyx_t_5.data = NULL;
6128 
6129   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":222
6130  *
6131  *     err = np.empty(hw_args._n)
6132  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)             # <<<<<<<<<<<<<<
6133  *
6134  *     y = hw_args._y
6135  */
6136   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
6137   __Pyx_GOTREF(__pyx_t_1);
6138   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
6139     PyObject* sequence = __pyx_t_1;
6140     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6141     if (unlikely(size != 5)) {
6142       if (size > 5) __Pyx_RaiseTooManyValuesError(5);
6143       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6144       __PYX_ERR(0, 222, __pyx_L1_error)
6145     }
6146     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6147     if (likely(PyTuple_CheckExact(sequence))) {
6148       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6149       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
6150       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
6151       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
6152       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
6153     } else {
6154       __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
6155       __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
6156       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
6157       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
6158       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
6159     }
6160     __Pyx_INCREF(__pyx_t_3);
6161     __Pyx_INCREF(__pyx_t_2);
6162     __Pyx_INCREF(__pyx_t_4);
6163     __Pyx_INCREF(__pyx_t_6);
6164     __Pyx_INCREF(__pyx_t_7);
6165     #else
6166     {
6167       Py_ssize_t i;
6168       PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7};
6169       for (i=0; i < 5; i++) {
6170         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 222, __pyx_L1_error)
6171         __Pyx_GOTREF(item);
6172         *(temps[i]) = item;
6173       }
6174     }
6175     #endif
6176     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6177   } else {
6178     Py_ssize_t index = -1;
6179     PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7};
6180     __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error)
6181     __Pyx_GOTREF(__pyx_t_8);
6182     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6183     __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
6184     for (index=0; index < 5; index++) {
6185       PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
6186       __Pyx_GOTREF(item);
6187       *(temps[index]) = item;
6188     }
6189     if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 5) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
6190     __pyx_t_9 = NULL;
6191     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6192     goto __pyx_L4_unpacking_done;
6193     __pyx_L3_unpacking_failed:;
6194     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6195     __pyx_t_9 = NULL;
6196     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6197     __PYX_ERR(0, 222, __pyx_L1_error)
6198     __pyx_L4_unpacking_done:;
6199   }
6200   __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
6201   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6202   __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
6203   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6204   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
6205   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6206   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
6207   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6208   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
6209   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6210   __pyx_v_alpha = __pyx_t_10;
6211   __pyx_v_beta = __pyx_t_11;
6212   __pyx_v_phi = __pyx_t_12;
6213   __pyx_v_alphac = __pyx_t_13;
6214   __pyx_v_betac = __pyx_t_14;
6215 
6216   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":224
6217  *     alpha, beta, phi, alphac, betac = holt_init(x, hw_args)
6218  *
6219  *     y = hw_args._y             # <<<<<<<<<<<<<<
6220  *     l = hw_args._l
6221  *     b = hw_args._b
6222  */
6223   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 224, __pyx_L1_error)}
6224   __pyx_t_5 = __pyx_v_hw_args->_y;
6225   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
6226   __pyx_v_y = __pyx_t_5;
6227   __pyx_t_5.memview = NULL;
6228   __pyx_t_5.data = NULL;
6229 
6230   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":225
6231  *
6232  *     y = hw_args._y
6233  *     l = hw_args._l             # <<<<<<<<<<<<<<
6234  *     b = hw_args._b
6235  *     err[0] = y[0] - (l[0] + phi * b[0])
6236  */
6237   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 225, __pyx_L1_error)}
6238   __pyx_t_5 = __pyx_v_hw_args->_l;
6239   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
6240   __pyx_v_l = __pyx_t_5;
6241   __pyx_t_5.memview = NULL;
6242   __pyx_t_5.data = NULL;
6243 
6244   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":226
6245  *     y = hw_args._y
6246  *     l = hw_args._l
6247  *     b = hw_args._b             # <<<<<<<<<<<<<<
6248  *     err[0] = y[0] - (l[0] + phi * b[0])
6249  *     for i in range(1, hw_args._n):
6250  */
6251   if (unlikely(!__pyx_v_hw_args->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 226, __pyx_L1_error)}
6252   __pyx_t_5 = __pyx_v_hw_args->_b;
6253   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
6254   __pyx_v_b = __pyx_t_5;
6255   __pyx_t_5.memview = NULL;
6256   __pyx_t_5.data = NULL;
6257 
6258   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":227
6259  *     l = hw_args._l
6260  *     b = hw_args._b
6261  *     err[0] = y[0] - (l[0] + phi * b[0])             # <<<<<<<<<<<<<<
6262  *     for i in range(1, hw_args._n):
6263  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] + phi * b[i - 1]))
6264  */
6265   __pyx_t_15 = 0;
6266   __pyx_t_16 = 0;
6267   __pyx_t_17 = 0;
6268   __pyx_t_18 = 0;
6269   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_18)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_15)) ))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_17)) ))))));
6270 
6271   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":228
6272  *     b = hw_args._b
6273  *     err[0] = y[0] - (l[0] + phi * b[0])
6274  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
6275  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] + phi * b[i - 1]))
6276  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
6277  */
6278   __pyx_t_19 = __pyx_v_hw_args->_n;
6279   __pyx_t_20 = __pyx_t_19;
6280   for (__pyx_t_21 = 1; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
6281     __pyx_v_i = __pyx_t_21;
6282 
6283     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":229
6284  *     err[0] = y[0] - (l[0] + phi * b[0])
6285  *     for i in range(1, hw_args._n):
6286  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] + phi * b[i - 1]))             # <<<<<<<<<<<<<<
6287  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
6288  *         err[i] = y[i] - (l[i] + phi * b[i])
6289  */
6290     __pyx_t_17 = (__pyx_v_i - 1);
6291     __pyx_t_16 = (__pyx_v_i - 1);
6292     __pyx_t_15 = (__pyx_v_i - 1);
6293     __pyx_t_18 = __pyx_v_i;
6294     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_18)) )) = ((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_17)) )))) + (__pyx_v_alphac * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_15)) )))))));
6295 
6296     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":230
6297  *     for i in range(1, hw_args._n):
6298  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] + phi * b[i - 1]))
6299  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])             # <<<<<<<<<<<<<<
6300  *         err[i] = y[i] - (l[i] + phi * b[i])
6301  *     return np.asarray(err)
6302  */
6303     __pyx_t_15 = __pyx_v_i;
6304     __pyx_t_16 = (__pyx_v_i - 1);
6305     __pyx_t_17 = (__pyx_v_i - 1);
6306     __pyx_t_18 = __pyx_v_i;
6307     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_18)) )) = ((__pyx_v_beta * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_15)) ))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))))) + ((__pyx_v_betac * __pyx_v_phi) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_17)) )))));
6308 
6309     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":231
6310  *         l[i] = (alpha * y[i - 1]) + (alphac * (l[i - 1] + phi * b[i - 1]))
6311  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
6312  *         err[i] = y[i] - (l[i] + phi * b[i])             # <<<<<<<<<<<<<<
6313  *     return np.asarray(err)
6314  *
6315  */
6316     __pyx_t_17 = __pyx_v_i;
6317     __pyx_t_16 = __pyx_v_i;
6318     __pyx_t_15 = __pyx_v_i;
6319     __pyx_t_18 = __pyx_v_i;
6320     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_18)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_17)) ))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_16)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_15)) ))))));
6321   }
6322 
6323   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":232
6324  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
6325  *         err[i] = y[i] - (l[i] + phi * b[i])
6326  *     return np.asarray(err)             # <<<<<<<<<<<<<<
6327  *
6328  * # noinspection PyProtectedMember
6329  */
6330   __Pyx_XDECREF(__pyx_r);
6331   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error)
6332   __Pyx_GOTREF(__pyx_t_7);
6333   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error)
6334   __Pyx_GOTREF(__pyx_t_6);
6335   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6336   __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error)
6337   __Pyx_GOTREF(__pyx_t_7);
6338   __pyx_t_4 = NULL;
6339   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
6340     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
6341     if (likely(__pyx_t_4)) {
6342       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
6343       __Pyx_INCREF(__pyx_t_4);
6344       __Pyx_INCREF(function);
6345       __Pyx_DECREF_SET(__pyx_t_6, function);
6346     }
6347   }
6348   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
6349   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6350   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6351   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
6352   __Pyx_GOTREF(__pyx_t_1);
6353   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6354   __pyx_r = __pyx_t_1;
6355   __pyx_t_1 = 0;
6356   goto __pyx_L0;
6357 
6358   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":211
6359  *
6360  * # noinspection PyProtectedMember
6361  * def holt_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
6362  *     """
6363  *     Additive and Additive Damped
6364  */
6365 
6366   /* function exit code */
6367   __pyx_L1_error:;
6368   __Pyx_XDECREF(__pyx_t_1);
6369   __Pyx_XDECREF(__pyx_t_2);
6370   __Pyx_XDECREF(__pyx_t_3);
6371   __Pyx_XDECREF(__pyx_t_4);
6372   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6373   __Pyx_XDECREF(__pyx_t_6);
6374   __Pyx_XDECREF(__pyx_t_7);
6375   __Pyx_XDECREF(__pyx_t_8);
6376   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_add_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
6377   __pyx_r = NULL;
6378   __pyx_L0:;
6379   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
6380   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
6381   __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
6382   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
6383   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
6384   __Pyx_XGIVEREF(__pyx_r);
6385   __Pyx_RefNannyFinishContext();
6386   return __pyx_r;
6387 }
6388 
6389 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":235
6390  *
6391  * # noinspection PyProtectedMember
6392  * cdef object holt_win_init(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
6393  *     """Initialization for the Holt Winters Seasonal Models"""
6394  *     cdef double alpha, beta, gamma, phi, alphac, betac, l0, b0
6395  */
6396 
__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)6397 static PyObject *__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
6398   double __pyx_v_alpha;
6399   double __pyx_v_beta;
6400   double __pyx_v_gamma;
6401   double __pyx_v_phi;
6402   double __pyx_v_alphac;
6403   double __pyx_v_betac;
6404   double __pyx_v_l0;
6405   double __pyx_v_b0;
6406   Py_ssize_t __pyx_v_i;
6407   Py_ssize_t __pyx_v_n;
6408   Py_ssize_t __pyx_v_idx;
6409   __Pyx_memviewslice __pyx_v_p = { 0, 0, { 0 }, { 0 }, { 0 } };
6410   __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
6411   __Pyx_memviewslice __pyx_v_xi = { 0, 0, { 0 }, { 0 }, { 0 } };
6412   double __pyx_v_gammac;
6413   PyObject *__pyx_r = NULL;
6414   __Pyx_RefNannyDeclarations
6415   __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
6416   __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6417   Py_ssize_t __pyx_t_3;
6418   Py_ssize_t __pyx_t_4;
6419   Py_ssize_t __pyx_t_5;
6420   Py_ssize_t __pyx_t_6;
6421   int __pyx_t_7;
6422   Py_ssize_t __pyx_t_8;
6423   PyObject *__pyx_t_9 = NULL;
6424   PyObject *__pyx_t_10 = NULL;
6425   PyObject *__pyx_t_11 = NULL;
6426   PyObject *__pyx_t_12 = NULL;
6427   PyObject *__pyx_t_13 = NULL;
6428   PyObject *(*__pyx_t_14)(PyObject *);
6429   double __pyx_t_15;
6430   double __pyx_t_16;
6431   double __pyx_t_17;
6432   PyObject *__pyx_t_18 = NULL;
6433   PyObject *__pyx_t_19 = NULL;
6434   PyObject *__pyx_t_20 = NULL;
6435   int __pyx_lineno = 0;
6436   const char *__pyx_filename = NULL;
6437   int __pyx_clineno = 0;
6438   __Pyx_RefNannySetupContext("holt_win_init", 0);
6439 
6440   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":238
6441  *     """Initialization for the Holt Winters Seasonal Models"""
6442  *     cdef double alpha, beta, gamma, phi, alphac, betac, l0, b0
6443  *     cdef Py_ssize_t i, n, idx = 0             # <<<<<<<<<<<<<<
6444  *     cdef double[::1] p, s
6445  *     cdef long[::1] xi
6446  */
6447   __pyx_v_idx = 0;
6448 
6449   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":242
6450  *     cdef long[::1] xi
6451  *
6452  *     p = hw_args._p             # <<<<<<<<<<<<<<
6453  *     xi = hw_args._xi
6454  *     n = p.shape[0]
6455  */
6456   if (unlikely(!__pyx_v_hw_args->_p.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 242, __pyx_L1_error)}
6457   __pyx_t_1 = __pyx_v_hw_args->_p;
6458   __PYX_INC_MEMVIEW(&__pyx_t_1, 1);
6459   __pyx_v_p = __pyx_t_1;
6460   __pyx_t_1.memview = NULL;
6461   __pyx_t_1.data = NULL;
6462 
6463   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":243
6464  *
6465  *     p = hw_args._p
6466  *     xi = hw_args._xi             # <<<<<<<<<<<<<<
6467  *     n = p.shape[0]
6468  *     for i in range(n):
6469  */
6470   if (unlikely(!__pyx_v_hw_args->_xi.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 243, __pyx_L1_error)}
6471   __pyx_t_2 = __pyx_v_hw_args->_xi;
6472   __PYX_INC_MEMVIEW(&__pyx_t_2, 1);
6473   __pyx_v_xi = __pyx_t_2;
6474   __pyx_t_2.memview = NULL;
6475   __pyx_t_2.data = NULL;
6476 
6477   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":244
6478  *     p = hw_args._p
6479  *     xi = hw_args._xi
6480  *     n = p.shape[0]             # <<<<<<<<<<<<<<
6481  *     for i in range(n):
6482  *         if xi[i]:
6483  */
6484   __pyx_v_n = (__pyx_v_p.shape[0]);
6485 
6486   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":245
6487  *     xi = hw_args._xi
6488  *     n = p.shape[0]
6489  *     for i in range(n):             # <<<<<<<<<<<<<<
6490  *         if xi[i]:
6491  *             p[i] = x[idx]
6492  */
6493   __pyx_t_3 = __pyx_v_n;
6494   __pyx_t_4 = __pyx_t_3;
6495   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
6496     __pyx_v_i = __pyx_t_5;
6497 
6498     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":246
6499  *     n = p.shape[0]
6500  *     for i in range(n):
6501  *         if xi[i]:             # <<<<<<<<<<<<<<
6502  *             p[i] = x[idx]
6503  *             idx += 1
6504  */
6505     __pyx_t_6 = __pyx_v_i;
6506     __pyx_t_7 = ((*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_xi.data) + __pyx_t_6)) ))) != 0);
6507     if (__pyx_t_7) {
6508 
6509       /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":247
6510  *     for i in range(n):
6511  *         if xi[i]:
6512  *             p[i] = x[idx]             # <<<<<<<<<<<<<<
6513  *             idx += 1
6514  *     if hw_args._transform:
6515  */
6516       __pyx_t_6 = __pyx_v_idx;
6517       __pyx_t_8 = __pyx_v_i;
6518       *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_8)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x.data) + __pyx_t_6)) )));
6519 
6520       /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":248
6521  *         if xi[i]:
6522  *             p[i] = x[idx]
6523  *             idx += 1             # <<<<<<<<<<<<<<
6524  *     if hw_args._transform:
6525  *         alpha, beta, gamma = to_restricted(p, xi, hw_args._bounds)
6526  */
6527       __pyx_v_idx = (__pyx_v_idx + 1);
6528 
6529       /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":246
6530  *     n = p.shape[0]
6531  *     for i in range(n):
6532  *         if xi[i]:             # <<<<<<<<<<<<<<
6533  *             p[i] = x[idx]
6534  *             idx += 1
6535  */
6536     }
6537   }
6538 
6539   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":249
6540  *             p[i] = x[idx]
6541  *             idx += 1
6542  *     if hw_args._transform:             # <<<<<<<<<<<<<<
6543  *         alpha, beta, gamma = to_restricted(p, xi, hw_args._bounds)
6544  *     else:
6545  */
6546   __pyx_t_7 = (__pyx_v_hw_args->_transform != 0);
6547   if (__pyx_t_7) {
6548 
6549     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":250
6550  *             idx += 1
6551  *     if hw_args._transform:
6552  *         alpha, beta, gamma = to_restricted(p, xi, hw_args._bounds)             # <<<<<<<<<<<<<<
6553  *     else:
6554  *         alpha = p[0]
6555  */
6556     if (unlikely(!__pyx_v_hw_args->_bounds.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 250, __pyx_L1_error)}
6557     __pyx_t_9 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_to_restricted(__pyx_v_p, __pyx_v_xi, __pyx_v_hw_args->_bounds); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 250, __pyx_L1_error)
6558     __Pyx_GOTREF(__pyx_t_9);
6559     if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
6560       PyObject* sequence = __pyx_t_9;
6561       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6562       if (unlikely(size != 3)) {
6563         if (size > 3) __Pyx_RaiseTooManyValuesError(3);
6564         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6565         __PYX_ERR(0, 250, __pyx_L1_error)
6566       }
6567       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6568       if (likely(PyTuple_CheckExact(sequence))) {
6569         __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
6570         __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
6571         __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2);
6572       } else {
6573         __pyx_t_10 = PyList_GET_ITEM(sequence, 0);
6574         __pyx_t_11 = PyList_GET_ITEM(sequence, 1);
6575         __pyx_t_12 = PyList_GET_ITEM(sequence, 2);
6576       }
6577       __Pyx_INCREF(__pyx_t_10);
6578       __Pyx_INCREF(__pyx_t_11);
6579       __Pyx_INCREF(__pyx_t_12);
6580       #else
6581       __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 250, __pyx_L1_error)
6582       __Pyx_GOTREF(__pyx_t_10);
6583       __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L1_error)
6584       __Pyx_GOTREF(__pyx_t_11);
6585       __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 250, __pyx_L1_error)
6586       __Pyx_GOTREF(__pyx_t_12);
6587       #endif
6588       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6589     } else {
6590       Py_ssize_t index = -1;
6591       __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 250, __pyx_L1_error)
6592       __Pyx_GOTREF(__pyx_t_13);
6593       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6594       __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
6595       index = 0; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L7_unpacking_failed;
6596       __Pyx_GOTREF(__pyx_t_10);
6597       index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L7_unpacking_failed;
6598       __Pyx_GOTREF(__pyx_t_11);
6599       index = 2; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L7_unpacking_failed;
6600       __Pyx_GOTREF(__pyx_t_12);
6601       if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
6602       __pyx_t_14 = NULL;
6603       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6604       goto __pyx_L8_unpacking_done;
6605       __pyx_L7_unpacking_failed:;
6606       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6607       __pyx_t_14 = NULL;
6608       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6609       __PYX_ERR(0, 250, __pyx_L1_error)
6610       __pyx_L8_unpacking_done:;
6611     }
6612     __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error)
6613     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6614     __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error)
6615     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6616     __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error)
6617     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6618     __pyx_v_alpha = __pyx_t_15;
6619     __pyx_v_beta = __pyx_t_16;
6620     __pyx_v_gamma = __pyx_t_17;
6621 
6622     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":249
6623  *             p[i] = x[idx]
6624  *             idx += 1
6625  *     if hw_args._transform:             # <<<<<<<<<<<<<<
6626  *         alpha, beta, gamma = to_restricted(p, xi, hw_args._bounds)
6627  *     else:
6628  */
6629     goto __pyx_L6;
6630   }
6631 
6632   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":252
6633  *         alpha, beta, gamma = to_restricted(p, xi, hw_args._bounds)
6634  *     else:
6635  *         alpha = p[0]             # <<<<<<<<<<<<<<
6636  *         beta = p[1]
6637  *         gamma = p[2]
6638  */
6639   /*else*/ {
6640     __pyx_t_6 = 0;
6641     __pyx_v_alpha = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
6642 
6643     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":253
6644  *     else:
6645  *         alpha = p[0]
6646  *         beta = p[1]             # <<<<<<<<<<<<<<
6647  *         gamma = p[2]
6648  *     l0 = p[3]
6649  */
6650     __pyx_t_6 = 1;
6651     __pyx_v_beta = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
6652 
6653     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":254
6654  *         alpha = p[0]
6655  *         beta = p[1]
6656  *         gamma = p[2]             # <<<<<<<<<<<<<<
6657  *     l0 = p[3]
6658  *     b0 = p[4]
6659  */
6660     __pyx_t_6 = 2;
6661     __pyx_v_gamma = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
6662   }
6663   __pyx_L6:;
6664 
6665   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":255
6666  *         beta = p[1]
6667  *         gamma = p[2]
6668  *     l0 = p[3]             # <<<<<<<<<<<<<<
6669  *     b0 = p[4]
6670  *     phi = p[5]
6671  */
6672   __pyx_t_6 = 3;
6673   __pyx_v_l0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
6674 
6675   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":256
6676  *         gamma = p[2]
6677  *     l0 = p[3]
6678  *     b0 = p[4]             # <<<<<<<<<<<<<<
6679  *     phi = p[5]
6680  *
6681  */
6682   __pyx_t_6 = 4;
6683   __pyx_v_b0 = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
6684 
6685   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":257
6686  *     l0 = p[3]
6687  *     b0 = p[4]
6688  *     phi = p[5]             # <<<<<<<<<<<<<<
6689  *
6690  *     alphac = 1 - alpha
6691  */
6692   __pyx_t_6 = 5;
6693   __pyx_v_phi = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
6694 
6695   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":259
6696  *     phi = p[5]
6697  *
6698  *     alphac = 1 - alpha             # <<<<<<<<<<<<<<
6699  *     betac = 1 - beta
6700  *     gammac = 1 - gamma
6701  */
6702   __pyx_v_alphac = (1.0 - __pyx_v_alpha);
6703 
6704   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":260
6705  *
6706  *     alphac = 1 - alpha
6707  *     betac = 1 - beta             # <<<<<<<<<<<<<<
6708  *     gammac = 1 - gamma
6709  *
6710  */
6711   __pyx_v_betac = (1.0 - __pyx_v_beta);
6712 
6713   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":261
6714  *     alphac = 1 - alpha
6715  *     betac = 1 - beta
6716  *     gammac = 1 - gamma             # <<<<<<<<<<<<<<
6717  *
6718  *     hw_args._l[0] = l0
6719  */
6720   __pyx_v_gammac = (1.0 - __pyx_v_gamma);
6721 
6722   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":263
6723  *     gammac = 1 - gamma
6724  *
6725  *     hw_args._l[0] = l0             # <<<<<<<<<<<<<<
6726  *     hw_args._b[0] = b0
6727  *     s = hw_args._s
6728  */
6729   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 263, __pyx_L1_error)}
6730   __pyx_t_6 = 0;
6731   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_hw_args->_l.data) + __pyx_t_6)) )) = __pyx_v_l0;
6732 
6733   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":264
6734  *
6735  *     hw_args._l[0] = l0
6736  *     hw_args._b[0] = b0             # <<<<<<<<<<<<<<
6737  *     s = hw_args._s
6738  *     for i in range(hw_args._m):
6739  */
6740   if (unlikely(!__pyx_v_hw_args->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 264, __pyx_L1_error)}
6741   __pyx_t_6 = 0;
6742   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_hw_args->_b.data) + __pyx_t_6)) )) = __pyx_v_b0;
6743 
6744   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":265
6745  *     hw_args._l[0] = l0
6746  *     hw_args._b[0] = b0
6747  *     s = hw_args._s             # <<<<<<<<<<<<<<
6748  *     for i in range(hw_args._m):
6749  *         s[i] = p[6+i]
6750  */
6751   if (unlikely(!__pyx_v_hw_args->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 265, __pyx_L1_error)}
6752   __pyx_t_1 = __pyx_v_hw_args->_s;
6753   __PYX_INC_MEMVIEW(&__pyx_t_1, 1);
6754   __pyx_v_s = __pyx_t_1;
6755   __pyx_t_1.memview = NULL;
6756   __pyx_t_1.data = NULL;
6757 
6758   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":266
6759  *     hw_args._b[0] = b0
6760  *     s = hw_args._s
6761  *     for i in range(hw_args._m):             # <<<<<<<<<<<<<<
6762  *         s[i] = p[6+i]
6763  *
6764  */
6765   __pyx_t_3 = __pyx_v_hw_args->_m;
6766   __pyx_t_4 = __pyx_t_3;
6767   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
6768     __pyx_v_i = __pyx_t_5;
6769 
6770     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":267
6771  *     s = hw_args._s
6772  *     for i in range(hw_args._m):
6773  *         s[i] = p[6+i]             # <<<<<<<<<<<<<<
6774  *
6775  *     return alpha, beta, gamma, phi, alphac, betac, gammac
6776  */
6777     __pyx_t_6 = (6 + __pyx_v_i);
6778     __pyx_t_8 = __pyx_v_i;
6779     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_8)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_p.data) + __pyx_t_6)) )));
6780   }
6781 
6782   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":269
6783  *         s[i] = p[6+i]
6784  *
6785  *     return alpha, beta, gamma, phi, alphac, betac, gammac             # <<<<<<<<<<<<<<
6786  *
6787  * # noinspection PyProtectedMember
6788  */
6789   __Pyx_XDECREF(__pyx_r);
6790   __pyx_t_9 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 269, __pyx_L1_error)
6791   __Pyx_GOTREF(__pyx_t_9);
6792   __pyx_t_12 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 269, __pyx_L1_error)
6793   __Pyx_GOTREF(__pyx_t_12);
6794   __pyx_t_11 = PyFloat_FromDouble(__pyx_v_gamma); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 269, __pyx_L1_error)
6795   __Pyx_GOTREF(__pyx_t_11);
6796   __pyx_t_10 = PyFloat_FromDouble(__pyx_v_phi); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 269, __pyx_L1_error)
6797   __Pyx_GOTREF(__pyx_t_10);
6798   __pyx_t_13 = PyFloat_FromDouble(__pyx_v_alphac); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 269, __pyx_L1_error)
6799   __Pyx_GOTREF(__pyx_t_13);
6800   __pyx_t_18 = PyFloat_FromDouble(__pyx_v_betac); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 269, __pyx_L1_error)
6801   __Pyx_GOTREF(__pyx_t_18);
6802   __pyx_t_19 = PyFloat_FromDouble(__pyx_v_gammac); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 269, __pyx_L1_error)
6803   __Pyx_GOTREF(__pyx_t_19);
6804   __pyx_t_20 = PyTuple_New(7); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 269, __pyx_L1_error)
6805   __Pyx_GOTREF(__pyx_t_20);
6806   __Pyx_GIVEREF(__pyx_t_9);
6807   PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_9);
6808   __Pyx_GIVEREF(__pyx_t_12);
6809   PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_12);
6810   __Pyx_GIVEREF(__pyx_t_11);
6811   PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_11);
6812   __Pyx_GIVEREF(__pyx_t_10);
6813   PyTuple_SET_ITEM(__pyx_t_20, 3, __pyx_t_10);
6814   __Pyx_GIVEREF(__pyx_t_13);
6815   PyTuple_SET_ITEM(__pyx_t_20, 4, __pyx_t_13);
6816   __Pyx_GIVEREF(__pyx_t_18);
6817   PyTuple_SET_ITEM(__pyx_t_20, 5, __pyx_t_18);
6818   __Pyx_GIVEREF(__pyx_t_19);
6819   PyTuple_SET_ITEM(__pyx_t_20, 6, __pyx_t_19);
6820   __pyx_t_9 = 0;
6821   __pyx_t_12 = 0;
6822   __pyx_t_11 = 0;
6823   __pyx_t_10 = 0;
6824   __pyx_t_13 = 0;
6825   __pyx_t_18 = 0;
6826   __pyx_t_19 = 0;
6827   __pyx_r = __pyx_t_20;
6828   __pyx_t_20 = 0;
6829   goto __pyx_L0;
6830 
6831   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":235
6832  *
6833  * # noinspection PyProtectedMember
6834  * cdef object holt_win_init(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
6835  *     """Initialization for the Holt Winters Seasonal Models"""
6836  *     cdef double alpha, beta, gamma, phi, alphac, betac, l0, b0
6837  */
6838 
6839   /* function exit code */
6840   __pyx_L1_error:;
6841   __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
6842   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6843   __Pyx_XDECREF(__pyx_t_9);
6844   __Pyx_XDECREF(__pyx_t_10);
6845   __Pyx_XDECREF(__pyx_t_11);
6846   __Pyx_XDECREF(__pyx_t_12);
6847   __Pyx_XDECREF(__pyx_t_13);
6848   __Pyx_XDECREF(__pyx_t_18);
6849   __Pyx_XDECREF(__pyx_t_19);
6850   __Pyx_XDECREF(__pyx_t_20);
6851   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
6852   __pyx_r = 0;
6853   __pyx_L0:;
6854   __PYX_XDEC_MEMVIEW(&__pyx_v_p, 1);
6855   __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
6856   __PYX_XDEC_MEMVIEW(&__pyx_v_xi, 1);
6857   __Pyx_XGIVEREF(__pyx_r);
6858   __Pyx_RefNannyFinishContext();
6859   return __pyx_r;
6860 }
6861 
6862 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":272
6863  *
6864  * # noinspection PyProtectedMember
6865  * def holt_win_add_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
6866  *     """
6867  *     Additive and Additive Damped with Additive Seasonal
6868  */
6869 
6870 /* Python wrapper */
6871 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_9holt_win_add_add_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6872 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_8holt_win_add_add_dam[] = "\n    Additive and Additive Damped with Additive Seasonal\n    Minimization Function\n    (A,A) & (Ad,A)\n    ";
6873 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_9holt_win_add_add_dam = {"holt_win_add_add_dam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_9holt_win_add_add_dam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_8holt_win_add_add_dam};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_9holt_win_add_add_dam(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6874 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_9holt_win_add_add_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6875   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
6876   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
6877   int __pyx_lineno = 0;
6878   const char *__pyx_filename = NULL;
6879   int __pyx_clineno = 0;
6880   PyObject *__pyx_r = 0;
6881   __Pyx_RefNannyDeclarations
6882   __Pyx_RefNannySetupContext("holt_win_add_add_dam (wrapper)", 0);
6883   {
6884     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
6885     PyObject* values[2] = {0,0};
6886     if (unlikely(__pyx_kwds)) {
6887       Py_ssize_t kw_args;
6888       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6889       switch (pos_args) {
6890         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6891         CYTHON_FALLTHROUGH;
6892         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6893         CYTHON_FALLTHROUGH;
6894         case  0: break;
6895         default: goto __pyx_L5_argtuple_error;
6896       }
6897       kw_args = PyDict_Size(__pyx_kwds);
6898       switch (pos_args) {
6899         case  0:
6900         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6901         else goto __pyx_L5_argtuple_error;
6902         CYTHON_FALLTHROUGH;
6903         case  1:
6904         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
6905         else {
6906           __Pyx_RaiseArgtupleInvalid("holt_win_add_add_dam", 1, 2, 2, 1); __PYX_ERR(0, 272, __pyx_L3_error)
6907         }
6908       }
6909       if (unlikely(kw_args > 0)) {
6910         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt_win_add_add_dam") < 0)) __PYX_ERR(0, 272, __pyx_L3_error)
6911       }
6912     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6913       goto __pyx_L5_argtuple_error;
6914     } else {
6915       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6916       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6917     }
6918     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 272, __pyx_L3_error)
6919     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
6920   }
6921   goto __pyx_L4_argument_unpacking_done;
6922   __pyx_L5_argtuple_error:;
6923   __Pyx_RaiseArgtupleInvalid("holt_win_add_add_dam", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 272, __pyx_L3_error)
6924   __pyx_L3_error:;
6925   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_add_add_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
6926   __Pyx_RefNannyFinishContext();
6927   return NULL;
6928   __pyx_L4_argument_unpacking_done:;
6929   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 272, __pyx_L1_error)
6930   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_8holt_win_add_add_dam(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
6931 
6932   /* function exit code */
6933   goto __pyx_L0;
6934   __pyx_L1_error:;
6935   __pyx_r = NULL;
6936   __pyx_L0:;
6937   __Pyx_RefNannyFinishContext();
6938   return __pyx_r;
6939 }
6940 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_8holt_win_add_add_dam(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)6941 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_8holt_win_add_add_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
6942   double __pyx_v_alpha;
6943   double __pyx_v_beta;
6944   double __pyx_v_gamma;
6945   double __pyx_v_phi;
6946   double __pyx_v_alphac;
6947   double __pyx_v_betac;
6948   double __pyx_v_gammac;
6949   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
6950   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
6951   __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
6952   __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
6953   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
6954   Py_ssize_t __pyx_v_i;
6955   Py_ssize_t __pyx_v_m;
6956   PyObject *__pyx_r = NULL;
6957   __Pyx_RefNannyDeclarations
6958   PyObject *__pyx_t_1 = NULL;
6959   PyObject *__pyx_t_2 = NULL;
6960   PyObject *__pyx_t_3 = NULL;
6961   PyObject *__pyx_t_4 = NULL;
6962   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6963   PyObject *__pyx_t_6 = NULL;
6964   PyObject *__pyx_t_7 = NULL;
6965   PyObject *__pyx_t_8 = NULL;
6966   PyObject *__pyx_t_9 = NULL;
6967   PyObject *__pyx_t_10 = NULL;
6968   PyObject *(*__pyx_t_11)(PyObject *);
6969   double __pyx_t_12;
6970   double __pyx_t_13;
6971   double __pyx_t_14;
6972   double __pyx_t_15;
6973   double __pyx_t_16;
6974   double __pyx_t_17;
6975   double __pyx_t_18;
6976   Py_ssize_t __pyx_t_19;
6977   Py_ssize_t __pyx_t_20;
6978   Py_ssize_t __pyx_t_21;
6979   Py_ssize_t __pyx_t_22;
6980   Py_ssize_t __pyx_t_23;
6981   Py_ssize_t __pyx_t_24;
6982   Py_ssize_t __pyx_t_25;
6983   Py_ssize_t __pyx_t_26;
6984   int __pyx_lineno = 0;
6985   const char *__pyx_filename = NULL;
6986   int __pyx_clineno = 0;
6987   __Pyx_RefNannySetupContext("holt_win_add_add_dam", 0);
6988 
6989   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":282
6990  *     cdef Py_ssize_t i, m
6991  *
6992  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
6993  *     alpha, beta, gamma, phi, alphac, betac, gammac = holt_win_init(x, hw_args)
6994  *
6995  */
6996   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
6997   __Pyx_GOTREF(__pyx_t_2);
6998   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
6999   __Pyx_GOTREF(__pyx_t_3);
7000   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7001   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
7002   __Pyx_GOTREF(__pyx_t_2);
7003   __pyx_t_4 = NULL;
7004   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7005     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
7006     if (likely(__pyx_t_4)) {
7007       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7008       __Pyx_INCREF(__pyx_t_4);
7009       __Pyx_INCREF(function);
7010       __Pyx_DECREF_SET(__pyx_t_3, function);
7011     }
7012   }
7013   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
7014   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7015   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7016   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
7017   __Pyx_GOTREF(__pyx_t_1);
7018   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7019   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 282, __pyx_L1_error)
7020   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7021   __pyx_v_err = __pyx_t_5;
7022   __pyx_t_5.memview = NULL;
7023   __pyx_t_5.data = NULL;
7024 
7025   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":283
7026  *
7027  *     err = np.empty(hw_args._n)
7028  *     alpha, beta, gamma, phi, alphac, betac, gammac = holt_win_init(x, hw_args)             # <<<<<<<<<<<<<<
7029  *
7030  *     y = hw_args._y
7031  */
7032   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
7033   __Pyx_GOTREF(__pyx_t_1);
7034   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
7035     PyObject* sequence = __pyx_t_1;
7036     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7037     if (unlikely(size != 7)) {
7038       if (size > 7) __Pyx_RaiseTooManyValuesError(7);
7039       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7040       __PYX_ERR(0, 283, __pyx_L1_error)
7041     }
7042     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7043     if (likely(PyTuple_CheckExact(sequence))) {
7044       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7045       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
7046       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
7047       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
7048       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
7049       __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5);
7050       __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
7051     } else {
7052       __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
7053       __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
7054       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
7055       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
7056       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
7057       __pyx_t_8 = PyList_GET_ITEM(sequence, 5);
7058       __pyx_t_9 = PyList_GET_ITEM(sequence, 6);
7059     }
7060     __Pyx_INCREF(__pyx_t_3);
7061     __Pyx_INCREF(__pyx_t_2);
7062     __Pyx_INCREF(__pyx_t_4);
7063     __Pyx_INCREF(__pyx_t_6);
7064     __Pyx_INCREF(__pyx_t_7);
7065     __Pyx_INCREF(__pyx_t_8);
7066     __Pyx_INCREF(__pyx_t_9);
7067     #else
7068     {
7069       Py_ssize_t i;
7070       PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
7071       for (i=0; i < 7; i++) {
7072         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 283, __pyx_L1_error)
7073         __Pyx_GOTREF(item);
7074         *(temps[i]) = item;
7075       }
7076     }
7077     #endif
7078     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7079   } else {
7080     Py_ssize_t index = -1;
7081     PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
7082     __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 283, __pyx_L1_error)
7083     __Pyx_GOTREF(__pyx_t_10);
7084     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7085     __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
7086     for (index=0; index < 7; index++) {
7087       PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
7088       __Pyx_GOTREF(item);
7089       *(temps[index]) = item;
7090     }
7091     if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 7) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
7092     __pyx_t_11 = NULL;
7093     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7094     goto __pyx_L4_unpacking_done;
7095     __pyx_L3_unpacking_failed:;
7096     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7097     __pyx_t_11 = NULL;
7098     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7099     __PYX_ERR(0, 283, __pyx_L1_error)
7100     __pyx_L4_unpacking_done:;
7101   }
7102   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
7103   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7104   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
7105   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7106   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
7107   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7108   __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
7109   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7110   __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
7111   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7112   __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
7113   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7114   __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L1_error)
7115   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7116   __pyx_v_alpha = __pyx_t_12;
7117   __pyx_v_beta = __pyx_t_13;
7118   __pyx_v_gamma = __pyx_t_14;
7119   __pyx_v_phi = __pyx_t_15;
7120   __pyx_v_alphac = __pyx_t_16;
7121   __pyx_v_betac = __pyx_t_17;
7122   __pyx_v_gammac = __pyx_t_18;
7123 
7124   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":285
7125  *     alpha, beta, gamma, phi, alphac, betac, gammac = holt_win_init(x, hw_args)
7126  *
7127  *     y = hw_args._y             # <<<<<<<<<<<<<<
7128  *     l = hw_args._l
7129  *     b = hw_args._b
7130  */
7131   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 285, __pyx_L1_error)}
7132   __pyx_t_5 = __pyx_v_hw_args->_y;
7133   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
7134   __pyx_v_y = __pyx_t_5;
7135   __pyx_t_5.memview = NULL;
7136   __pyx_t_5.data = NULL;
7137 
7138   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":286
7139  *
7140  *     y = hw_args._y
7141  *     l = hw_args._l             # <<<<<<<<<<<<<<
7142  *     b = hw_args._b
7143  *     s = hw_args._s
7144  */
7145   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 286, __pyx_L1_error)}
7146   __pyx_t_5 = __pyx_v_hw_args->_l;
7147   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
7148   __pyx_v_l = __pyx_t_5;
7149   __pyx_t_5.memview = NULL;
7150   __pyx_t_5.data = NULL;
7151 
7152   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":287
7153  *     y = hw_args._y
7154  *     l = hw_args._l
7155  *     b = hw_args._b             # <<<<<<<<<<<<<<
7156  *     s = hw_args._s
7157  *     m = hw_args._m
7158  */
7159   if (unlikely(!__pyx_v_hw_args->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 287, __pyx_L1_error)}
7160   __pyx_t_5 = __pyx_v_hw_args->_b;
7161   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
7162   __pyx_v_b = __pyx_t_5;
7163   __pyx_t_5.memview = NULL;
7164   __pyx_t_5.data = NULL;
7165 
7166   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":288
7167  *     l = hw_args._l
7168  *     b = hw_args._b
7169  *     s = hw_args._s             # <<<<<<<<<<<<<<
7170  *     m = hw_args._m
7171  *     err[0] = y[0] - (l[0] + phi * b[0] + s[0])
7172  */
7173   if (unlikely(!__pyx_v_hw_args->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 288, __pyx_L1_error)}
7174   __pyx_t_5 = __pyx_v_hw_args->_s;
7175   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
7176   __pyx_v_s = __pyx_t_5;
7177   __pyx_t_5.memview = NULL;
7178   __pyx_t_5.data = NULL;
7179 
7180   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":289
7181  *     b = hw_args._b
7182  *     s = hw_args._s
7183  *     m = hw_args._m             # <<<<<<<<<<<<<<
7184  *     err[0] = y[0] - (l[0] + phi * b[0] + s[0])
7185  *     for i in range(1, hw_args._n):
7186  */
7187   __pyx_t_19 = __pyx_v_hw_args->_m;
7188   __pyx_v_m = __pyx_t_19;
7189 
7190   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":290
7191  *     s = hw_args._s
7192  *     m = hw_args._m
7193  *     err[0] = y[0] - (l[0] + phi * b[0] + s[0])             # <<<<<<<<<<<<<<
7194  *     for i in range(1, hw_args._n):
7195  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \
7196  */
7197   __pyx_t_20 = 0;
7198   __pyx_t_21 = 0;
7199   __pyx_t_22 = 0;
7200   __pyx_t_23 = 0;
7201   __pyx_t_24 = 0;
7202   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_24)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_20)) ))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_22)) ))))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )))));
7203 
7204   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":291
7205  *     m = hw_args._m
7206  *     err[0] = y[0] - (l[0] + phi * b[0] + s[0])
7207  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
7208  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \
7209  *             (alphac * (l[i - 1] + phi * b[i - 1]))
7210  */
7211   __pyx_t_19 = __pyx_v_hw_args->_n;
7212   __pyx_t_25 = __pyx_t_19;
7213   for (__pyx_t_26 = 1; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
7214     __pyx_v_i = __pyx_t_26;
7215 
7216     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":292
7217  *     err[0] = y[0] - (l[0] + phi * b[0] + s[0])
7218  *     for i in range(1, hw_args._n):
7219  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \             # <<<<<<<<<<<<<<
7220  *             (alphac * (l[i - 1] + phi * b[i - 1]))
7221  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
7222  */
7223     __pyx_t_23 = (__pyx_v_i - 1);
7224     __pyx_t_22 = (__pyx_v_i - 1);
7225 
7226     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":293
7227  *     for i in range(1, hw_args._n):
7228  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \
7229  *             (alphac * (l[i - 1] + phi * b[i - 1]))             # <<<<<<<<<<<<<<
7230  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
7231  *         s[i + m - 1] = gamma * y[i - 1] - \
7232  */
7233     __pyx_t_21 = (__pyx_v_i - 1);
7234     __pyx_t_20 = (__pyx_v_i - 1);
7235 
7236     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":292
7237  *     err[0] = y[0] - (l[0] + phi * b[0] + s[0])
7238  *     for i in range(1, hw_args._n):
7239  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \             # <<<<<<<<<<<<<<
7240  *             (alphac * (l[i - 1] + phi * b[i - 1]))
7241  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
7242  */
7243     __pyx_t_24 = __pyx_v_i;
7244     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_24)) )) = (((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_23)) )))) - (__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) ))))) + (__pyx_v_alphac * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_20)) )))))));
7245 
7246     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":294
7247  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \
7248  *             (alphac * (l[i - 1] + phi * b[i - 1]))
7249  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])             # <<<<<<<<<<<<<<
7250  *         s[i + m - 1] = gamma * y[i - 1] - \
7251  *                        (gamma * (l[i - 1] + phi * b[i - 1])) + (gammac * s[i - 1])
7252  */
7253     __pyx_t_20 = __pyx_v_i;
7254     __pyx_t_21 = (__pyx_v_i - 1);
7255     __pyx_t_22 = (__pyx_v_i - 1);
7256     __pyx_t_23 = __pyx_v_i;
7257     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_23)) )) = ((__pyx_v_beta * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) ))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))))) + ((__pyx_v_betac * __pyx_v_phi) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_22)) )))));
7258 
7259     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":295
7260  *             (alphac * (l[i - 1] + phi * b[i - 1]))
7261  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
7262  *         s[i + m - 1] = gamma * y[i - 1] - \             # <<<<<<<<<<<<<<
7263  *                        (gamma * (l[i - 1] + phi * b[i - 1])) + (gammac * s[i - 1])
7264  *         err[i] = y[i] - (l[i] + phi * b[i] + s[i])
7265  */
7266     __pyx_t_22 = (__pyx_v_i - 1);
7267 
7268     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":296
7269  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
7270  *         s[i + m - 1] = gamma * y[i - 1] - \
7271  *                        (gamma * (l[i - 1] + phi * b[i - 1])) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
7272  *         err[i] = y[i] - (l[i] + phi * b[i] + s[i])
7273  *     return np.asarray(err)
7274  */
7275     __pyx_t_21 = (__pyx_v_i - 1);
7276     __pyx_t_20 = (__pyx_v_i - 1);
7277 
7278     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":295
7279  *             (alphac * (l[i - 1] + phi * b[i - 1]))
7280  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
7281  *         s[i + m - 1] = gamma * y[i - 1] - \             # <<<<<<<<<<<<<<
7282  *                        (gamma * (l[i - 1] + phi * b[i - 1])) + (gammac * s[i - 1])
7283  *         err[i] = y[i] - (l[i] + phi * b[i] + s[i])
7284  */
7285     __pyx_t_23 = (__pyx_v_i - 1);
7286 
7287     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":296
7288  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
7289  *         s[i + m - 1] = gamma * y[i - 1] - \
7290  *                        (gamma * (l[i - 1] + phi * b[i - 1])) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
7291  *         err[i] = y[i] - (l[i] + phi * b[i] + s[i])
7292  *     return np.asarray(err)
7293  */
7294     __pyx_t_24 = ((__pyx_v_i + __pyx_v_m) - 1);
7295     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_24)) )) = (((__pyx_v_gamma * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_22)) )))) - (__pyx_v_gamma * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_20)) ))))))) + (__pyx_v_gammac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )))));
7296 
7297     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":297
7298  *         s[i + m - 1] = gamma * y[i - 1] - \
7299  *                        (gamma * (l[i - 1] + phi * b[i - 1])) + (gammac * s[i - 1])
7300  *         err[i] = y[i] - (l[i] + phi * b[i] + s[i])             # <<<<<<<<<<<<<<
7301  *     return np.asarray(err)
7302  *
7303  */
7304     __pyx_t_23 = __pyx_v_i;
7305     __pyx_t_20 = __pyx_v_i;
7306     __pyx_t_21 = __pyx_v_i;
7307     __pyx_t_22 = __pyx_v_i;
7308     __pyx_t_24 = __pyx_v_i;
7309     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_24)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_23)) ))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_21)) ))))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))));
7310   }
7311 
7312   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":298
7313  *                        (gamma * (l[i - 1] + phi * b[i - 1])) + (gammac * s[i - 1])
7314  *         err[i] = y[i] - (l[i] + phi * b[i] + s[i])
7315  *     return np.asarray(err)             # <<<<<<<<<<<<<<
7316  *
7317  * # noinspection PyProtectedMember
7318  */
7319   __Pyx_XDECREF(__pyx_r);
7320   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 298, __pyx_L1_error)
7321   __Pyx_GOTREF(__pyx_t_9);
7322   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 298, __pyx_L1_error)
7323   __Pyx_GOTREF(__pyx_t_8);
7324   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7325   __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 298, __pyx_L1_error)
7326   __Pyx_GOTREF(__pyx_t_9);
7327   __pyx_t_7 = NULL;
7328   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
7329     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
7330     if (likely(__pyx_t_7)) {
7331       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
7332       __Pyx_INCREF(__pyx_t_7);
7333       __Pyx_INCREF(function);
7334       __Pyx_DECREF_SET(__pyx_t_8, function);
7335     }
7336   }
7337   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
7338   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7339   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7340   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
7341   __Pyx_GOTREF(__pyx_t_1);
7342   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7343   __pyx_r = __pyx_t_1;
7344   __pyx_t_1 = 0;
7345   goto __pyx_L0;
7346 
7347   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":272
7348  *
7349  * # noinspection PyProtectedMember
7350  * def holt_win_add_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
7351  *     """
7352  *     Additive and Additive Damped with Additive Seasonal
7353  */
7354 
7355   /* function exit code */
7356   __pyx_L1_error:;
7357   __Pyx_XDECREF(__pyx_t_1);
7358   __Pyx_XDECREF(__pyx_t_2);
7359   __Pyx_XDECREF(__pyx_t_3);
7360   __Pyx_XDECREF(__pyx_t_4);
7361   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
7362   __Pyx_XDECREF(__pyx_t_6);
7363   __Pyx_XDECREF(__pyx_t_7);
7364   __Pyx_XDECREF(__pyx_t_8);
7365   __Pyx_XDECREF(__pyx_t_9);
7366   __Pyx_XDECREF(__pyx_t_10);
7367   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_add_add_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
7368   __pyx_r = NULL;
7369   __pyx_L0:;
7370   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
7371   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
7372   __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
7373   __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
7374   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
7375   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
7376   __Pyx_XGIVEREF(__pyx_r);
7377   __Pyx_RefNannyFinishContext();
7378   return __pyx_r;
7379 }
7380 
7381 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":301
7382  *
7383  * # noinspection PyProtectedMember
7384  * def holt_win__add(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
7385  *     """
7386  *     Additive Seasonal
7387  */
7388 
7389 /* Python wrapper */
7390 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_11holt_win__add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7391 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_10holt_win__add[] = "\n    Additive Seasonal\n    Minimization Function\n    (,A)\n    ";
7392 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_11holt_win__add = {"holt_win__add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_11holt_win__add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_10holt_win__add};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_11holt_win__add(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7393 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_11holt_win__add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7394   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
7395   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
7396   int __pyx_lineno = 0;
7397   const char *__pyx_filename = NULL;
7398   int __pyx_clineno = 0;
7399   PyObject *__pyx_r = 0;
7400   __Pyx_RefNannyDeclarations
7401   __Pyx_RefNannySetupContext("holt_win__add (wrapper)", 0);
7402   {
7403     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
7404     PyObject* values[2] = {0,0};
7405     if (unlikely(__pyx_kwds)) {
7406       Py_ssize_t kw_args;
7407       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7408       switch (pos_args) {
7409         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7410         CYTHON_FALLTHROUGH;
7411         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7412         CYTHON_FALLTHROUGH;
7413         case  0: break;
7414         default: goto __pyx_L5_argtuple_error;
7415       }
7416       kw_args = PyDict_Size(__pyx_kwds);
7417       switch (pos_args) {
7418         case  0:
7419         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7420         else goto __pyx_L5_argtuple_error;
7421         CYTHON_FALLTHROUGH;
7422         case  1:
7423         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
7424         else {
7425           __Pyx_RaiseArgtupleInvalid("holt_win__add", 1, 2, 2, 1); __PYX_ERR(0, 301, __pyx_L3_error)
7426         }
7427       }
7428       if (unlikely(kw_args > 0)) {
7429         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt_win__add") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
7430       }
7431     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
7432       goto __pyx_L5_argtuple_error;
7433     } else {
7434       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7435       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7436     }
7437     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 301, __pyx_L3_error)
7438     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
7439   }
7440   goto __pyx_L4_argument_unpacking_done;
7441   __pyx_L5_argtuple_error:;
7442   __Pyx_RaiseArgtupleInvalid("holt_win__add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error)
7443   __pyx_L3_error:;
7444   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win__add", __pyx_clineno, __pyx_lineno, __pyx_filename);
7445   __Pyx_RefNannyFinishContext();
7446   return NULL;
7447   __pyx_L4_argument_unpacking_done:;
7448   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 301, __pyx_L1_error)
7449   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_10holt_win__add(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
7450 
7451   /* function exit code */
7452   goto __pyx_L0;
7453   __pyx_L1_error:;
7454   __pyx_r = NULL;
7455   __pyx_L0:;
7456   __Pyx_RefNannyFinishContext();
7457   return __pyx_r;
7458 }
7459 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_10holt_win__add(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)7460 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_10holt_win__add(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
7461   double __pyx_v_alpha;
7462   CYTHON_UNUSED double __pyx_v_beta;
7463   double __pyx_v_gamma;
7464   CYTHON_UNUSED double __pyx_v_phi;
7465   double __pyx_v_alphac;
7466   CYTHON_UNUSED double __pyx_v_betac;
7467   double __pyx_v_gammac;
7468   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
7469   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
7470   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
7471   __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
7472   Py_ssize_t __pyx_v_i;
7473   Py_ssize_t __pyx_v_m;
7474   PyObject *__pyx_r = NULL;
7475   __Pyx_RefNannyDeclarations
7476   PyObject *__pyx_t_1 = NULL;
7477   PyObject *__pyx_t_2 = NULL;
7478   PyObject *__pyx_t_3 = NULL;
7479   PyObject *__pyx_t_4 = NULL;
7480   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
7481   PyObject *__pyx_t_6 = NULL;
7482   PyObject *__pyx_t_7 = NULL;
7483   PyObject *__pyx_t_8 = NULL;
7484   PyObject *__pyx_t_9 = NULL;
7485   PyObject *__pyx_t_10 = NULL;
7486   PyObject *(*__pyx_t_11)(PyObject *);
7487   double __pyx_t_12;
7488   double __pyx_t_13;
7489   double __pyx_t_14;
7490   double __pyx_t_15;
7491   double __pyx_t_16;
7492   double __pyx_t_17;
7493   double __pyx_t_18;
7494   Py_ssize_t __pyx_t_19;
7495   Py_ssize_t __pyx_t_20;
7496   Py_ssize_t __pyx_t_21;
7497   Py_ssize_t __pyx_t_22;
7498   Py_ssize_t __pyx_t_23;
7499   Py_ssize_t __pyx_t_24;
7500   Py_ssize_t __pyx_t_25;
7501   int __pyx_lineno = 0;
7502   const char *__pyx_filename = NULL;
7503   int __pyx_clineno = 0;
7504   __Pyx_RefNannySetupContext("holt_win__add", 0);
7505 
7506   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":311
7507  *     cdef Py_ssize_t i, m
7508  *
7509  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
7510  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
7511  *
7512  */
7513   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
7514   __Pyx_GOTREF(__pyx_t_2);
7515   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
7516   __Pyx_GOTREF(__pyx_t_3);
7517   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7518   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
7519   __Pyx_GOTREF(__pyx_t_2);
7520   __pyx_t_4 = NULL;
7521   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7522     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
7523     if (likely(__pyx_t_4)) {
7524       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7525       __Pyx_INCREF(__pyx_t_4);
7526       __Pyx_INCREF(function);
7527       __Pyx_DECREF_SET(__pyx_t_3, function);
7528     }
7529   }
7530   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
7531   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7532   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7533   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
7534   __Pyx_GOTREF(__pyx_t_1);
7535   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7536   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 311, __pyx_L1_error)
7537   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7538   __pyx_v_err = __pyx_t_5;
7539   __pyx_t_5.memview = NULL;
7540   __pyx_t_5.data = NULL;
7541 
7542   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":312
7543  *
7544  *     err = np.empty(hw_args._n)
7545  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)             # <<<<<<<<<<<<<<
7546  *
7547  *     y = hw_args._y
7548  */
7549   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
7550   __Pyx_GOTREF(__pyx_t_1);
7551   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
7552     PyObject* sequence = __pyx_t_1;
7553     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7554     if (unlikely(size != 7)) {
7555       if (size > 7) __Pyx_RaiseTooManyValuesError(7);
7556       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7557       __PYX_ERR(0, 312, __pyx_L1_error)
7558     }
7559     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7560     if (likely(PyTuple_CheckExact(sequence))) {
7561       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7562       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
7563       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
7564       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
7565       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
7566       __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5);
7567       __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
7568     } else {
7569       __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
7570       __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
7571       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
7572       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
7573       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
7574       __pyx_t_8 = PyList_GET_ITEM(sequence, 5);
7575       __pyx_t_9 = PyList_GET_ITEM(sequence, 6);
7576     }
7577     __Pyx_INCREF(__pyx_t_3);
7578     __Pyx_INCREF(__pyx_t_2);
7579     __Pyx_INCREF(__pyx_t_4);
7580     __Pyx_INCREF(__pyx_t_6);
7581     __Pyx_INCREF(__pyx_t_7);
7582     __Pyx_INCREF(__pyx_t_8);
7583     __Pyx_INCREF(__pyx_t_9);
7584     #else
7585     {
7586       Py_ssize_t i;
7587       PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
7588       for (i=0; i < 7; i++) {
7589         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 312, __pyx_L1_error)
7590         __Pyx_GOTREF(item);
7591         *(temps[i]) = item;
7592       }
7593     }
7594     #endif
7595     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7596   } else {
7597     Py_ssize_t index = -1;
7598     PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
7599     __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 312, __pyx_L1_error)
7600     __Pyx_GOTREF(__pyx_t_10);
7601     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7602     __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
7603     for (index=0; index < 7; index++) {
7604       PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
7605       __Pyx_GOTREF(item);
7606       *(temps[index]) = item;
7607     }
7608     if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 7) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
7609     __pyx_t_11 = NULL;
7610     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7611     goto __pyx_L4_unpacking_done;
7612     __pyx_L3_unpacking_failed:;
7613     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7614     __pyx_t_11 = NULL;
7615     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7616     __PYX_ERR(0, 312, __pyx_L1_error)
7617     __pyx_L4_unpacking_done:;
7618   }
7619   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
7620   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7621   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
7622   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7623   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
7624   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7625   __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
7626   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7627   __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
7628   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7629   __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
7630   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7631   __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
7632   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7633   __pyx_v_alpha = __pyx_t_12;
7634   __pyx_v_beta = __pyx_t_13;
7635   __pyx_v_gamma = __pyx_t_14;
7636   __pyx_v_phi = __pyx_t_15;
7637   __pyx_v_alphac = __pyx_t_16;
7638   __pyx_v_betac = __pyx_t_17;
7639   __pyx_v_gammac = __pyx_t_18;
7640 
7641   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":314
7642  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
7643  *
7644  *     y = hw_args._y             # <<<<<<<<<<<<<<
7645  *     l = hw_args._l
7646  *     s = hw_args._s
7647  */
7648   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 314, __pyx_L1_error)}
7649   __pyx_t_5 = __pyx_v_hw_args->_y;
7650   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
7651   __pyx_v_y = __pyx_t_5;
7652   __pyx_t_5.memview = NULL;
7653   __pyx_t_5.data = NULL;
7654 
7655   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":315
7656  *
7657  *     y = hw_args._y
7658  *     l = hw_args._l             # <<<<<<<<<<<<<<
7659  *     s = hw_args._s
7660  *     m = hw_args._m
7661  */
7662   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 315, __pyx_L1_error)}
7663   __pyx_t_5 = __pyx_v_hw_args->_l;
7664   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
7665   __pyx_v_l = __pyx_t_5;
7666   __pyx_t_5.memview = NULL;
7667   __pyx_t_5.data = NULL;
7668 
7669   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":316
7670  *     y = hw_args._y
7671  *     l = hw_args._l
7672  *     s = hw_args._s             # <<<<<<<<<<<<<<
7673  *     m = hw_args._m
7674  *     err[0] = y[0] - (l[0] + s[0])
7675  */
7676   if (unlikely(!__pyx_v_hw_args->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 316, __pyx_L1_error)}
7677   __pyx_t_5 = __pyx_v_hw_args->_s;
7678   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
7679   __pyx_v_s = __pyx_t_5;
7680   __pyx_t_5.memview = NULL;
7681   __pyx_t_5.data = NULL;
7682 
7683   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":317
7684  *     l = hw_args._l
7685  *     s = hw_args._s
7686  *     m = hw_args._m             # <<<<<<<<<<<<<<
7687  *     err[0] = y[0] - (l[0] + s[0])
7688  *     for i in range(1, hw_args._n):
7689  */
7690   __pyx_t_19 = __pyx_v_hw_args->_m;
7691   __pyx_v_m = __pyx_t_19;
7692 
7693   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":318
7694  *     s = hw_args._s
7695  *     m = hw_args._m
7696  *     err[0] = y[0] - (l[0] + s[0])             # <<<<<<<<<<<<<<
7697  *     for i in range(1, hw_args._n):
7698  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + (alphac * (l[i - 1]))
7699  */
7700   __pyx_t_20 = 0;
7701   __pyx_t_21 = 0;
7702   __pyx_t_22 = 0;
7703   __pyx_t_23 = 0;
7704   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_23)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_20)) ))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))));
7705 
7706   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":319
7707  *     m = hw_args._m
7708  *     err[0] = y[0] - (l[0] + s[0])
7709  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
7710  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + (alphac * (l[i - 1]))
7711  *         s[i + m - 1] = gamma * y[i - 1] - \
7712  */
7713   __pyx_t_19 = __pyx_v_hw_args->_n;
7714   __pyx_t_24 = __pyx_t_19;
7715   for (__pyx_t_25 = 1; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
7716     __pyx_v_i = __pyx_t_25;
7717 
7718     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":320
7719  *     err[0] = y[0] - (l[0] + s[0])
7720  *     for i in range(1, hw_args._n):
7721  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + (alphac * (l[i - 1]))             # <<<<<<<<<<<<<<
7722  *         s[i + m - 1] = gamma * y[i - 1] - \
7723  *             (gamma * (l[i - 1])) + (gammac * s[i - 1])
7724  */
7725     __pyx_t_22 = (__pyx_v_i - 1);
7726     __pyx_t_21 = (__pyx_v_i - 1);
7727     __pyx_t_20 = (__pyx_v_i - 1);
7728     __pyx_t_23 = __pyx_v_i;
7729     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_23)) )) = (((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_22)) )))) - (__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_21)) ))))) + (__pyx_v_alphac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) )))));
7730 
7731     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":321
7732  *     for i in range(1, hw_args._n):
7733  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + (alphac * (l[i - 1]))
7734  *         s[i + m - 1] = gamma * y[i - 1] - \             # <<<<<<<<<<<<<<
7735  *             (gamma * (l[i - 1])) + (gammac * s[i - 1])
7736  *         err[i] = y[i] - (l[i] + s[i])
7737  */
7738     __pyx_t_20 = (__pyx_v_i - 1);
7739 
7740     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":322
7741  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + (alphac * (l[i - 1]))
7742  *         s[i + m - 1] = gamma * y[i - 1] - \
7743  *             (gamma * (l[i - 1])) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
7744  *         err[i] = y[i] - (l[i] + s[i])
7745  *     return np.asarray(err)
7746  */
7747     __pyx_t_21 = (__pyx_v_i - 1);
7748 
7749     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":321
7750  *     for i in range(1, hw_args._n):
7751  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + (alphac * (l[i - 1]))
7752  *         s[i + m - 1] = gamma * y[i - 1] - \             # <<<<<<<<<<<<<<
7753  *             (gamma * (l[i - 1])) + (gammac * s[i - 1])
7754  *         err[i] = y[i] - (l[i] + s[i])
7755  */
7756     __pyx_t_22 = (__pyx_v_i - 1);
7757 
7758     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":322
7759  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + (alphac * (l[i - 1]))
7760  *         s[i + m - 1] = gamma * y[i - 1] - \
7761  *             (gamma * (l[i - 1])) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
7762  *         err[i] = y[i] - (l[i] + s[i])
7763  *     return np.asarray(err)
7764  */
7765     __pyx_t_23 = ((__pyx_v_i + __pyx_v_m) - 1);
7766     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )) = (((__pyx_v_gamma * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_20)) )))) - (__pyx_v_gamma * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))))) + (__pyx_v_gammac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))));
7767 
7768     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":323
7769  *         s[i + m - 1] = gamma * y[i - 1] - \
7770  *             (gamma * (l[i - 1])) + (gammac * s[i - 1])
7771  *         err[i] = y[i] - (l[i] + s[i])             # <<<<<<<<<<<<<<
7772  *     return np.asarray(err)
7773  *
7774  */
7775     __pyx_t_22 = __pyx_v_i;
7776     __pyx_t_21 = __pyx_v_i;
7777     __pyx_t_20 = __pyx_v_i;
7778     __pyx_t_23 = __pyx_v_i;
7779     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_23)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_22)) ))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_20)) )))));
7780   }
7781 
7782   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":324
7783  *             (gamma * (l[i - 1])) + (gammac * s[i - 1])
7784  *         err[i] = y[i] - (l[i] + s[i])
7785  *     return np.asarray(err)             # <<<<<<<<<<<<<<
7786  *
7787  * # noinspection PyProtectedMember
7788  */
7789   __Pyx_XDECREF(__pyx_r);
7790   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 324, __pyx_L1_error)
7791   __Pyx_GOTREF(__pyx_t_9);
7792   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error)
7793   __Pyx_GOTREF(__pyx_t_8);
7794   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7795   __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 324, __pyx_L1_error)
7796   __Pyx_GOTREF(__pyx_t_9);
7797   __pyx_t_7 = NULL;
7798   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
7799     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
7800     if (likely(__pyx_t_7)) {
7801       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
7802       __Pyx_INCREF(__pyx_t_7);
7803       __Pyx_INCREF(function);
7804       __Pyx_DECREF_SET(__pyx_t_8, function);
7805     }
7806   }
7807   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
7808   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7809   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7810   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
7811   __Pyx_GOTREF(__pyx_t_1);
7812   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7813   __pyx_r = __pyx_t_1;
7814   __pyx_t_1 = 0;
7815   goto __pyx_L0;
7816 
7817   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":301
7818  *
7819  * # noinspection PyProtectedMember
7820  * def holt_win__add(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
7821  *     """
7822  *     Additive Seasonal
7823  */
7824 
7825   /* function exit code */
7826   __pyx_L1_error:;
7827   __Pyx_XDECREF(__pyx_t_1);
7828   __Pyx_XDECREF(__pyx_t_2);
7829   __Pyx_XDECREF(__pyx_t_3);
7830   __Pyx_XDECREF(__pyx_t_4);
7831   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
7832   __Pyx_XDECREF(__pyx_t_6);
7833   __Pyx_XDECREF(__pyx_t_7);
7834   __Pyx_XDECREF(__pyx_t_8);
7835   __Pyx_XDECREF(__pyx_t_9);
7836   __Pyx_XDECREF(__pyx_t_10);
7837   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win__add", __pyx_clineno, __pyx_lineno, __pyx_filename);
7838   __pyx_r = NULL;
7839   __pyx_L0:;
7840   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
7841   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
7842   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
7843   __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
7844   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
7845   __Pyx_XGIVEREF(__pyx_r);
7846   __Pyx_RefNannyFinishContext();
7847   return __pyx_r;
7848 }
7849 
7850 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":327
7851  *
7852  * # noinspection PyProtectedMember
7853  * def holt_win__mul(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
7854  *     """
7855  *     Multiplicative Seasonal
7856  */
7857 
7858 /* Python wrapper */
7859 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_13holt_win__mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7860 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_12holt_win__mul[] = "\n    Multiplicative Seasonal\n    Minimization Function\n    (,M)\n    ";
7861 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_13holt_win__mul = {"holt_win__mul", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_13holt_win__mul, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_12holt_win__mul};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_13holt_win__mul(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7862 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_13holt_win__mul(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7863   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
7864   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
7865   int __pyx_lineno = 0;
7866   const char *__pyx_filename = NULL;
7867   int __pyx_clineno = 0;
7868   PyObject *__pyx_r = 0;
7869   __Pyx_RefNannyDeclarations
7870   __Pyx_RefNannySetupContext("holt_win__mul (wrapper)", 0);
7871   {
7872     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
7873     PyObject* values[2] = {0,0};
7874     if (unlikely(__pyx_kwds)) {
7875       Py_ssize_t kw_args;
7876       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7877       switch (pos_args) {
7878         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7879         CYTHON_FALLTHROUGH;
7880         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7881         CYTHON_FALLTHROUGH;
7882         case  0: break;
7883         default: goto __pyx_L5_argtuple_error;
7884       }
7885       kw_args = PyDict_Size(__pyx_kwds);
7886       switch (pos_args) {
7887         case  0:
7888         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7889         else goto __pyx_L5_argtuple_error;
7890         CYTHON_FALLTHROUGH;
7891         case  1:
7892         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
7893         else {
7894           __Pyx_RaiseArgtupleInvalid("holt_win__mul", 1, 2, 2, 1); __PYX_ERR(0, 327, __pyx_L3_error)
7895         }
7896       }
7897       if (unlikely(kw_args > 0)) {
7898         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt_win__mul") < 0)) __PYX_ERR(0, 327, __pyx_L3_error)
7899       }
7900     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
7901       goto __pyx_L5_argtuple_error;
7902     } else {
7903       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7904       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7905     }
7906     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 327, __pyx_L3_error)
7907     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
7908   }
7909   goto __pyx_L4_argument_unpacking_done;
7910   __pyx_L5_argtuple_error:;
7911   __Pyx_RaiseArgtupleInvalid("holt_win__mul", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 327, __pyx_L3_error)
7912   __pyx_L3_error:;
7913   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win__mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
7914   __Pyx_RefNannyFinishContext();
7915   return NULL;
7916   __pyx_L4_argument_unpacking_done:;
7917   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 327, __pyx_L1_error)
7918   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_12holt_win__mul(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
7919 
7920   /* function exit code */
7921   goto __pyx_L0;
7922   __pyx_L1_error:;
7923   __pyx_r = NULL;
7924   __pyx_L0:;
7925   __Pyx_RefNannyFinishContext();
7926   return __pyx_r;
7927 }
7928 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_12holt_win__mul(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)7929 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_12holt_win__mul(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
7930   double __pyx_v_alpha;
7931   CYTHON_UNUSED double __pyx_v_beta;
7932   double __pyx_v_gamma;
7933   CYTHON_UNUSED double __pyx_v_phi;
7934   double __pyx_v_alphac;
7935   CYTHON_UNUSED double __pyx_v_betac;
7936   double __pyx_v_gammac;
7937   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
7938   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
7939   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
7940   __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
7941   Py_ssize_t __pyx_v_i;
7942   Py_ssize_t __pyx_v_m;
7943   PyObject *__pyx_r = NULL;
7944   __Pyx_RefNannyDeclarations
7945   PyObject *__pyx_t_1 = NULL;
7946   PyObject *__pyx_t_2 = NULL;
7947   PyObject *__pyx_t_3 = NULL;
7948   PyObject *__pyx_t_4 = NULL;
7949   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
7950   PyObject *__pyx_t_6 = NULL;
7951   PyObject *__pyx_t_7 = NULL;
7952   PyObject *__pyx_t_8 = NULL;
7953   PyObject *__pyx_t_9 = NULL;
7954   PyObject *__pyx_t_10 = NULL;
7955   PyObject *(*__pyx_t_11)(PyObject *);
7956   double __pyx_t_12;
7957   double __pyx_t_13;
7958   double __pyx_t_14;
7959   double __pyx_t_15;
7960   double __pyx_t_16;
7961   double __pyx_t_17;
7962   double __pyx_t_18;
7963   Py_ssize_t __pyx_t_19;
7964   Py_ssize_t __pyx_t_20;
7965   Py_ssize_t __pyx_t_21;
7966   Py_ssize_t __pyx_t_22;
7967   Py_ssize_t __pyx_t_23;
7968   Py_ssize_t __pyx_t_24;
7969   Py_ssize_t __pyx_t_25;
7970   int __pyx_lineno = 0;
7971   const char *__pyx_filename = NULL;
7972   int __pyx_clineno = 0;
7973   __Pyx_RefNannySetupContext("holt_win__mul", 0);
7974 
7975   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":337
7976  *     cdef Py_ssize_t i, m
7977  *
7978  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
7979  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
7980  *
7981  */
7982   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
7983   __Pyx_GOTREF(__pyx_t_2);
7984   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
7985   __Pyx_GOTREF(__pyx_t_3);
7986   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7987   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
7988   __Pyx_GOTREF(__pyx_t_2);
7989   __pyx_t_4 = NULL;
7990   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7991     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
7992     if (likely(__pyx_t_4)) {
7993       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7994       __Pyx_INCREF(__pyx_t_4);
7995       __Pyx_INCREF(function);
7996       __Pyx_DECREF_SET(__pyx_t_3, function);
7997     }
7998   }
7999   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
8000   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8001   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8002   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
8003   __Pyx_GOTREF(__pyx_t_1);
8004   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8005   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 337, __pyx_L1_error)
8006   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8007   __pyx_v_err = __pyx_t_5;
8008   __pyx_t_5.memview = NULL;
8009   __pyx_t_5.data = NULL;
8010 
8011   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":338
8012  *
8013  *     err = np.empty(hw_args._n)
8014  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)             # <<<<<<<<<<<<<<
8015  *
8016  *     y = hw_args._y
8017  */
8018   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
8019   __Pyx_GOTREF(__pyx_t_1);
8020   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
8021     PyObject* sequence = __pyx_t_1;
8022     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8023     if (unlikely(size != 7)) {
8024       if (size > 7) __Pyx_RaiseTooManyValuesError(7);
8025       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8026       __PYX_ERR(0, 338, __pyx_L1_error)
8027     }
8028     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8029     if (likely(PyTuple_CheckExact(sequence))) {
8030       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8031       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
8032       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
8033       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
8034       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
8035       __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5);
8036       __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
8037     } else {
8038       __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
8039       __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
8040       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
8041       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
8042       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
8043       __pyx_t_8 = PyList_GET_ITEM(sequence, 5);
8044       __pyx_t_9 = PyList_GET_ITEM(sequence, 6);
8045     }
8046     __Pyx_INCREF(__pyx_t_3);
8047     __Pyx_INCREF(__pyx_t_2);
8048     __Pyx_INCREF(__pyx_t_4);
8049     __Pyx_INCREF(__pyx_t_6);
8050     __Pyx_INCREF(__pyx_t_7);
8051     __Pyx_INCREF(__pyx_t_8);
8052     __Pyx_INCREF(__pyx_t_9);
8053     #else
8054     {
8055       Py_ssize_t i;
8056       PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
8057       for (i=0; i < 7; i++) {
8058         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 338, __pyx_L1_error)
8059         __Pyx_GOTREF(item);
8060         *(temps[i]) = item;
8061       }
8062     }
8063     #endif
8064     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8065   } else {
8066     Py_ssize_t index = -1;
8067     PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
8068     __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 338, __pyx_L1_error)
8069     __Pyx_GOTREF(__pyx_t_10);
8070     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8071     __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
8072     for (index=0; index < 7; index++) {
8073       PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
8074       __Pyx_GOTREF(item);
8075       *(temps[index]) = item;
8076     }
8077     if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 7) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
8078     __pyx_t_11 = NULL;
8079     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8080     goto __pyx_L4_unpacking_done;
8081     __pyx_L3_unpacking_failed:;
8082     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8083     __pyx_t_11 = NULL;
8084     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
8085     __PYX_ERR(0, 338, __pyx_L1_error)
8086     __pyx_L4_unpacking_done:;
8087   }
8088   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
8089   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8090   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
8091   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8092   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
8093   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8094   __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
8095   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8096   __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
8097   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8098   __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
8099   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8100   __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
8101   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8102   __pyx_v_alpha = __pyx_t_12;
8103   __pyx_v_beta = __pyx_t_13;
8104   __pyx_v_gamma = __pyx_t_14;
8105   __pyx_v_phi = __pyx_t_15;
8106   __pyx_v_alphac = __pyx_t_16;
8107   __pyx_v_betac = __pyx_t_17;
8108   __pyx_v_gammac = __pyx_t_18;
8109 
8110   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":340
8111  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
8112  *
8113  *     y = hw_args._y             # <<<<<<<<<<<<<<
8114  *     l = hw_args._l
8115  *     s = hw_args._s
8116  */
8117   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 340, __pyx_L1_error)}
8118   __pyx_t_5 = __pyx_v_hw_args->_y;
8119   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
8120   __pyx_v_y = __pyx_t_5;
8121   __pyx_t_5.memview = NULL;
8122   __pyx_t_5.data = NULL;
8123 
8124   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":341
8125  *
8126  *     y = hw_args._y
8127  *     l = hw_args._l             # <<<<<<<<<<<<<<
8128  *     s = hw_args._s
8129  *     m = hw_args._m
8130  */
8131   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 341, __pyx_L1_error)}
8132   __pyx_t_5 = __pyx_v_hw_args->_l;
8133   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
8134   __pyx_v_l = __pyx_t_5;
8135   __pyx_t_5.memview = NULL;
8136   __pyx_t_5.data = NULL;
8137 
8138   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":342
8139  *     y = hw_args._y
8140  *     l = hw_args._l
8141  *     s = hw_args._s             # <<<<<<<<<<<<<<
8142  *     m = hw_args._m
8143  *     err[0] = y[0] - (l[0] * s[0])
8144  */
8145   if (unlikely(!__pyx_v_hw_args->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 342, __pyx_L1_error)}
8146   __pyx_t_5 = __pyx_v_hw_args->_s;
8147   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
8148   __pyx_v_s = __pyx_t_5;
8149   __pyx_t_5.memview = NULL;
8150   __pyx_t_5.data = NULL;
8151 
8152   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":343
8153  *     l = hw_args._l
8154  *     s = hw_args._s
8155  *     m = hw_args._m             # <<<<<<<<<<<<<<
8156  *     err[0] = y[0] - (l[0] * s[0])
8157  *     for i in range(1, hw_args._n):
8158  */
8159   __pyx_t_19 = __pyx_v_hw_args->_m;
8160   __pyx_v_m = __pyx_t_19;
8161 
8162   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":344
8163  *     s = hw_args._s
8164  *     m = hw_args._m
8165  *     err[0] = y[0] - (l[0] * s[0])             # <<<<<<<<<<<<<<
8166  *     for i in range(1, hw_args._n):
8167  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + (alphac * (l[i - 1]))
8168  */
8169   __pyx_t_20 = 0;
8170   __pyx_t_21 = 0;
8171   __pyx_t_22 = 0;
8172   __pyx_t_23 = 0;
8173   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_23)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_20)) ))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))));
8174 
8175   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":345
8176  *     m = hw_args._m
8177  *     err[0] = y[0] - (l[0] * s[0])
8178  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
8179  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + (alphac * (l[i - 1]))
8180  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1])) + (gammac * s[i - 1])
8181  */
8182   __pyx_t_19 = __pyx_v_hw_args->_n;
8183   __pyx_t_24 = __pyx_t_19;
8184   for (__pyx_t_25 = 1; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
8185     __pyx_v_i = __pyx_t_25;
8186 
8187     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":346
8188  *     err[0] = y[0] - (l[0] * s[0])
8189  *     for i in range(1, hw_args._n):
8190  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + (alphac * (l[i - 1]))             # <<<<<<<<<<<<<<
8191  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1])) + (gammac * s[i - 1])
8192  *         err[i] = y[i] - (l[i] * s[i])
8193  */
8194     __pyx_t_22 = (__pyx_v_i - 1);
8195     __pyx_t_21 = (__pyx_v_i - 1);
8196     __pyx_t_20 = (__pyx_v_i - 1);
8197     __pyx_t_23 = __pyx_v_i;
8198     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_23)) )) = (((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_22)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_21)) )))) + (__pyx_v_alphac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) )))));
8199 
8200     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":347
8201  *     for i in range(1, hw_args._n):
8202  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + (alphac * (l[i - 1]))
8203  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1])) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
8204  *         err[i] = y[i] - (l[i] * s[i])
8205  *     return np.asarray(err)
8206  */
8207     __pyx_t_20 = (__pyx_v_i - 1);
8208     __pyx_t_21 = (__pyx_v_i - 1);
8209     __pyx_t_22 = (__pyx_v_i - 1);
8210     __pyx_t_23 = ((__pyx_v_i + __pyx_v_m) - 1);
8211     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )) = (((__pyx_v_gamma * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_20)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) )))) + (__pyx_v_gammac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))));
8212 
8213     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":348
8214  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + (alphac * (l[i - 1]))
8215  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1])) + (gammac * s[i - 1])
8216  *         err[i] = y[i] - (l[i] * s[i])             # <<<<<<<<<<<<<<
8217  *     return np.asarray(err)
8218  *
8219  */
8220     __pyx_t_22 = __pyx_v_i;
8221     __pyx_t_21 = __pyx_v_i;
8222     __pyx_t_20 = __pyx_v_i;
8223     __pyx_t_23 = __pyx_v_i;
8224     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_23)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_22)) ))) - ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_20)) )))));
8225   }
8226 
8227   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":349
8228  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1])) + (gammac * s[i - 1])
8229  *         err[i] = y[i] - (l[i] * s[i])
8230  *     return np.asarray(err)             # <<<<<<<<<<<<<<
8231  *
8232  * # noinspection PyProtectedMember
8233  */
8234   __Pyx_XDECREF(__pyx_r);
8235   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 349, __pyx_L1_error)
8236   __Pyx_GOTREF(__pyx_t_9);
8237   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error)
8238   __Pyx_GOTREF(__pyx_t_8);
8239   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8240   __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 349, __pyx_L1_error)
8241   __Pyx_GOTREF(__pyx_t_9);
8242   __pyx_t_7 = NULL;
8243   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8244     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
8245     if (likely(__pyx_t_7)) {
8246       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
8247       __Pyx_INCREF(__pyx_t_7);
8248       __Pyx_INCREF(function);
8249       __Pyx_DECREF_SET(__pyx_t_8, function);
8250     }
8251   }
8252   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
8253   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8254   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8255   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
8256   __Pyx_GOTREF(__pyx_t_1);
8257   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8258   __pyx_r = __pyx_t_1;
8259   __pyx_t_1 = 0;
8260   goto __pyx_L0;
8261 
8262   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":327
8263  *
8264  * # noinspection PyProtectedMember
8265  * def holt_win__mul(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
8266  *     """
8267  *     Multiplicative Seasonal
8268  */
8269 
8270   /* function exit code */
8271   __pyx_L1_error:;
8272   __Pyx_XDECREF(__pyx_t_1);
8273   __Pyx_XDECREF(__pyx_t_2);
8274   __Pyx_XDECREF(__pyx_t_3);
8275   __Pyx_XDECREF(__pyx_t_4);
8276   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
8277   __Pyx_XDECREF(__pyx_t_6);
8278   __Pyx_XDECREF(__pyx_t_7);
8279   __Pyx_XDECREF(__pyx_t_8);
8280   __Pyx_XDECREF(__pyx_t_9);
8281   __Pyx_XDECREF(__pyx_t_10);
8282   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win__mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
8283   __pyx_r = NULL;
8284   __pyx_L0:;
8285   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
8286   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
8287   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
8288   __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
8289   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
8290   __Pyx_XGIVEREF(__pyx_r);
8291   __Pyx_RefNannyFinishContext();
8292   return __pyx_r;
8293 }
8294 
8295 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":352
8296  *
8297  * # noinspection PyProtectedMember
8298  * def holt_win_mul_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
8299  *     """
8300  *     Multiplicative and Multiplicative Damped with Multiplicative Seasonal
8301  */
8302 
8303 /* Python wrapper */
8304 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15holt_win_mul_mul_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8305 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_14holt_win_mul_mul_dam[] = "\n    Multiplicative and Multiplicative Damped with Multiplicative Seasonal\n    Minimization Function\n    (M,M) & (Md,M)\n    ";
8306 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15holt_win_mul_mul_dam = {"holt_win_mul_mul_dam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15holt_win_mul_mul_dam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_14holt_win_mul_mul_dam};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15holt_win_mul_mul_dam(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8307 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15holt_win_mul_mul_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8308   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
8309   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
8310   int __pyx_lineno = 0;
8311   const char *__pyx_filename = NULL;
8312   int __pyx_clineno = 0;
8313   PyObject *__pyx_r = 0;
8314   __Pyx_RefNannyDeclarations
8315   __Pyx_RefNannySetupContext("holt_win_mul_mul_dam (wrapper)", 0);
8316   {
8317     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
8318     PyObject* values[2] = {0,0};
8319     if (unlikely(__pyx_kwds)) {
8320       Py_ssize_t kw_args;
8321       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8322       switch (pos_args) {
8323         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8324         CYTHON_FALLTHROUGH;
8325         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8326         CYTHON_FALLTHROUGH;
8327         case  0: break;
8328         default: goto __pyx_L5_argtuple_error;
8329       }
8330       kw_args = PyDict_Size(__pyx_kwds);
8331       switch (pos_args) {
8332         case  0:
8333         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
8334         else goto __pyx_L5_argtuple_error;
8335         CYTHON_FALLTHROUGH;
8336         case  1:
8337         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
8338         else {
8339           __Pyx_RaiseArgtupleInvalid("holt_win_mul_mul_dam", 1, 2, 2, 1); __PYX_ERR(0, 352, __pyx_L3_error)
8340         }
8341       }
8342       if (unlikely(kw_args > 0)) {
8343         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt_win_mul_mul_dam") < 0)) __PYX_ERR(0, 352, __pyx_L3_error)
8344       }
8345     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
8346       goto __pyx_L5_argtuple_error;
8347     } else {
8348       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8349       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8350     }
8351     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 352, __pyx_L3_error)
8352     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
8353   }
8354   goto __pyx_L4_argument_unpacking_done;
8355   __pyx_L5_argtuple_error:;
8356   __Pyx_RaiseArgtupleInvalid("holt_win_mul_mul_dam", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 352, __pyx_L3_error)
8357   __pyx_L3_error:;
8358   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_mul_mul_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
8359   __Pyx_RefNannyFinishContext();
8360   return NULL;
8361   __pyx_L4_argument_unpacking_done:;
8362   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 352, __pyx_L1_error)
8363   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_14holt_win_mul_mul_dam(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
8364 
8365   /* function exit code */
8366   goto __pyx_L0;
8367   __pyx_L1_error:;
8368   __pyx_r = NULL;
8369   __pyx_L0:;
8370   __Pyx_RefNannyFinishContext();
8371   return __pyx_r;
8372 }
8373 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_14holt_win_mul_mul_dam(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)8374 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_14holt_win_mul_mul_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
8375   double __pyx_v_alpha;
8376   double __pyx_v_beta;
8377   double __pyx_v_gamma;
8378   double __pyx_v_phi;
8379   double __pyx_v_alphac;
8380   double __pyx_v_betac;
8381   double __pyx_v_gammac;
8382   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
8383   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
8384   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
8385   __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
8386   __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
8387   Py_ssize_t __pyx_v_i;
8388   Py_ssize_t __pyx_v_m;
8389   PyObject *__pyx_r = NULL;
8390   __Pyx_RefNannyDeclarations
8391   PyObject *__pyx_t_1 = NULL;
8392   PyObject *__pyx_t_2 = NULL;
8393   PyObject *__pyx_t_3 = NULL;
8394   PyObject *__pyx_t_4 = NULL;
8395   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
8396   PyObject *__pyx_t_6 = NULL;
8397   PyObject *__pyx_t_7 = NULL;
8398   PyObject *__pyx_t_8 = NULL;
8399   PyObject *__pyx_t_9 = NULL;
8400   PyObject *__pyx_t_10 = NULL;
8401   PyObject *(*__pyx_t_11)(PyObject *);
8402   double __pyx_t_12;
8403   double __pyx_t_13;
8404   double __pyx_t_14;
8405   double __pyx_t_15;
8406   double __pyx_t_16;
8407   double __pyx_t_17;
8408   double __pyx_t_18;
8409   Py_ssize_t __pyx_t_19;
8410   Py_ssize_t __pyx_t_20;
8411   Py_ssize_t __pyx_t_21;
8412   Py_ssize_t __pyx_t_22;
8413   Py_ssize_t __pyx_t_23;
8414   Py_ssize_t __pyx_t_24;
8415   Py_ssize_t __pyx_t_25;
8416   Py_ssize_t __pyx_t_26;
8417   int __pyx_lineno = 0;
8418   const char *__pyx_filename = NULL;
8419   int __pyx_clineno = 0;
8420   __Pyx_RefNannySetupContext("holt_win_mul_mul_dam", 0);
8421 
8422   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":362
8423  *     cdef Py_ssize_t i, m
8424  *
8425  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
8426  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
8427  *
8428  */
8429   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
8430   __Pyx_GOTREF(__pyx_t_2);
8431   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
8432   __Pyx_GOTREF(__pyx_t_3);
8433   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8434   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
8435   __Pyx_GOTREF(__pyx_t_2);
8436   __pyx_t_4 = NULL;
8437   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8438     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
8439     if (likely(__pyx_t_4)) {
8440       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8441       __Pyx_INCREF(__pyx_t_4);
8442       __Pyx_INCREF(function);
8443       __Pyx_DECREF_SET(__pyx_t_3, function);
8444     }
8445   }
8446   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
8447   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8448   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8449   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
8450   __Pyx_GOTREF(__pyx_t_1);
8451   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8452   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 362, __pyx_L1_error)
8453   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8454   __pyx_v_err = __pyx_t_5;
8455   __pyx_t_5.memview = NULL;
8456   __pyx_t_5.data = NULL;
8457 
8458   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":363
8459  *
8460  *     err = np.empty(hw_args._n)
8461  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)             # <<<<<<<<<<<<<<
8462  *
8463  *     y = hw_args._y
8464  */
8465   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
8466   __Pyx_GOTREF(__pyx_t_1);
8467   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
8468     PyObject* sequence = __pyx_t_1;
8469     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8470     if (unlikely(size != 7)) {
8471       if (size > 7) __Pyx_RaiseTooManyValuesError(7);
8472       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8473       __PYX_ERR(0, 363, __pyx_L1_error)
8474     }
8475     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8476     if (likely(PyTuple_CheckExact(sequence))) {
8477       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8478       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
8479       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
8480       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
8481       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
8482       __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5);
8483       __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
8484     } else {
8485       __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
8486       __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
8487       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
8488       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
8489       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
8490       __pyx_t_8 = PyList_GET_ITEM(sequence, 5);
8491       __pyx_t_9 = PyList_GET_ITEM(sequence, 6);
8492     }
8493     __Pyx_INCREF(__pyx_t_3);
8494     __Pyx_INCREF(__pyx_t_2);
8495     __Pyx_INCREF(__pyx_t_4);
8496     __Pyx_INCREF(__pyx_t_6);
8497     __Pyx_INCREF(__pyx_t_7);
8498     __Pyx_INCREF(__pyx_t_8);
8499     __Pyx_INCREF(__pyx_t_9);
8500     #else
8501     {
8502       Py_ssize_t i;
8503       PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
8504       for (i=0; i < 7; i++) {
8505         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 363, __pyx_L1_error)
8506         __Pyx_GOTREF(item);
8507         *(temps[i]) = item;
8508       }
8509     }
8510     #endif
8511     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8512   } else {
8513     Py_ssize_t index = -1;
8514     PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
8515     __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 363, __pyx_L1_error)
8516     __Pyx_GOTREF(__pyx_t_10);
8517     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8518     __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
8519     for (index=0; index < 7; index++) {
8520       PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
8521       __Pyx_GOTREF(item);
8522       *(temps[index]) = item;
8523     }
8524     if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 7) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
8525     __pyx_t_11 = NULL;
8526     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8527     goto __pyx_L4_unpacking_done;
8528     __pyx_L3_unpacking_failed:;
8529     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8530     __pyx_t_11 = NULL;
8531     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
8532     __PYX_ERR(0, 363, __pyx_L1_error)
8533     __pyx_L4_unpacking_done:;
8534   }
8535   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
8536   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8537   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
8538   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8539   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
8540   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8541   __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
8542   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8543   __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
8544   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8545   __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
8546   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8547   __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
8548   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8549   __pyx_v_alpha = __pyx_t_12;
8550   __pyx_v_beta = __pyx_t_13;
8551   __pyx_v_gamma = __pyx_t_14;
8552   __pyx_v_phi = __pyx_t_15;
8553   __pyx_v_alphac = __pyx_t_16;
8554   __pyx_v_betac = __pyx_t_17;
8555   __pyx_v_gammac = __pyx_t_18;
8556 
8557   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":365
8558  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
8559  *
8560  *     y = hw_args._y             # <<<<<<<<<<<<<<
8561  *     l = hw_args._l
8562  *     b = hw_args._b
8563  */
8564   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 365, __pyx_L1_error)}
8565   __pyx_t_5 = __pyx_v_hw_args->_y;
8566   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
8567   __pyx_v_y = __pyx_t_5;
8568   __pyx_t_5.memview = NULL;
8569   __pyx_t_5.data = NULL;
8570 
8571   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":366
8572  *
8573  *     y = hw_args._y
8574  *     l = hw_args._l             # <<<<<<<<<<<<<<
8575  *     b = hw_args._b
8576  *     s = hw_args._s
8577  */
8578   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 366, __pyx_L1_error)}
8579   __pyx_t_5 = __pyx_v_hw_args->_l;
8580   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
8581   __pyx_v_l = __pyx_t_5;
8582   __pyx_t_5.memview = NULL;
8583   __pyx_t_5.data = NULL;
8584 
8585   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":367
8586  *     y = hw_args._y
8587  *     l = hw_args._l
8588  *     b = hw_args._b             # <<<<<<<<<<<<<<
8589  *     s = hw_args._s
8590  *     m = hw_args._m
8591  */
8592   if (unlikely(!__pyx_v_hw_args->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 367, __pyx_L1_error)}
8593   __pyx_t_5 = __pyx_v_hw_args->_b;
8594   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
8595   __pyx_v_b = __pyx_t_5;
8596   __pyx_t_5.memview = NULL;
8597   __pyx_t_5.data = NULL;
8598 
8599   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":368
8600  *     l = hw_args._l
8601  *     b = hw_args._b
8602  *     s = hw_args._s             # <<<<<<<<<<<<<<
8603  *     m = hw_args._m
8604  *     err[0] = y[0] - ((l[0] * b[0]**phi) * s[0])
8605  */
8606   if (unlikely(!__pyx_v_hw_args->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 368, __pyx_L1_error)}
8607   __pyx_t_5 = __pyx_v_hw_args->_s;
8608   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
8609   __pyx_v_s = __pyx_t_5;
8610   __pyx_t_5.memview = NULL;
8611   __pyx_t_5.data = NULL;
8612 
8613   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":369
8614  *     b = hw_args._b
8615  *     s = hw_args._s
8616  *     m = hw_args._m             # <<<<<<<<<<<<<<
8617  *     err[0] = y[0] - ((l[0] * b[0]**phi) * s[0])
8618  *     for i in range(1, hw_args._n):
8619  */
8620   __pyx_t_19 = __pyx_v_hw_args->_m;
8621   __pyx_v_m = __pyx_t_19;
8622 
8623   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":370
8624  *     s = hw_args._s
8625  *     m = hw_args._m
8626  *     err[0] = y[0] - ((l[0] * b[0]**phi) * s[0])             # <<<<<<<<<<<<<<
8627  *     for i in range(1, hw_args._n):
8628  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \
8629  */
8630   __pyx_t_20 = 0;
8631   __pyx_t_21 = 0;
8632   __pyx_t_22 = 0;
8633   __pyx_t_23 = 0;
8634   __pyx_t_24 = 0;
8635   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_24)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_20)) ))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_22)) ))), __pyx_v_phi)) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )))));
8636 
8637   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":371
8638  *     m = hw_args._m
8639  *     err[0] = y[0] - ((l[0] * b[0]**phi) * s[0])
8640  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
8641  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \
8642  *             (alphac * (l[i - 1] * b[i - 1]**phi))
8643  */
8644   __pyx_t_19 = __pyx_v_hw_args->_n;
8645   __pyx_t_25 = __pyx_t_19;
8646   for (__pyx_t_26 = 1; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
8647     __pyx_v_i = __pyx_t_26;
8648 
8649     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":372
8650  *     err[0] = y[0] - ((l[0] * b[0]**phi) * s[0])
8651  *     for i in range(1, hw_args._n):
8652  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \             # <<<<<<<<<<<<<<
8653  *             (alphac * (l[i - 1] * b[i - 1]**phi))
8654  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
8655  */
8656     __pyx_t_23 = (__pyx_v_i - 1);
8657     __pyx_t_22 = (__pyx_v_i - 1);
8658 
8659     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":373
8660  *     for i in range(1, hw_args._n):
8661  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \
8662  *             (alphac * (l[i - 1] * b[i - 1]**phi))             # <<<<<<<<<<<<<<
8663  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
8664  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] *
8665  */
8666     __pyx_t_21 = (__pyx_v_i - 1);
8667     __pyx_t_20 = (__pyx_v_i - 1);
8668 
8669     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":372
8670  *     err[0] = y[0] - ((l[0] * b[0]**phi) * s[0])
8671  *     for i in range(1, hw_args._n):
8672  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \             # <<<<<<<<<<<<<<
8673  *             (alphac * (l[i - 1] * b[i - 1]**phi))
8674  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
8675  */
8676     __pyx_t_24 = __pyx_v_i;
8677     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_24)) )) = (((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_23)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))) + (__pyx_v_alphac * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_20)) ))), __pyx_v_phi))));
8678 
8679     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":374
8680  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \
8681  *             (alphac * (l[i - 1] * b[i - 1]**phi))
8682  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)             # <<<<<<<<<<<<<<
8683  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] *
8684  *                                           b[i - 1]**phi)) + (gammac * s[i - 1])
8685  */
8686     __pyx_t_20 = __pyx_v_i;
8687     __pyx_t_21 = (__pyx_v_i - 1);
8688     __pyx_t_22 = (__pyx_v_i - 1);
8689     __pyx_t_23 = __pyx_v_i;
8690     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_23)) )) = ((__pyx_v_beta * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) ))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))))) + (__pyx_v_betac * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_22)) ))), __pyx_v_phi)));
8691 
8692     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":375
8693  *             (alphac * (l[i - 1] * b[i - 1]**phi))
8694  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
8695  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] *             # <<<<<<<<<<<<<<
8696  *                                           b[i - 1]**phi)) + (gammac * s[i - 1])
8697  *         err[i] = y[i] - ((l[i] * b[i]**phi) * s[i])
8698  */
8699     __pyx_t_22 = (__pyx_v_i - 1);
8700     __pyx_t_21 = (__pyx_v_i - 1);
8701 
8702     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":376
8703  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
8704  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] *
8705  *                                           b[i - 1]**phi)) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
8706  *         err[i] = y[i] - ((l[i] * b[i]**phi) * s[i])
8707  *     return np.asarray(err)
8708  */
8709     __pyx_t_20 = (__pyx_v_i - 1);
8710 
8711     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":375
8712  *             (alphac * (l[i - 1] * b[i - 1]**phi))
8713  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
8714  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] *             # <<<<<<<<<<<<<<
8715  *                                           b[i - 1]**phi)) + (gammac * s[i - 1])
8716  *         err[i] = y[i] - ((l[i] * b[i]**phi) * s[i])
8717  */
8718     __pyx_t_23 = (__pyx_v_i - 1);
8719 
8720     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":376
8721  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
8722  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] *
8723  *                                           b[i - 1]**phi)) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
8724  *         err[i] = y[i] - ((l[i] * b[i]**phi) * s[i])
8725  *     return np.asarray(err)
8726  */
8727     __pyx_t_24 = ((__pyx_v_i + __pyx_v_m) - 1);
8728     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_24)) )) = (((__pyx_v_gamma * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_22)) )))) / ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_20)) ))), __pyx_v_phi))) + (__pyx_v_gammac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )))));
8729 
8730     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":377
8731  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] *
8732  *                                           b[i - 1]**phi)) + (gammac * s[i - 1])
8733  *         err[i] = y[i] - ((l[i] * b[i]**phi) * s[i])             # <<<<<<<<<<<<<<
8734  *     return np.asarray(err)
8735  *
8736  */
8737     __pyx_t_23 = __pyx_v_i;
8738     __pyx_t_20 = __pyx_v_i;
8739     __pyx_t_21 = __pyx_v_i;
8740     __pyx_t_22 = __pyx_v_i;
8741     __pyx_t_24 = __pyx_v_i;
8742     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_24)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_23)) ))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_21)) ))), __pyx_v_phi)) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))));
8743   }
8744 
8745   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":378
8746  *                                           b[i - 1]**phi)) + (gammac * s[i - 1])
8747  *         err[i] = y[i] - ((l[i] * b[i]**phi) * s[i])
8748  *     return np.asarray(err)             # <<<<<<<<<<<<<<
8749  *
8750  *
8751  */
8752   __Pyx_XDECREF(__pyx_r);
8753   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 378, __pyx_L1_error)
8754   __Pyx_GOTREF(__pyx_t_9);
8755   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 378, __pyx_L1_error)
8756   __Pyx_GOTREF(__pyx_t_8);
8757   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8758   __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 378, __pyx_L1_error)
8759   __Pyx_GOTREF(__pyx_t_9);
8760   __pyx_t_7 = NULL;
8761   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8762     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
8763     if (likely(__pyx_t_7)) {
8764       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
8765       __Pyx_INCREF(__pyx_t_7);
8766       __Pyx_INCREF(function);
8767       __Pyx_DECREF_SET(__pyx_t_8, function);
8768     }
8769   }
8770   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
8771   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8772   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8773   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
8774   __Pyx_GOTREF(__pyx_t_1);
8775   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8776   __pyx_r = __pyx_t_1;
8777   __pyx_t_1 = 0;
8778   goto __pyx_L0;
8779 
8780   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":352
8781  *
8782  * # noinspection PyProtectedMember
8783  * def holt_win_mul_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
8784  *     """
8785  *     Multiplicative and Multiplicative Damped with Multiplicative Seasonal
8786  */
8787 
8788   /* function exit code */
8789   __pyx_L1_error:;
8790   __Pyx_XDECREF(__pyx_t_1);
8791   __Pyx_XDECREF(__pyx_t_2);
8792   __Pyx_XDECREF(__pyx_t_3);
8793   __Pyx_XDECREF(__pyx_t_4);
8794   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
8795   __Pyx_XDECREF(__pyx_t_6);
8796   __Pyx_XDECREF(__pyx_t_7);
8797   __Pyx_XDECREF(__pyx_t_8);
8798   __Pyx_XDECREF(__pyx_t_9);
8799   __Pyx_XDECREF(__pyx_t_10);
8800   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_mul_mul_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
8801   __pyx_r = NULL;
8802   __pyx_L0:;
8803   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
8804   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
8805   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
8806   __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
8807   __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
8808   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
8809   __Pyx_XGIVEREF(__pyx_r);
8810   __Pyx_RefNannyFinishContext();
8811   return __pyx_r;
8812 }
8813 
8814 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":383
8815  *
8816  * # noinspection PyProtectedMember
8817  * def holt_win_add_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
8818  *     """
8819  *     Additive and Additive Damped with Multiplicative Seasonal
8820  */
8821 
8822 /* Python wrapper */
8823 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_17holt_win_add_mul_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8824 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_16holt_win_add_mul_dam[] = "\n    Additive and Additive Damped with Multiplicative Seasonal\n    Minimization Function\n    (A,M) & (Ad,M)\n    ";
8825 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_17holt_win_add_mul_dam = {"holt_win_add_mul_dam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_17holt_win_add_mul_dam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_16holt_win_add_mul_dam};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_17holt_win_add_mul_dam(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8826 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_17holt_win_add_mul_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8827   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
8828   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
8829   int __pyx_lineno = 0;
8830   const char *__pyx_filename = NULL;
8831   int __pyx_clineno = 0;
8832   PyObject *__pyx_r = 0;
8833   __Pyx_RefNannyDeclarations
8834   __Pyx_RefNannySetupContext("holt_win_add_mul_dam (wrapper)", 0);
8835   {
8836     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
8837     PyObject* values[2] = {0,0};
8838     if (unlikely(__pyx_kwds)) {
8839       Py_ssize_t kw_args;
8840       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8841       switch (pos_args) {
8842         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8843         CYTHON_FALLTHROUGH;
8844         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8845         CYTHON_FALLTHROUGH;
8846         case  0: break;
8847         default: goto __pyx_L5_argtuple_error;
8848       }
8849       kw_args = PyDict_Size(__pyx_kwds);
8850       switch (pos_args) {
8851         case  0:
8852         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
8853         else goto __pyx_L5_argtuple_error;
8854         CYTHON_FALLTHROUGH;
8855         case  1:
8856         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
8857         else {
8858           __Pyx_RaiseArgtupleInvalid("holt_win_add_mul_dam", 1, 2, 2, 1); __PYX_ERR(0, 383, __pyx_L3_error)
8859         }
8860       }
8861       if (unlikely(kw_args > 0)) {
8862         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt_win_add_mul_dam") < 0)) __PYX_ERR(0, 383, __pyx_L3_error)
8863       }
8864     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
8865       goto __pyx_L5_argtuple_error;
8866     } else {
8867       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8868       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8869     }
8870     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 383, __pyx_L3_error)
8871     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
8872   }
8873   goto __pyx_L4_argument_unpacking_done;
8874   __pyx_L5_argtuple_error:;
8875   __Pyx_RaiseArgtupleInvalid("holt_win_add_mul_dam", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 383, __pyx_L3_error)
8876   __pyx_L3_error:;
8877   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_add_mul_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
8878   __Pyx_RefNannyFinishContext();
8879   return NULL;
8880   __pyx_L4_argument_unpacking_done:;
8881   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 383, __pyx_L1_error)
8882   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_16holt_win_add_mul_dam(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
8883 
8884   /* function exit code */
8885   goto __pyx_L0;
8886   __pyx_L1_error:;
8887   __pyx_r = NULL;
8888   __pyx_L0:;
8889   __Pyx_RefNannyFinishContext();
8890   return __pyx_r;
8891 }
8892 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_16holt_win_add_mul_dam(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)8893 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_16holt_win_add_mul_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
8894   double __pyx_v_alpha;
8895   double __pyx_v_beta;
8896   double __pyx_v_gamma;
8897   double __pyx_v_phi;
8898   double __pyx_v_alphac;
8899   double __pyx_v_betac;
8900   double __pyx_v_gammac;
8901   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
8902   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
8903   __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
8904   __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
8905   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
8906   Py_ssize_t __pyx_v_i;
8907   Py_ssize_t __pyx_v_m;
8908   PyObject *__pyx_r = NULL;
8909   __Pyx_RefNannyDeclarations
8910   PyObject *__pyx_t_1 = NULL;
8911   PyObject *__pyx_t_2 = NULL;
8912   PyObject *__pyx_t_3 = NULL;
8913   PyObject *__pyx_t_4 = NULL;
8914   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
8915   PyObject *__pyx_t_6 = NULL;
8916   PyObject *__pyx_t_7 = NULL;
8917   PyObject *__pyx_t_8 = NULL;
8918   PyObject *__pyx_t_9 = NULL;
8919   PyObject *__pyx_t_10 = NULL;
8920   PyObject *(*__pyx_t_11)(PyObject *);
8921   double __pyx_t_12;
8922   double __pyx_t_13;
8923   double __pyx_t_14;
8924   double __pyx_t_15;
8925   double __pyx_t_16;
8926   double __pyx_t_17;
8927   double __pyx_t_18;
8928   Py_ssize_t __pyx_t_19;
8929   Py_ssize_t __pyx_t_20;
8930   Py_ssize_t __pyx_t_21;
8931   Py_ssize_t __pyx_t_22;
8932   Py_ssize_t __pyx_t_23;
8933   Py_ssize_t __pyx_t_24;
8934   Py_ssize_t __pyx_t_25;
8935   Py_ssize_t __pyx_t_26;
8936   int __pyx_lineno = 0;
8937   const char *__pyx_filename = NULL;
8938   int __pyx_clineno = 0;
8939   __Pyx_RefNannySetupContext("holt_win_add_mul_dam", 0);
8940 
8941   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":393
8942  *     cdef Py_ssize_t i, m
8943  *
8944  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
8945  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
8946  *
8947  */
8948   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
8949   __Pyx_GOTREF(__pyx_t_2);
8950   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
8951   __Pyx_GOTREF(__pyx_t_3);
8952   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8953   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
8954   __Pyx_GOTREF(__pyx_t_2);
8955   __pyx_t_4 = NULL;
8956   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8957     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
8958     if (likely(__pyx_t_4)) {
8959       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8960       __Pyx_INCREF(__pyx_t_4);
8961       __Pyx_INCREF(function);
8962       __Pyx_DECREF_SET(__pyx_t_3, function);
8963     }
8964   }
8965   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
8966   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8967   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8968   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
8969   __Pyx_GOTREF(__pyx_t_1);
8970   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8971   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 393, __pyx_L1_error)
8972   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8973   __pyx_v_err = __pyx_t_5;
8974   __pyx_t_5.memview = NULL;
8975   __pyx_t_5.data = NULL;
8976 
8977   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":394
8978  *
8979  *     err = np.empty(hw_args._n)
8980  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)             # <<<<<<<<<<<<<<
8981  *
8982  *     y = hw_args._y
8983  */
8984   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
8985   __Pyx_GOTREF(__pyx_t_1);
8986   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
8987     PyObject* sequence = __pyx_t_1;
8988     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8989     if (unlikely(size != 7)) {
8990       if (size > 7) __Pyx_RaiseTooManyValuesError(7);
8991       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8992       __PYX_ERR(0, 394, __pyx_L1_error)
8993     }
8994     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8995     if (likely(PyTuple_CheckExact(sequence))) {
8996       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8997       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
8998       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
8999       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
9000       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
9001       __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5);
9002       __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
9003     } else {
9004       __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
9005       __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
9006       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
9007       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
9008       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
9009       __pyx_t_8 = PyList_GET_ITEM(sequence, 5);
9010       __pyx_t_9 = PyList_GET_ITEM(sequence, 6);
9011     }
9012     __Pyx_INCREF(__pyx_t_3);
9013     __Pyx_INCREF(__pyx_t_2);
9014     __Pyx_INCREF(__pyx_t_4);
9015     __Pyx_INCREF(__pyx_t_6);
9016     __Pyx_INCREF(__pyx_t_7);
9017     __Pyx_INCREF(__pyx_t_8);
9018     __Pyx_INCREF(__pyx_t_9);
9019     #else
9020     {
9021       Py_ssize_t i;
9022       PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
9023       for (i=0; i < 7; i++) {
9024         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 394, __pyx_L1_error)
9025         __Pyx_GOTREF(item);
9026         *(temps[i]) = item;
9027       }
9028     }
9029     #endif
9030     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9031   } else {
9032     Py_ssize_t index = -1;
9033     PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
9034     __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 394, __pyx_L1_error)
9035     __Pyx_GOTREF(__pyx_t_10);
9036     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9037     __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
9038     for (index=0; index < 7; index++) {
9039       PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
9040       __Pyx_GOTREF(item);
9041       *(temps[index]) = item;
9042     }
9043     if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 7) < 0) __PYX_ERR(0, 394, __pyx_L1_error)
9044     __pyx_t_11 = NULL;
9045     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9046     goto __pyx_L4_unpacking_done;
9047     __pyx_L3_unpacking_failed:;
9048     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9049     __pyx_t_11 = NULL;
9050     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9051     __PYX_ERR(0, 394, __pyx_L1_error)
9052     __pyx_L4_unpacking_done:;
9053   }
9054   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error)
9055   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9056   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error)
9057   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9058   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error)
9059   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9060   __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error)
9061   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9062   __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error)
9063   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9064   __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error)
9065   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9066   __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L1_error)
9067   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9068   __pyx_v_alpha = __pyx_t_12;
9069   __pyx_v_beta = __pyx_t_13;
9070   __pyx_v_gamma = __pyx_t_14;
9071   __pyx_v_phi = __pyx_t_15;
9072   __pyx_v_alphac = __pyx_t_16;
9073   __pyx_v_betac = __pyx_t_17;
9074   __pyx_v_gammac = __pyx_t_18;
9075 
9076   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":396
9077  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
9078  *
9079  *     y = hw_args._y             # <<<<<<<<<<<<<<
9080  *     l = hw_args._l
9081  *     b = hw_args._b
9082  */
9083   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 396, __pyx_L1_error)}
9084   __pyx_t_5 = __pyx_v_hw_args->_y;
9085   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
9086   __pyx_v_y = __pyx_t_5;
9087   __pyx_t_5.memview = NULL;
9088   __pyx_t_5.data = NULL;
9089 
9090   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":397
9091  *
9092  *     y = hw_args._y
9093  *     l = hw_args._l             # <<<<<<<<<<<<<<
9094  *     b = hw_args._b
9095  *     s = hw_args._s
9096  */
9097   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 397, __pyx_L1_error)}
9098   __pyx_t_5 = __pyx_v_hw_args->_l;
9099   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
9100   __pyx_v_l = __pyx_t_5;
9101   __pyx_t_5.memview = NULL;
9102   __pyx_t_5.data = NULL;
9103 
9104   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":398
9105  *     y = hw_args._y
9106  *     l = hw_args._l
9107  *     b = hw_args._b             # <<<<<<<<<<<<<<
9108  *     s = hw_args._s
9109  *     m = hw_args._m
9110  */
9111   if (unlikely(!__pyx_v_hw_args->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 398, __pyx_L1_error)}
9112   __pyx_t_5 = __pyx_v_hw_args->_b;
9113   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
9114   __pyx_v_b = __pyx_t_5;
9115   __pyx_t_5.memview = NULL;
9116   __pyx_t_5.data = NULL;
9117 
9118   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":399
9119  *     l = hw_args._l
9120  *     b = hw_args._b
9121  *     s = hw_args._s             # <<<<<<<<<<<<<<
9122  *     m = hw_args._m
9123  *     err[0] = y[0] - ((l[0] + phi * b[0]) * s[0])
9124  */
9125   if (unlikely(!__pyx_v_hw_args->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 399, __pyx_L1_error)}
9126   __pyx_t_5 = __pyx_v_hw_args->_s;
9127   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
9128   __pyx_v_s = __pyx_t_5;
9129   __pyx_t_5.memview = NULL;
9130   __pyx_t_5.data = NULL;
9131 
9132   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":400
9133  *     b = hw_args._b
9134  *     s = hw_args._s
9135  *     m = hw_args._m             # <<<<<<<<<<<<<<
9136  *     err[0] = y[0] - ((l[0] + phi * b[0]) * s[0])
9137  *     for i in range(1, hw_args._n):
9138  */
9139   __pyx_t_19 = __pyx_v_hw_args->_m;
9140   __pyx_v_m = __pyx_t_19;
9141 
9142   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":401
9143  *     s = hw_args._s
9144  *     m = hw_args._m
9145  *     err[0] = y[0] - ((l[0] + phi * b[0]) * s[0])             # <<<<<<<<<<<<<<
9146  *     for i in range(1, hw_args._n):
9147  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \
9148  */
9149   __pyx_t_20 = 0;
9150   __pyx_t_21 = 0;
9151   __pyx_t_22 = 0;
9152   __pyx_t_23 = 0;
9153   __pyx_t_24 = 0;
9154   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_24)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_20)) ))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_22)) ))))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )))));
9155 
9156   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":402
9157  *     m = hw_args._m
9158  *     err[0] = y[0] - ((l[0] + phi * b[0]) * s[0])
9159  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
9160  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \
9161  *             (alphac * (l[i - 1] + phi * b[i - 1]))
9162  */
9163   __pyx_t_19 = __pyx_v_hw_args->_n;
9164   __pyx_t_25 = __pyx_t_19;
9165   for (__pyx_t_26 = 1; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
9166     __pyx_v_i = __pyx_t_26;
9167 
9168     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":403
9169  *     err[0] = y[0] - ((l[0] + phi * b[0]) * s[0])
9170  *     for i in range(1, hw_args._n):
9171  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \             # <<<<<<<<<<<<<<
9172  *             (alphac * (l[i - 1] + phi * b[i - 1]))
9173  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
9174  */
9175     __pyx_t_23 = (__pyx_v_i - 1);
9176     __pyx_t_22 = (__pyx_v_i - 1);
9177 
9178     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":404
9179  *     for i in range(1, hw_args._n):
9180  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \
9181  *             (alphac * (l[i - 1] + phi * b[i - 1]))             # <<<<<<<<<<<<<<
9182  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
9183  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] + phi *
9184  */
9185     __pyx_t_21 = (__pyx_v_i - 1);
9186     __pyx_t_20 = (__pyx_v_i - 1);
9187 
9188     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":403
9189  *     err[0] = y[0] - ((l[0] + phi * b[0]) * s[0])
9190  *     for i in range(1, hw_args._n):
9191  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \             # <<<<<<<<<<<<<<
9192  *             (alphac * (l[i - 1] + phi * b[i - 1]))
9193  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
9194  */
9195     __pyx_t_24 = __pyx_v_i;
9196     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_24)) )) = (((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_23)) )))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))) + (__pyx_v_alphac * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_20)) )))))));
9197 
9198     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":405
9199  *         l[i] = (alpha * y[i - 1] / s[i - 1]) + \
9200  *             (alphac * (l[i - 1] + phi * b[i - 1]))
9201  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])             # <<<<<<<<<<<<<<
9202  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] + phi *
9203  *                                           b[i - 1])) + (gammac * s[i - 1])
9204  */
9205     __pyx_t_20 = __pyx_v_i;
9206     __pyx_t_21 = (__pyx_v_i - 1);
9207     __pyx_t_22 = (__pyx_v_i - 1);
9208     __pyx_t_23 = __pyx_v_i;
9209     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_23)) )) = ((__pyx_v_beta * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) ))) - (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))))) + ((__pyx_v_betac * __pyx_v_phi) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_22)) )))));
9210 
9211     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":406
9212  *             (alphac * (l[i - 1] + phi * b[i - 1]))
9213  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
9214  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] + phi *             # <<<<<<<<<<<<<<
9215  *                                           b[i - 1])) + (gammac * s[i - 1])
9216  *         err[i] = y[i] - ((l[i] + phi * b[i]) * s[i])
9217  */
9218     __pyx_t_22 = (__pyx_v_i - 1);
9219     __pyx_t_21 = (__pyx_v_i - 1);
9220 
9221     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":407
9222  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
9223  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] + phi *
9224  *                                           b[i - 1])) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
9225  *         err[i] = y[i] - ((l[i] + phi * b[i]) * s[i])
9226  *     return np.asarray(err)
9227  */
9228     __pyx_t_20 = (__pyx_v_i - 1);
9229 
9230     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":406
9231  *             (alphac * (l[i - 1] + phi * b[i - 1]))
9232  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
9233  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] + phi *             # <<<<<<<<<<<<<<
9234  *                                           b[i - 1])) + (gammac * s[i - 1])
9235  *         err[i] = y[i] - ((l[i] + phi * b[i]) * s[i])
9236  */
9237     __pyx_t_23 = (__pyx_v_i - 1);
9238 
9239     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":407
9240  *         b[i] = (beta * (l[i] - l[i - 1])) + (betac * phi * b[i - 1])
9241  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] + phi *
9242  *                                           b[i - 1])) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
9243  *         err[i] = y[i] - ((l[i] + phi * b[i]) * s[i])
9244  *     return np.asarray(err)
9245  */
9246     __pyx_t_24 = ((__pyx_v_i + __pyx_v_m) - 1);
9247     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_24)) )) = (((__pyx_v_gamma * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_22)) )))) / ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_20)) )))))) + (__pyx_v_gammac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )))));
9248 
9249     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":408
9250  *         s[i + m - 1] = (gamma * y[i - 1] / (l[i - 1] + phi *
9251  *                                           b[i - 1])) + (gammac * s[i - 1])
9252  *         err[i] = y[i] - ((l[i] + phi * b[i]) * s[i])             # <<<<<<<<<<<<<<
9253  *     return np.asarray(err)
9254  *
9255  */
9256     __pyx_t_23 = __pyx_v_i;
9257     __pyx_t_20 = __pyx_v_i;
9258     __pyx_t_21 = __pyx_v_i;
9259     __pyx_t_22 = __pyx_v_i;
9260     __pyx_t_24 = __pyx_v_i;
9261     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_24)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_23)) ))) - (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) ))) + (__pyx_v_phi * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_21)) ))))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))));
9262   }
9263 
9264   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":409
9265  *                                           b[i - 1])) + (gammac * s[i - 1])
9266  *         err[i] = y[i] - ((l[i] + phi * b[i]) * s[i])
9267  *     return np.asarray(err)             # <<<<<<<<<<<<<<
9268  *
9269  *
9270  */
9271   __Pyx_XDECREF(__pyx_r);
9272   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 409, __pyx_L1_error)
9273   __Pyx_GOTREF(__pyx_t_9);
9274   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 409, __pyx_L1_error)
9275   __Pyx_GOTREF(__pyx_t_8);
9276   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9277   __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 409, __pyx_L1_error)
9278   __Pyx_GOTREF(__pyx_t_9);
9279   __pyx_t_7 = NULL;
9280   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9281     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
9282     if (likely(__pyx_t_7)) {
9283       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
9284       __Pyx_INCREF(__pyx_t_7);
9285       __Pyx_INCREF(function);
9286       __Pyx_DECREF_SET(__pyx_t_8, function);
9287     }
9288   }
9289   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
9290   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9291   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9292   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error)
9293   __Pyx_GOTREF(__pyx_t_1);
9294   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9295   __pyx_r = __pyx_t_1;
9296   __pyx_t_1 = 0;
9297   goto __pyx_L0;
9298 
9299   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":383
9300  *
9301  * # noinspection PyProtectedMember
9302  * def holt_win_add_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
9303  *     """
9304  *     Additive and Additive Damped with Multiplicative Seasonal
9305  */
9306 
9307   /* function exit code */
9308   __pyx_L1_error:;
9309   __Pyx_XDECREF(__pyx_t_1);
9310   __Pyx_XDECREF(__pyx_t_2);
9311   __Pyx_XDECREF(__pyx_t_3);
9312   __Pyx_XDECREF(__pyx_t_4);
9313   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
9314   __Pyx_XDECREF(__pyx_t_6);
9315   __Pyx_XDECREF(__pyx_t_7);
9316   __Pyx_XDECREF(__pyx_t_8);
9317   __Pyx_XDECREF(__pyx_t_9);
9318   __Pyx_XDECREF(__pyx_t_10);
9319   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_add_mul_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
9320   __pyx_r = NULL;
9321   __pyx_L0:;
9322   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
9323   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
9324   __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
9325   __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
9326   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
9327   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
9328   __Pyx_XGIVEREF(__pyx_r);
9329   __Pyx_RefNannyFinishContext();
9330   return __pyx_r;
9331 }
9332 
9333 /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":414
9334  *
9335  * # noinspection PyProtectedMember
9336  * def holt_win_mul_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
9337  *     """
9338  *     Multiplicative and Multiplicative Damped with Additive Seasonal
9339  */
9340 
9341 /* Python wrapper */
9342 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_19holt_win_mul_add_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9343 static char __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_18holt_win_mul_add_dam[] = "\n    Multiplicative and Multiplicative Damped with Additive Seasonal\n    Minimization Function\n    (M,A) & (M,Ad)\n    ";
9344 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_19holt_win_mul_add_dam = {"holt_win_mul_add_dam", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_19holt_win_mul_add_dam, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_18holt_win_mul_add_dam};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_19holt_win_mul_add_dam(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9345 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_19holt_win_mul_add_dam(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9346   __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
9347   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args = 0;
9348   int __pyx_lineno = 0;
9349   const char *__pyx_filename = NULL;
9350   int __pyx_clineno = 0;
9351   PyObject *__pyx_r = 0;
9352   __Pyx_RefNannyDeclarations
9353   __Pyx_RefNannySetupContext("holt_win_mul_add_dam (wrapper)", 0);
9354   {
9355     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_hw_args,0};
9356     PyObject* values[2] = {0,0};
9357     if (unlikely(__pyx_kwds)) {
9358       Py_ssize_t kw_args;
9359       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9360       switch (pos_args) {
9361         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9362         CYTHON_FALLTHROUGH;
9363         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9364         CYTHON_FALLTHROUGH;
9365         case  0: break;
9366         default: goto __pyx_L5_argtuple_error;
9367       }
9368       kw_args = PyDict_Size(__pyx_kwds);
9369       switch (pos_args) {
9370         case  0:
9371         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
9372         else goto __pyx_L5_argtuple_error;
9373         CYTHON_FALLTHROUGH;
9374         case  1:
9375         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hw_args)) != 0)) kw_args--;
9376         else {
9377           __Pyx_RaiseArgtupleInvalid("holt_win_mul_add_dam", 1, 2, 2, 1); __PYX_ERR(0, 414, __pyx_L3_error)
9378         }
9379       }
9380       if (unlikely(kw_args > 0)) {
9381         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "holt_win_mul_add_dam") < 0)) __PYX_ERR(0, 414, __pyx_L3_error)
9382       }
9383     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
9384       goto __pyx_L5_argtuple_error;
9385     } else {
9386       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9387       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9388     }
9389     __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 414, __pyx_L3_error)
9390     __pyx_v_hw_args = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)values[1]);
9391   }
9392   goto __pyx_L4_argument_unpacking_done;
9393   __pyx_L5_argtuple_error:;
9394   __Pyx_RaiseArgtupleInvalid("holt_win_mul_add_dam", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 414, __pyx_L3_error)
9395   __pyx_L3_error:;
9396   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_mul_add_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
9397   __Pyx_RefNannyFinishContext();
9398   return NULL;
9399   __pyx_L4_argument_unpacking_done:;
9400   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hw_args), __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, 1, "hw_args", 0))) __PYX_ERR(0, 414, __pyx_L1_error)
9401   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_18holt_win_mul_add_dam(__pyx_self, __pyx_v_x, __pyx_v_hw_args);
9402 
9403   /* function exit code */
9404   goto __pyx_L0;
9405   __pyx_L1_error:;
9406   __pyx_r = NULL;
9407   __pyx_L0:;
9408   __Pyx_RefNannyFinishContext();
9409   return __pyx_r;
9410 }
9411 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_18holt_win_mul_add_dam(CYTHON_UNUSED PyObject * __pyx_self,__Pyx_memviewslice __pyx_v_x,struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v_hw_args)9412 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_18holt_win_mul_add_dam(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v_hw_args) {
9413   double __pyx_v_alpha;
9414   double __pyx_v_beta;
9415   double __pyx_v_gamma;
9416   double __pyx_v_phi;
9417   double __pyx_v_alphac;
9418   double __pyx_v_betac;
9419   double __pyx_v_gammac;
9420   __Pyx_memviewslice __pyx_v_err = { 0, 0, { 0 }, { 0 }, { 0 } };
9421   __Pyx_memviewslice __pyx_v_l = { 0, 0, { 0 }, { 0 }, { 0 } };
9422   __Pyx_memviewslice __pyx_v_s = { 0, 0, { 0 }, { 0 }, { 0 } };
9423   __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
9424   __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
9425   Py_ssize_t __pyx_v_i;
9426   Py_ssize_t __pyx_v_m;
9427   PyObject *__pyx_r = NULL;
9428   __Pyx_RefNannyDeclarations
9429   PyObject *__pyx_t_1 = NULL;
9430   PyObject *__pyx_t_2 = NULL;
9431   PyObject *__pyx_t_3 = NULL;
9432   PyObject *__pyx_t_4 = NULL;
9433   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
9434   PyObject *__pyx_t_6 = NULL;
9435   PyObject *__pyx_t_7 = NULL;
9436   PyObject *__pyx_t_8 = NULL;
9437   PyObject *__pyx_t_9 = NULL;
9438   PyObject *__pyx_t_10 = NULL;
9439   PyObject *(*__pyx_t_11)(PyObject *);
9440   double __pyx_t_12;
9441   double __pyx_t_13;
9442   double __pyx_t_14;
9443   double __pyx_t_15;
9444   double __pyx_t_16;
9445   double __pyx_t_17;
9446   double __pyx_t_18;
9447   Py_ssize_t __pyx_t_19;
9448   Py_ssize_t __pyx_t_20;
9449   Py_ssize_t __pyx_t_21;
9450   Py_ssize_t __pyx_t_22;
9451   Py_ssize_t __pyx_t_23;
9452   Py_ssize_t __pyx_t_24;
9453   Py_ssize_t __pyx_t_25;
9454   Py_ssize_t __pyx_t_26;
9455   int __pyx_lineno = 0;
9456   const char *__pyx_filename = NULL;
9457   int __pyx_clineno = 0;
9458   __Pyx_RefNannySetupContext("holt_win_mul_add_dam", 0);
9459 
9460   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":424
9461  *     cdef Py_ssize_t i, m
9462  *
9463  *     err = np.empty(hw_args._n)             # <<<<<<<<<<<<<<
9464  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
9465  *
9466  */
9467   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
9468   __Pyx_GOTREF(__pyx_t_2);
9469   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
9470   __Pyx_GOTREF(__pyx_t_3);
9471   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9472   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_hw_args->_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
9473   __Pyx_GOTREF(__pyx_t_2);
9474   __pyx_t_4 = NULL;
9475   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
9476     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
9477     if (likely(__pyx_t_4)) {
9478       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9479       __Pyx_INCREF(__pyx_t_4);
9480       __Pyx_INCREF(function);
9481       __Pyx_DECREF_SET(__pyx_t_3, function);
9482     }
9483   }
9484   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
9485   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9486   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9487   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error)
9488   __Pyx_GOTREF(__pyx_t_1);
9489   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9490   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 424, __pyx_L1_error)
9491   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9492   __pyx_v_err = __pyx_t_5;
9493   __pyx_t_5.memview = NULL;
9494   __pyx_t_5.data = NULL;
9495 
9496   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":425
9497  *
9498  *     err = np.empty(hw_args._n)
9499  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)             # <<<<<<<<<<<<<<
9500  *
9501  *     y = hw_args._y
9502  */
9503   __pyx_t_1 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_holt_win_init(__pyx_v_x, __pyx_v_hw_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
9504   __Pyx_GOTREF(__pyx_t_1);
9505   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
9506     PyObject* sequence = __pyx_t_1;
9507     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9508     if (unlikely(size != 7)) {
9509       if (size > 7) __Pyx_RaiseTooManyValuesError(7);
9510       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9511       __PYX_ERR(0, 425, __pyx_L1_error)
9512     }
9513     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9514     if (likely(PyTuple_CheckExact(sequence))) {
9515       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9516       __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
9517       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
9518       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
9519       __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
9520       __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5);
9521       __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
9522     } else {
9523       __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
9524       __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
9525       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
9526       __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
9527       __pyx_t_7 = PyList_GET_ITEM(sequence, 4);
9528       __pyx_t_8 = PyList_GET_ITEM(sequence, 5);
9529       __pyx_t_9 = PyList_GET_ITEM(sequence, 6);
9530     }
9531     __Pyx_INCREF(__pyx_t_3);
9532     __Pyx_INCREF(__pyx_t_2);
9533     __Pyx_INCREF(__pyx_t_4);
9534     __Pyx_INCREF(__pyx_t_6);
9535     __Pyx_INCREF(__pyx_t_7);
9536     __Pyx_INCREF(__pyx_t_8);
9537     __Pyx_INCREF(__pyx_t_9);
9538     #else
9539     {
9540       Py_ssize_t i;
9541       PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
9542       for (i=0; i < 7; i++) {
9543         PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 425, __pyx_L1_error)
9544         __Pyx_GOTREF(item);
9545         *(temps[i]) = item;
9546       }
9547     }
9548     #endif
9549     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9550   } else {
9551     Py_ssize_t index = -1;
9552     PyObject** temps[7] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
9553     __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 425, __pyx_L1_error)
9554     __Pyx_GOTREF(__pyx_t_10);
9555     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9556     __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
9557     for (index=0; index < 7; index++) {
9558       PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
9559       __Pyx_GOTREF(item);
9560       *(temps[index]) = item;
9561     }
9562     if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 7) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
9563     __pyx_t_11 = NULL;
9564     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9565     goto __pyx_L4_unpacking_done;
9566     __pyx_L3_unpacking_failed:;
9567     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9568     __pyx_t_11 = NULL;
9569     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9570     __PYX_ERR(0, 425, __pyx_L1_error)
9571     __pyx_L4_unpacking_done:;
9572   }
9573   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
9574   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9575   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
9576   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9577   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
9578   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9579   __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
9580   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9581   __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
9582   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9583   __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
9584   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9585   __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
9586   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9587   __pyx_v_alpha = __pyx_t_12;
9588   __pyx_v_beta = __pyx_t_13;
9589   __pyx_v_gamma = __pyx_t_14;
9590   __pyx_v_phi = __pyx_t_15;
9591   __pyx_v_alphac = __pyx_t_16;
9592   __pyx_v_betac = __pyx_t_17;
9593   __pyx_v_gammac = __pyx_t_18;
9594 
9595   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":427
9596  *     alpha, beta, gamma, phi, alphac, betac, gammac= holt_win_init(x, hw_args)
9597  *
9598  *     y = hw_args._y             # <<<<<<<<<<<<<<
9599  *     l = hw_args._l
9600  *     b = hw_args._b
9601  */
9602   if (unlikely(!__pyx_v_hw_args->_y.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 427, __pyx_L1_error)}
9603   __pyx_t_5 = __pyx_v_hw_args->_y;
9604   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
9605   __pyx_v_y = __pyx_t_5;
9606   __pyx_t_5.memview = NULL;
9607   __pyx_t_5.data = NULL;
9608 
9609   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":428
9610  *
9611  *     y = hw_args._y
9612  *     l = hw_args._l             # <<<<<<<<<<<<<<
9613  *     b = hw_args._b
9614  *     s = hw_args._s
9615  */
9616   if (unlikely(!__pyx_v_hw_args->_l.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 428, __pyx_L1_error)}
9617   __pyx_t_5 = __pyx_v_hw_args->_l;
9618   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
9619   __pyx_v_l = __pyx_t_5;
9620   __pyx_t_5.memview = NULL;
9621   __pyx_t_5.data = NULL;
9622 
9623   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":429
9624  *     y = hw_args._y
9625  *     l = hw_args._l
9626  *     b = hw_args._b             # <<<<<<<<<<<<<<
9627  *     s = hw_args._s
9628  *     m = hw_args._m
9629  */
9630   if (unlikely(!__pyx_v_hw_args->_b.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 429, __pyx_L1_error)}
9631   __pyx_t_5 = __pyx_v_hw_args->_b;
9632   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
9633   __pyx_v_b = __pyx_t_5;
9634   __pyx_t_5.memview = NULL;
9635   __pyx_t_5.data = NULL;
9636 
9637   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":430
9638  *     l = hw_args._l
9639  *     b = hw_args._b
9640  *     s = hw_args._s             # <<<<<<<<<<<<<<
9641  *     m = hw_args._m
9642  *     err[0] = y[0] - ((l[0] * phi * b[0]) + s[0])
9643  */
9644   if (unlikely(!__pyx_v_hw_args->_s.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 430, __pyx_L1_error)}
9645   __pyx_t_5 = __pyx_v_hw_args->_s;
9646   __PYX_INC_MEMVIEW(&__pyx_t_5, 1);
9647   __pyx_v_s = __pyx_t_5;
9648   __pyx_t_5.memview = NULL;
9649   __pyx_t_5.data = NULL;
9650 
9651   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":431
9652  *     b = hw_args._b
9653  *     s = hw_args._s
9654  *     m = hw_args._m             # <<<<<<<<<<<<<<
9655  *     err[0] = y[0] - ((l[0] * phi * b[0]) + s[0])
9656  *     for i in range(1, hw_args._n):
9657  */
9658   __pyx_t_19 = __pyx_v_hw_args->_m;
9659   __pyx_v_m = __pyx_t_19;
9660 
9661   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":432
9662  *     s = hw_args._s
9663  *     m = hw_args._m
9664  *     err[0] = y[0] - ((l[0] * phi * b[0]) + s[0])             # <<<<<<<<<<<<<<
9665  *     for i in range(1, hw_args._n):
9666  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \
9667  */
9668   __pyx_t_20 = 0;
9669   __pyx_t_21 = 0;
9670   __pyx_t_22 = 0;
9671   __pyx_t_23 = 0;
9672   __pyx_t_24 = 0;
9673   *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_24)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_20)) ))) - ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) * __pyx_v_phi) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_22)) )))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )))));
9674 
9675   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":433
9676  *     m = hw_args._m
9677  *     err[0] = y[0] - ((l[0] * phi * b[0]) + s[0])
9678  *     for i in range(1, hw_args._n):             # <<<<<<<<<<<<<<
9679  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \
9680  *             (alphac * (l[i - 1] * b[i - 1]**phi))
9681  */
9682   __pyx_t_19 = __pyx_v_hw_args->_n;
9683   __pyx_t_25 = __pyx_t_19;
9684   for (__pyx_t_26 = 1; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
9685     __pyx_v_i = __pyx_t_26;
9686 
9687     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":434
9688  *     err[0] = y[0] - ((l[0] * phi * b[0]) + s[0])
9689  *     for i in range(1, hw_args._n):
9690  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \             # <<<<<<<<<<<<<<
9691  *             (alphac * (l[i - 1] * b[i - 1]**phi))
9692  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
9693  */
9694     __pyx_t_23 = (__pyx_v_i - 1);
9695     __pyx_t_22 = (__pyx_v_i - 1);
9696 
9697     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":435
9698  *     for i in range(1, hw_args._n):
9699  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \
9700  *             (alphac * (l[i - 1] * b[i - 1]**phi))             # <<<<<<<<<<<<<<
9701  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
9702  *         s[i + m - 1] = gamma * y[i - 1] - \
9703  */
9704     __pyx_t_21 = (__pyx_v_i - 1);
9705     __pyx_t_20 = (__pyx_v_i - 1);
9706 
9707     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":434
9708  *     err[0] = y[0] - ((l[0] * phi * b[0]) + s[0])
9709  *     for i in range(1, hw_args._n):
9710  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \             # <<<<<<<<<<<<<<
9711  *             (alphac * (l[i - 1] * b[i - 1]**phi))
9712  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
9713  */
9714     __pyx_t_24 = __pyx_v_i;
9715     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_24)) )) = (((__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_23)) )))) - (__pyx_v_alpha * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) ))))) + (__pyx_v_alphac * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_20)) ))), __pyx_v_phi))));
9716 
9717     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":436
9718  *         l[i] = (alpha * y[i - 1]) - (alpha * s[i - 1]) + \
9719  *             (alphac * (l[i - 1] * b[i - 1]**phi))
9720  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)             # <<<<<<<<<<<<<<
9721  *         s[i + m - 1] = gamma * y[i - 1] - \
9722  *             (gamma * (l[i - 1] * b[i - 1]**phi)) + (gammac * s[i - 1])
9723  */
9724     __pyx_t_20 = __pyx_v_i;
9725     __pyx_t_21 = (__pyx_v_i - 1);
9726     __pyx_t_22 = (__pyx_v_i - 1);
9727     __pyx_t_23 = __pyx_v_i;
9728     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_23)) )) = ((__pyx_v_beta * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) ))) / (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))))) + (__pyx_v_betac * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_22)) ))), __pyx_v_phi)));
9729 
9730     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":437
9731  *             (alphac * (l[i - 1] * b[i - 1]**phi))
9732  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
9733  *         s[i + m - 1] = gamma * y[i - 1] - \             # <<<<<<<<<<<<<<
9734  *             (gamma * (l[i - 1] * b[i - 1]**phi)) + (gammac * s[i - 1])
9735  *         err[i] = y[i] - ((l[i] * phi * b[i]) + s[i])
9736  */
9737     __pyx_t_22 = (__pyx_v_i - 1);
9738 
9739     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":438
9740  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
9741  *         s[i + m - 1] = gamma * y[i - 1] - \
9742  *             (gamma * (l[i - 1] * b[i - 1]**phi)) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
9743  *         err[i] = y[i] - ((l[i] * phi * b[i]) + s[i])
9744  *     return np.asarray(err)
9745  */
9746     __pyx_t_21 = (__pyx_v_i - 1);
9747     __pyx_t_20 = (__pyx_v_i - 1);
9748 
9749     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":437
9750  *             (alphac * (l[i - 1] * b[i - 1]**phi))
9751  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
9752  *         s[i + m - 1] = gamma * y[i - 1] - \             # <<<<<<<<<<<<<<
9753  *             (gamma * (l[i - 1] * b[i - 1]**phi)) + (gammac * s[i - 1])
9754  *         err[i] = y[i] - ((l[i] * phi * b[i]) + s[i])
9755  */
9756     __pyx_t_23 = (__pyx_v_i - 1);
9757 
9758     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":438
9759  *         b[i] = (beta * (l[i] / l[i - 1])) + (betac * b[i - 1]**phi)
9760  *         s[i + m - 1] = gamma * y[i - 1] - \
9761  *             (gamma * (l[i - 1] * b[i - 1]**phi)) + (gammac * s[i - 1])             # <<<<<<<<<<<<<<
9762  *         err[i] = y[i] - ((l[i] * phi * b[i]) + s[i])
9763  *     return np.asarray(err)
9764  */
9765     __pyx_t_24 = ((__pyx_v_i + __pyx_v_m) - 1);
9766     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_24)) )) = (((__pyx_v_gamma * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_22)) )))) - (__pyx_v_gamma * ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_21)) ))) * pow((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_20)) ))), __pyx_v_phi)))) + (__pyx_v_gammac * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_23)) )))));
9767 
9768     /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":439
9769  *         s[i + m - 1] = gamma * y[i - 1] - \
9770  *             (gamma * (l[i - 1] * b[i - 1]**phi)) + (gammac * s[i - 1])
9771  *         err[i] = y[i] - ((l[i] * phi * b[i]) + s[i])             # <<<<<<<<<<<<<<
9772  *     return np.asarray(err)
9773  */
9774     __pyx_t_23 = __pyx_v_i;
9775     __pyx_t_20 = __pyx_v_i;
9776     __pyx_t_21 = __pyx_v_i;
9777     __pyx_t_22 = __pyx_v_i;
9778     __pyx_t_24 = __pyx_v_i;
9779     *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_err.data) + __pyx_t_24)) )) = ((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y.data) + __pyx_t_23)) ))) - ((((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_l.data) + __pyx_t_20)) ))) * __pyx_v_phi) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_b.data) + __pyx_t_21)) )))) + (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_s.data) + __pyx_t_22)) )))));
9780   }
9781 
9782   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":440
9783  *             (gamma * (l[i - 1] * b[i - 1]**phi)) + (gammac * s[i - 1])
9784  *         err[i] = y[i] - ((l[i] * phi * b[i]) + s[i])
9785  *     return np.asarray(err)             # <<<<<<<<<<<<<<
9786  */
9787   __Pyx_XDECREF(__pyx_r);
9788   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 440, __pyx_L1_error)
9789   __Pyx_GOTREF(__pyx_t_9);
9790   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 440, __pyx_L1_error)
9791   __Pyx_GOTREF(__pyx_t_8);
9792   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9793   __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_err, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 440, __pyx_L1_error)
9794   __Pyx_GOTREF(__pyx_t_9);
9795   __pyx_t_7 = NULL;
9796   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9797     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
9798     if (likely(__pyx_t_7)) {
9799       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
9800       __Pyx_INCREF(__pyx_t_7);
9801       __Pyx_INCREF(function);
9802       __Pyx_DECREF_SET(__pyx_t_8, function);
9803     }
9804   }
9805   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
9806   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9807   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9808   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
9809   __Pyx_GOTREF(__pyx_t_1);
9810   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9811   __pyx_r = __pyx_t_1;
9812   __pyx_t_1 = 0;
9813   goto __pyx_L0;
9814 
9815   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":414
9816  *
9817  * # noinspection PyProtectedMember
9818  * def holt_win_mul_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
9819  *     """
9820  *     Multiplicative and Multiplicative Damped with Additive Seasonal
9821  */
9822 
9823   /* function exit code */
9824   __pyx_L1_error:;
9825   __Pyx_XDECREF(__pyx_t_1);
9826   __Pyx_XDECREF(__pyx_t_2);
9827   __Pyx_XDECREF(__pyx_t_3);
9828   __Pyx_XDECREF(__pyx_t_4);
9829   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
9830   __Pyx_XDECREF(__pyx_t_6);
9831   __Pyx_XDECREF(__pyx_t_7);
9832   __Pyx_XDECREF(__pyx_t_8);
9833   __Pyx_XDECREF(__pyx_t_9);
9834   __Pyx_XDECREF(__pyx_t_10);
9835   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.holt_win_mul_add_dam", __pyx_clineno, __pyx_lineno, __pyx_filename);
9836   __pyx_r = NULL;
9837   __pyx_L0:;
9838   __PYX_XDEC_MEMVIEW(&__pyx_v_err, 1);
9839   __PYX_XDEC_MEMVIEW(&__pyx_v_l, 1);
9840   __PYX_XDEC_MEMVIEW(&__pyx_v_s, 1);
9841   __PYX_XDEC_MEMVIEW(&__pyx_v_b, 1);
9842   __PYX_XDEC_MEMVIEW(&__pyx_v_y, 1);
9843   __PYX_XDEC_MEMVIEW(&__pyx_v_x, 1);
9844   __Pyx_XGIVEREF(__pyx_r);
9845   __Pyx_RefNannyFinishContext();
9846   return __pyx_r;
9847 }
9848 
9849 /* "(tree fragment)":1
9850  * def __pyx_unpickle_HoltWintersArgs(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
9851  *     cdef object __pyx_PickleError
9852  *     cdef object __pyx_result
9853  */
9854 
9855 /* Python wrapper */
9856 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_21__pyx_unpickle_HoltWintersArgs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9857 static PyMethodDef __pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_21__pyx_unpickle_HoltWintersArgs = {"__pyx_unpickle_HoltWintersArgs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_21__pyx_unpickle_HoltWintersArgs, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_21__pyx_unpickle_HoltWintersArgs(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9858 static PyObject *__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_21__pyx_unpickle_HoltWintersArgs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9859   PyObject *__pyx_v___pyx_type = 0;
9860   long __pyx_v___pyx_checksum;
9861   PyObject *__pyx_v___pyx_state = 0;
9862   int __pyx_lineno = 0;
9863   const char *__pyx_filename = NULL;
9864   int __pyx_clineno = 0;
9865   PyObject *__pyx_r = 0;
9866   __Pyx_RefNannyDeclarations
9867   __Pyx_RefNannySetupContext("__pyx_unpickle_HoltWintersArgs (wrapper)", 0);
9868   {
9869     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
9870     PyObject* values[3] = {0,0,0};
9871     if (unlikely(__pyx_kwds)) {
9872       Py_ssize_t kw_args;
9873       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9874       switch (pos_args) {
9875         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9876         CYTHON_FALLTHROUGH;
9877         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9878         CYTHON_FALLTHROUGH;
9879         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9880         CYTHON_FALLTHROUGH;
9881         case  0: break;
9882         default: goto __pyx_L5_argtuple_error;
9883       }
9884       kw_args = PyDict_Size(__pyx_kwds);
9885       switch (pos_args) {
9886         case  0:
9887         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
9888         else goto __pyx_L5_argtuple_error;
9889         CYTHON_FALLTHROUGH;
9890         case  1:
9891         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
9892         else {
9893           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoltWintersArgs", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
9894         }
9895         CYTHON_FALLTHROUGH;
9896         case  2:
9897         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
9898         else {
9899           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoltWintersArgs", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
9900         }
9901       }
9902       if (unlikely(kw_args > 0)) {
9903         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_HoltWintersArgs") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
9904       }
9905     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9906       goto __pyx_L5_argtuple_error;
9907     } else {
9908       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9909       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9910       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9911     }
9912     __pyx_v___pyx_type = values[0];
9913     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
9914     __pyx_v___pyx_state = values[2];
9915   }
9916   goto __pyx_L4_argument_unpacking_done;
9917   __pyx_L5_argtuple_error:;
9918   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoltWintersArgs", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
9919   __pyx_L3_error:;
9920   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.__pyx_unpickle_HoltWintersArgs", __pyx_clineno, __pyx_lineno, __pyx_filename);
9921   __Pyx_RefNannyFinishContext();
9922   return NULL;
9923   __pyx_L4_argument_unpacking_done:;
9924   __pyx_r = __pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_20__pyx_unpickle_HoltWintersArgs(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
9925 
9926   /* function exit code */
9927   __Pyx_RefNannyFinishContext();
9928   return __pyx_r;
9929 }
9930 
__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_20__pyx_unpickle_HoltWintersArgs(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)9931 static PyObject *__pyx_pf_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_20__pyx_unpickle_HoltWintersArgs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
9932   PyObject *__pyx_v___pyx_PickleError = 0;
9933   PyObject *__pyx_v___pyx_result = 0;
9934   PyObject *__pyx_r = NULL;
9935   __Pyx_RefNannyDeclarations
9936   int __pyx_t_1;
9937   PyObject *__pyx_t_2 = NULL;
9938   PyObject *__pyx_t_3 = NULL;
9939   PyObject *__pyx_t_4 = NULL;
9940   PyObject *__pyx_t_5 = NULL;
9941   int __pyx_t_6;
9942   int __pyx_lineno = 0;
9943   const char *__pyx_filename = NULL;
9944   int __pyx_clineno = 0;
9945   __Pyx_RefNannySetupContext("__pyx_unpickle_HoltWintersArgs", 0);
9946 
9947   /* "(tree fragment)":4
9948  *     cdef object __pyx_PickleError
9949  *     cdef object __pyx_result
9950  *     if __pyx_checksum != 0xb9b4cdd:             # <<<<<<<<<<<<<<
9951  *         from pickle import PickleError as __pyx_PickleError
9952  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb9b4cdd = (_b, _bounds, _l, _m, _n, _p, _s, _transform, _xi, _y))" % __pyx_checksum)
9953  */
9954   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb9b4cdd) != 0);
9955   if (__pyx_t_1) {
9956 
9957     /* "(tree fragment)":5
9958  *     cdef object __pyx_result
9959  *     if __pyx_checksum != 0xb9b4cdd:
9960  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
9961  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb9b4cdd = (_b, _bounds, _l, _m, _n, _p, _s, _transform, _xi, _y))" % __pyx_checksum)
9962  *     __pyx_result = HoltWintersArgs.__new__(__pyx_type)
9963  */
9964     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
9965     __Pyx_GOTREF(__pyx_t_2);
9966     __Pyx_INCREF(__pyx_n_s_PickleError);
9967     __Pyx_GIVEREF(__pyx_n_s_PickleError);
9968     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
9969     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9970     __Pyx_GOTREF(__pyx_t_3);
9971     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9972     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
9973     __Pyx_GOTREF(__pyx_t_2);
9974     __Pyx_INCREF(__pyx_t_2);
9975     __pyx_v___pyx_PickleError = __pyx_t_2;
9976     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9977     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9978 
9979     /* "(tree fragment)":6
9980  *     if __pyx_checksum != 0xb9b4cdd:
9981  *         from pickle import PickleError as __pyx_PickleError
9982  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb9b4cdd = (_b, _bounds, _l, _m, _n, _p, _s, _transform, _xi, _y))" % __pyx_checksum)             # <<<<<<<<<<<<<<
9983  *     __pyx_result = HoltWintersArgs.__new__(__pyx_type)
9984  *     if __pyx_state is not None:
9985  */
9986     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
9987     __Pyx_GOTREF(__pyx_t_2);
9988     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb9, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
9989     __Pyx_GOTREF(__pyx_t_4);
9990     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9991     __Pyx_INCREF(__pyx_v___pyx_PickleError);
9992     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
9993     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
9994       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
9995       if (likely(__pyx_t_5)) {
9996         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9997         __Pyx_INCREF(__pyx_t_5);
9998         __Pyx_INCREF(function);
9999         __Pyx_DECREF_SET(__pyx_t_2, function);
10000       }
10001     }
10002     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
10003     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10004     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10005     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
10006     __Pyx_GOTREF(__pyx_t_3);
10007     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10008     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10009     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10010     __PYX_ERR(1, 6, __pyx_L1_error)
10011 
10012     /* "(tree fragment)":4
10013  *     cdef object __pyx_PickleError
10014  *     cdef object __pyx_result
10015  *     if __pyx_checksum != 0xb9b4cdd:             # <<<<<<<<<<<<<<
10016  *         from pickle import PickleError as __pyx_PickleError
10017  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb9b4cdd = (_b, _bounds, _l, _m, _n, _p, _s, _transform, _xi, _y))" % __pyx_checksum)
10018  */
10019   }
10020 
10021   /* "(tree fragment)":7
10022  *         from pickle import PickleError as __pyx_PickleError
10023  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb9b4cdd = (_b, _bounds, _l, _m, _n, _p, _s, _transform, _xi, _y))" % __pyx_checksum)
10024  *     __pyx_result = HoltWintersArgs.__new__(__pyx_type)             # <<<<<<<<<<<<<<
10025  *     if __pyx_state is not None:
10026  *         __pyx_unpickle_HoltWintersArgs__set_state(<HoltWintersArgs> __pyx_result, __pyx_state)
10027  */
10028   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
10029   __Pyx_GOTREF(__pyx_t_2);
10030   __pyx_t_4 = NULL;
10031   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
10032     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
10033     if (likely(__pyx_t_4)) {
10034       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10035       __Pyx_INCREF(__pyx_t_4);
10036       __Pyx_INCREF(function);
10037       __Pyx_DECREF_SET(__pyx_t_2, function);
10038     }
10039   }
10040   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
10041   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10042   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
10043   __Pyx_GOTREF(__pyx_t_3);
10044   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10045   __pyx_v___pyx_result = __pyx_t_3;
10046   __pyx_t_3 = 0;
10047 
10048   /* "(tree fragment)":8
10049  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb9b4cdd = (_b, _bounds, _l, _m, _n, _p, _s, _transform, _xi, _y))" % __pyx_checksum)
10050  *     __pyx_result = HoltWintersArgs.__new__(__pyx_type)
10051  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
10052  *         __pyx_unpickle_HoltWintersArgs__set_state(<HoltWintersArgs> __pyx_result, __pyx_state)
10053  *     return __pyx_result
10054  */
10055   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
10056   __pyx_t_6 = (__pyx_t_1 != 0);
10057   if (__pyx_t_6) {
10058 
10059     /* "(tree fragment)":9
10060  *     __pyx_result = HoltWintersArgs.__new__(__pyx_type)
10061  *     if __pyx_state is not None:
10062  *         __pyx_unpickle_HoltWintersArgs__set_state(<HoltWintersArgs> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
10063  *     return __pyx_result
10064  * cdef __pyx_unpickle_HoltWintersArgs__set_state(HoltWintersArgs __pyx_result, tuple __pyx_state):
10065  */
10066     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
10067     __pyx_t_3 = __pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers___pyx_unpickle_HoltWintersArgs__set_state(((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
10068     __Pyx_GOTREF(__pyx_t_3);
10069     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10070 
10071     /* "(tree fragment)":8
10072  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb9b4cdd = (_b, _bounds, _l, _m, _n, _p, _s, _transform, _xi, _y))" % __pyx_checksum)
10073  *     __pyx_result = HoltWintersArgs.__new__(__pyx_type)
10074  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
10075  *         __pyx_unpickle_HoltWintersArgs__set_state(<HoltWintersArgs> __pyx_result, __pyx_state)
10076  *     return __pyx_result
10077  */
10078   }
10079 
10080   /* "(tree fragment)":10
10081  *     if __pyx_state is not None:
10082  *         __pyx_unpickle_HoltWintersArgs__set_state(<HoltWintersArgs> __pyx_result, __pyx_state)
10083  *     return __pyx_result             # <<<<<<<<<<<<<<
10084  * cdef __pyx_unpickle_HoltWintersArgs__set_state(HoltWintersArgs __pyx_result, tuple __pyx_state):
10085  *     __pyx_result._b = __pyx_state[0]; __pyx_result._bounds = __pyx_state[1]; __pyx_result._l = __pyx_state[2]; __pyx_result._m = __pyx_state[3]; __pyx_result._n = __pyx_state[4]; __pyx_result._p = __pyx_state[5]; __pyx_result._s = __pyx_state[6]; __pyx_result._transform = __pyx_state[7]; __pyx_result._xi = __pyx_state[8]; __pyx_result._y = __pyx_state[9]
10086  */
10087   __Pyx_XDECREF(__pyx_r);
10088   __Pyx_INCREF(__pyx_v___pyx_result);
10089   __pyx_r = __pyx_v___pyx_result;
10090   goto __pyx_L0;
10091 
10092   /* "(tree fragment)":1
10093  * def __pyx_unpickle_HoltWintersArgs(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
10094  *     cdef object __pyx_PickleError
10095  *     cdef object __pyx_result
10096  */
10097 
10098   /* function exit code */
10099   __pyx_L1_error:;
10100   __Pyx_XDECREF(__pyx_t_2);
10101   __Pyx_XDECREF(__pyx_t_3);
10102   __Pyx_XDECREF(__pyx_t_4);
10103   __Pyx_XDECREF(__pyx_t_5);
10104   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.__pyx_unpickle_HoltWintersArgs", __pyx_clineno, __pyx_lineno, __pyx_filename);
10105   __pyx_r = NULL;
10106   __pyx_L0:;
10107   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
10108   __Pyx_XDECREF(__pyx_v___pyx_result);
10109   __Pyx_XGIVEREF(__pyx_r);
10110   __Pyx_RefNannyFinishContext();
10111   return __pyx_r;
10112 }
10113 
10114 /* "(tree fragment)":11
10115  *         __pyx_unpickle_HoltWintersArgs__set_state(<HoltWintersArgs> __pyx_result, __pyx_state)
10116  *     return __pyx_result
10117  * cdef __pyx_unpickle_HoltWintersArgs__set_state(HoltWintersArgs __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
10118  *     __pyx_result._b = __pyx_state[0]; __pyx_result._bounds = __pyx_state[1]; __pyx_result._l = __pyx_state[2]; __pyx_result._m = __pyx_state[3]; __pyx_result._n = __pyx_state[4]; __pyx_result._p = __pyx_state[5]; __pyx_result._s = __pyx_state[6]; __pyx_result._transform = __pyx_state[7]; __pyx_result._xi = __pyx_state[8]; __pyx_result._y = __pyx_state[9]
10119  *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
10120  */
10121 
__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers___pyx_unpickle_HoltWintersArgs__set_state(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)10122 static PyObject *__pyx_f_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers___pyx_unpickle_HoltWintersArgs__set_state(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
10123   PyObject *__pyx_r = NULL;
10124   __Pyx_RefNannyDeclarations
10125   __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } };
10126   __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
10127   Py_ssize_t __pyx_t_3;
10128   int __pyx_t_4;
10129   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
10130   int __pyx_t_6;
10131   int __pyx_t_7;
10132   PyObject *__pyx_t_8 = NULL;
10133   PyObject *__pyx_t_9 = NULL;
10134   PyObject *__pyx_t_10 = NULL;
10135   int __pyx_lineno = 0;
10136   const char *__pyx_filename = NULL;
10137   int __pyx_clineno = 0;
10138   __Pyx_RefNannySetupContext("__pyx_unpickle_HoltWintersArgs__set_state", 0);
10139 
10140   /* "(tree fragment)":12
10141  *     return __pyx_result
10142  * cdef __pyx_unpickle_HoltWintersArgs__set_state(HoltWintersArgs __pyx_result, tuple __pyx_state):
10143  *     __pyx_result._b = __pyx_state[0]; __pyx_result._bounds = __pyx_state[1]; __pyx_result._l = __pyx_state[2]; __pyx_result._m = __pyx_state[3]; __pyx_result._n = __pyx_state[4]; __pyx_result._p = __pyx_state[5]; __pyx_result._s = __pyx_state[6]; __pyx_result._transform = __pyx_state[7]; __pyx_result._xi = __pyx_state[8]; __pyx_result._y = __pyx_state[9]             # <<<<<<<<<<<<<<
10144  *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
10145  *         __pyx_result.__dict__.update(__pyx_state[10])
10146  */
10147   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10148     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10149     __PYX_ERR(1, 12, __pyx_L1_error)
10150   }
10151   __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
10152   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b, 0);
10153   __pyx_v___pyx_result->_b = __pyx_t_1;
10154   __pyx_t_1.memview = NULL;
10155   __pyx_t_1.data = NULL;
10156   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10157     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10158     __PYX_ERR(1, 12, __pyx_L1_error)
10159   }
10160   __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 1), PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
10161   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_bounds, 0);
10162   __pyx_v___pyx_result->_bounds = __pyx_t_2;
10163   __pyx_t_2.memview = NULL;
10164   __pyx_t_2.data = NULL;
10165   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10166     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10167     __PYX_ERR(1, 12, __pyx_L1_error)
10168   }
10169   __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
10170   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_l, 0);
10171   __pyx_v___pyx_result->_l = __pyx_t_1;
10172   __pyx_t_1.memview = NULL;
10173   __pyx_t_1.data = NULL;
10174   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10175     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10176     __PYX_ERR(1, 12, __pyx_L1_error)
10177   }
10178   __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(PyTuple_GET_ITEM(__pyx_v___pyx_state, 3)); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
10179   __pyx_v___pyx_result->_m = __pyx_t_3;
10180   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10181     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10182     __PYX_ERR(1, 12, __pyx_L1_error)
10183   }
10184   __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
10185   __pyx_v___pyx_result->_n = __pyx_t_3;
10186   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10187     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10188     __PYX_ERR(1, 12, __pyx_L1_error)
10189   }
10190   __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
10191   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_p, 0);
10192   __pyx_v___pyx_result->_p = __pyx_t_1;
10193   __pyx_t_1.memview = NULL;
10194   __pyx_t_1.data = NULL;
10195   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10196     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10197     __PYX_ERR(1, 12, __pyx_L1_error)
10198   }
10199   __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 6), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
10200   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_s, 0);
10201   __pyx_v___pyx_result->_s = __pyx_t_1;
10202   __pyx_t_1.memview = NULL;
10203   __pyx_t_1.data = NULL;
10204   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10205     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10206     __PYX_ERR(1, 12, __pyx_L1_error)
10207   }
10208   __pyx_t_4 = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_v___pyx_state, 7)); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
10209   __pyx_v___pyx_result->_transform = __pyx_t_4;
10210   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10211     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10212     __PYX_ERR(1, 12, __pyx_L1_error)
10213   }
10214   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(PyTuple_GET_ITEM(__pyx_v___pyx_state, 8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
10215   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_xi, 0);
10216   __pyx_v___pyx_result->_xi = __pyx_t_5;
10217   __pyx_t_5.memview = NULL;
10218   __pyx_t_5.data = NULL;
10219   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10220     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10221     __PYX_ERR(1, 12, __pyx_L1_error)
10222   }
10223   __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
10224   __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_y, 0);
10225   __pyx_v___pyx_result->_y = __pyx_t_1;
10226   __pyx_t_1.memview = NULL;
10227   __pyx_t_1.data = NULL;
10228 
10229   /* "(tree fragment)":13
10230  * cdef __pyx_unpickle_HoltWintersArgs__set_state(HoltWintersArgs __pyx_result, tuple __pyx_state):
10231  *     __pyx_result._b = __pyx_state[0]; __pyx_result._bounds = __pyx_state[1]; __pyx_result._l = __pyx_state[2]; __pyx_result._m = __pyx_state[3]; __pyx_result._n = __pyx_state[4]; __pyx_result._p = __pyx_state[5]; __pyx_result._s = __pyx_state[6]; __pyx_result._transform = __pyx_state[7]; __pyx_result._xi = __pyx_state[8]; __pyx_result._y = __pyx_state[9]
10232  *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
10233  *         __pyx_result.__dict__.update(__pyx_state[10])
10234  */
10235   if (unlikely(__pyx_v___pyx_state == Py_None)) {
10236     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
10237     __PYX_ERR(1, 13, __pyx_L1_error)
10238   }
10239   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
10240   __pyx_t_6 = ((__pyx_t_3 > 10) != 0);
10241   if (__pyx_t_6) {
10242   } else {
10243     __pyx_t_4 = __pyx_t_6;
10244     goto __pyx_L4_bool_binop_done;
10245   }
10246   __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
10247   __pyx_t_7 = (__pyx_t_6 != 0);
10248   __pyx_t_4 = __pyx_t_7;
10249   __pyx_L4_bool_binop_done:;
10250   if (__pyx_t_4) {
10251 
10252     /* "(tree fragment)":14
10253  *     __pyx_result._b = __pyx_state[0]; __pyx_result._bounds = __pyx_state[1]; __pyx_result._l = __pyx_state[2]; __pyx_result._m = __pyx_state[3]; __pyx_result._n = __pyx_state[4]; __pyx_result._p = __pyx_state[5]; __pyx_result._s = __pyx_state[6]; __pyx_result._transform = __pyx_state[7]; __pyx_result._xi = __pyx_state[8]; __pyx_result._y = __pyx_state[9]
10254  *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
10255  *         __pyx_result.__dict__.update(__pyx_state[10])             # <<<<<<<<<<<<<<
10256  */
10257     __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
10258     __Pyx_GOTREF(__pyx_t_9);
10259     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
10260     __Pyx_GOTREF(__pyx_t_10);
10261     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10262     if (unlikely(__pyx_v___pyx_state == Py_None)) {
10263       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10264       __PYX_ERR(1, 14, __pyx_L1_error)
10265     }
10266     __pyx_t_9 = NULL;
10267     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
10268       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
10269       if (likely(__pyx_t_9)) {
10270         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
10271         __Pyx_INCREF(__pyx_t_9);
10272         __Pyx_INCREF(function);
10273         __Pyx_DECREF_SET(__pyx_t_10, function);
10274       }
10275     }
10276     __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 10)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, PyTuple_GET_ITEM(__pyx_v___pyx_state, 10));
10277     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10278     if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
10279     __Pyx_GOTREF(__pyx_t_8);
10280     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10281     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10282 
10283     /* "(tree fragment)":13
10284  * cdef __pyx_unpickle_HoltWintersArgs__set_state(HoltWintersArgs __pyx_result, tuple __pyx_state):
10285  *     __pyx_result._b = __pyx_state[0]; __pyx_result._bounds = __pyx_state[1]; __pyx_result._l = __pyx_state[2]; __pyx_result._m = __pyx_state[3]; __pyx_result._n = __pyx_state[4]; __pyx_result._p = __pyx_state[5]; __pyx_result._s = __pyx_state[6]; __pyx_result._transform = __pyx_state[7]; __pyx_result._xi = __pyx_state[8]; __pyx_result._y = __pyx_state[9]
10286  *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
10287  *         __pyx_result.__dict__.update(__pyx_state[10])
10288  */
10289   }
10290 
10291   /* "(tree fragment)":11
10292  *         __pyx_unpickle_HoltWintersArgs__set_state(<HoltWintersArgs> __pyx_result, __pyx_state)
10293  *     return __pyx_result
10294  * cdef __pyx_unpickle_HoltWintersArgs__set_state(HoltWintersArgs __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
10295  *     __pyx_result._b = __pyx_state[0]; __pyx_result._bounds = __pyx_state[1]; __pyx_result._l = __pyx_state[2]; __pyx_result._m = __pyx_state[3]; __pyx_result._n = __pyx_state[4]; __pyx_result._p = __pyx_state[5]; __pyx_result._s = __pyx_state[6]; __pyx_result._transform = __pyx_state[7]; __pyx_result._xi = __pyx_state[8]; __pyx_result._y = __pyx_state[9]
10296  *     if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
10297  */
10298 
10299   /* function exit code */
10300   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10301   goto __pyx_L0;
10302   __pyx_L1_error:;
10303   __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
10304   __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
10305   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
10306   __Pyx_XDECREF(__pyx_t_8);
10307   __Pyx_XDECREF(__pyx_t_9);
10308   __Pyx_XDECREF(__pyx_t_10);
10309   __Pyx_AddTraceback("statsmodels.tsa.holtwinters._exponential_smoothers.__pyx_unpickle_HoltWintersArgs__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
10310   __pyx_r = 0;
10311   __pyx_L0:;
10312   __Pyx_XGIVEREF(__pyx_r);
10313   __Pyx_RefNannyFinishContext();
10314   return __pyx_r;
10315 }
10316 
10317 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":735
10318  * ctypedef npy_cdouble     complex_t
10319  *
10320  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
10321  *     return PyArray_MultiIterNew(1, <void*>a)
10322  *
10323  */
10324 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)10325 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
10326   PyObject *__pyx_r = NULL;
10327   __Pyx_RefNannyDeclarations
10328   PyObject *__pyx_t_1 = NULL;
10329   int __pyx_lineno = 0;
10330   const char *__pyx_filename = NULL;
10331   int __pyx_clineno = 0;
10332   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
10333 
10334   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":736
10335  *
10336  * cdef inline object PyArray_MultiIterNew1(a):
10337  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
10338  *
10339  * cdef inline object PyArray_MultiIterNew2(a, b):
10340  */
10341   __Pyx_XDECREF(__pyx_r);
10342   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
10343   __Pyx_GOTREF(__pyx_t_1);
10344   __pyx_r = __pyx_t_1;
10345   __pyx_t_1 = 0;
10346   goto __pyx_L0;
10347 
10348   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":735
10349  * ctypedef npy_cdouble     complex_t
10350  *
10351  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
10352  *     return PyArray_MultiIterNew(1, <void*>a)
10353  *
10354  */
10355 
10356   /* function exit code */
10357   __pyx_L1_error:;
10358   __Pyx_XDECREF(__pyx_t_1);
10359   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
10360   __pyx_r = 0;
10361   __pyx_L0:;
10362   __Pyx_XGIVEREF(__pyx_r);
10363   __Pyx_RefNannyFinishContext();
10364   return __pyx_r;
10365 }
10366 
10367 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":738
10368  *     return PyArray_MultiIterNew(1, <void*>a)
10369  *
10370  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
10371  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
10372  *
10373  */
10374 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)10375 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
10376   PyObject *__pyx_r = NULL;
10377   __Pyx_RefNannyDeclarations
10378   PyObject *__pyx_t_1 = NULL;
10379   int __pyx_lineno = 0;
10380   const char *__pyx_filename = NULL;
10381   int __pyx_clineno = 0;
10382   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
10383 
10384   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":739
10385  *
10386  * cdef inline object PyArray_MultiIterNew2(a, b):
10387  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
10388  *
10389  * cdef inline object PyArray_MultiIterNew3(a, b, c):
10390  */
10391   __Pyx_XDECREF(__pyx_r);
10392   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
10393   __Pyx_GOTREF(__pyx_t_1);
10394   __pyx_r = __pyx_t_1;
10395   __pyx_t_1 = 0;
10396   goto __pyx_L0;
10397 
10398   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":738
10399  *     return PyArray_MultiIterNew(1, <void*>a)
10400  *
10401  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
10402  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
10403  *
10404  */
10405 
10406   /* function exit code */
10407   __pyx_L1_error:;
10408   __Pyx_XDECREF(__pyx_t_1);
10409   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
10410   __pyx_r = 0;
10411   __pyx_L0:;
10412   __Pyx_XGIVEREF(__pyx_r);
10413   __Pyx_RefNannyFinishContext();
10414   return __pyx_r;
10415 }
10416 
10417 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":741
10418  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
10419  *
10420  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
10421  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
10422  *
10423  */
10424 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)10425 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
10426   PyObject *__pyx_r = NULL;
10427   __Pyx_RefNannyDeclarations
10428   PyObject *__pyx_t_1 = NULL;
10429   int __pyx_lineno = 0;
10430   const char *__pyx_filename = NULL;
10431   int __pyx_clineno = 0;
10432   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
10433 
10434   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":742
10435  *
10436  * cdef inline object PyArray_MultiIterNew3(a, b, c):
10437  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
10438  *
10439  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
10440  */
10441   __Pyx_XDECREF(__pyx_r);
10442   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
10443   __Pyx_GOTREF(__pyx_t_1);
10444   __pyx_r = __pyx_t_1;
10445   __pyx_t_1 = 0;
10446   goto __pyx_L0;
10447 
10448   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":741
10449  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
10450  *
10451  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
10452  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
10453  *
10454  */
10455 
10456   /* function exit code */
10457   __pyx_L1_error:;
10458   __Pyx_XDECREF(__pyx_t_1);
10459   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
10460   __pyx_r = 0;
10461   __pyx_L0:;
10462   __Pyx_XGIVEREF(__pyx_r);
10463   __Pyx_RefNannyFinishContext();
10464   return __pyx_r;
10465 }
10466 
10467 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":744
10468  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
10469  *
10470  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
10471  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
10472  *
10473  */
10474 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)10475 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
10476   PyObject *__pyx_r = NULL;
10477   __Pyx_RefNannyDeclarations
10478   PyObject *__pyx_t_1 = NULL;
10479   int __pyx_lineno = 0;
10480   const char *__pyx_filename = NULL;
10481   int __pyx_clineno = 0;
10482   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
10483 
10484   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":745
10485  *
10486  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
10487  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
10488  *
10489  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
10490  */
10491   __Pyx_XDECREF(__pyx_r);
10492   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
10493   __Pyx_GOTREF(__pyx_t_1);
10494   __pyx_r = __pyx_t_1;
10495   __pyx_t_1 = 0;
10496   goto __pyx_L0;
10497 
10498   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":744
10499  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
10500  *
10501  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
10502  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
10503  *
10504  */
10505 
10506   /* function exit code */
10507   __pyx_L1_error:;
10508   __Pyx_XDECREF(__pyx_t_1);
10509   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
10510   __pyx_r = 0;
10511   __pyx_L0:;
10512   __Pyx_XGIVEREF(__pyx_r);
10513   __Pyx_RefNannyFinishContext();
10514   return __pyx_r;
10515 }
10516 
10517 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":747
10518  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
10519  *
10520  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
10521  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
10522  *
10523  */
10524 
__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d,PyObject * __pyx_v_e)10525 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
10526   PyObject *__pyx_r = NULL;
10527   __Pyx_RefNannyDeclarations
10528   PyObject *__pyx_t_1 = NULL;
10529   int __pyx_lineno = 0;
10530   const char *__pyx_filename = NULL;
10531   int __pyx_clineno = 0;
10532   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
10533 
10534   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":748
10535  *
10536  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
10537  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
10538  *
10539  * cdef inline tuple PyDataType_SHAPE(dtype d):
10540  */
10541   __Pyx_XDECREF(__pyx_r);
10542   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
10543   __Pyx_GOTREF(__pyx_t_1);
10544   __pyx_r = __pyx_t_1;
10545   __pyx_t_1 = 0;
10546   goto __pyx_L0;
10547 
10548   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":747
10549  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
10550  *
10551  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
10552  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
10553  *
10554  */
10555 
10556   /* function exit code */
10557   __pyx_L1_error:;
10558   __Pyx_XDECREF(__pyx_t_1);
10559   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
10560   __pyx_r = 0;
10561   __pyx_L0:;
10562   __Pyx_XGIVEREF(__pyx_r);
10563   __Pyx_RefNannyFinishContext();
10564   return __pyx_r;
10565 }
10566 
10567 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":750
10568  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
10569  *
10570  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
10571  *     if PyDataType_HASSUBARRAY(d):
10572  *         return <tuple>d.subarray.shape
10573  */
10574 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)10575 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
10576   PyObject *__pyx_r = NULL;
10577   __Pyx_RefNannyDeclarations
10578   int __pyx_t_1;
10579   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
10580 
10581   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":751
10582  *
10583  * cdef inline tuple PyDataType_SHAPE(dtype d):
10584  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
10585  *         return <tuple>d.subarray.shape
10586  *     else:
10587  */
10588   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
10589   if (__pyx_t_1) {
10590 
10591     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":752
10592  * cdef inline tuple PyDataType_SHAPE(dtype d):
10593  *     if PyDataType_HASSUBARRAY(d):
10594  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
10595  *     else:
10596  *         return ()
10597  */
10598     __Pyx_XDECREF(__pyx_r);
10599     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
10600     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
10601     goto __pyx_L0;
10602 
10603     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":751
10604  *
10605  * cdef inline tuple PyDataType_SHAPE(dtype d):
10606  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
10607  *         return <tuple>d.subarray.shape
10608  *     else:
10609  */
10610   }
10611 
10612   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":754
10613  *         return <tuple>d.subarray.shape
10614  *     else:
10615  *         return ()             # <<<<<<<<<<<<<<
10616  *
10617  *
10618  */
10619   /*else*/ {
10620     __Pyx_XDECREF(__pyx_r);
10621     __Pyx_INCREF(__pyx_empty_tuple);
10622     __pyx_r = __pyx_empty_tuple;
10623     goto __pyx_L0;
10624   }
10625 
10626   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":750
10627  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
10628  *
10629  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
10630  *     if PyDataType_HASSUBARRAY(d):
10631  *         return <tuple>d.subarray.shape
10632  */
10633 
10634   /* function exit code */
10635   __pyx_L0:;
10636   __Pyx_XGIVEREF(__pyx_r);
10637   __Pyx_RefNannyFinishContext();
10638   return __pyx_r;
10639 }
10640 
10641 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":929
10642  *     int _import_umath() except -1
10643  *
10644  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
10645  *     Py_INCREF(base) # important to do this before stealing the reference below!
10646  *     PyArray_SetBaseObject(arr, base)
10647  */
10648 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)10649 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
10650   __Pyx_RefNannyDeclarations
10651   __Pyx_RefNannySetupContext("set_array_base", 0);
10652 
10653   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":930
10654  *
10655  * cdef inline void set_array_base(ndarray arr, object base):
10656  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
10657  *     PyArray_SetBaseObject(arr, base)
10658  *
10659  */
10660   Py_INCREF(__pyx_v_base);
10661 
10662   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":931
10663  * cdef inline void set_array_base(ndarray arr, object base):
10664  *     Py_INCREF(base) # important to do this before stealing the reference below!
10665  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
10666  *
10667  * cdef inline object get_array_base(ndarray arr):
10668  */
10669   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
10670 
10671   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":929
10672  *     int _import_umath() except -1
10673  *
10674  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
10675  *     Py_INCREF(base) # important to do this before stealing the reference below!
10676  *     PyArray_SetBaseObject(arr, base)
10677  */
10678 
10679   /* function exit code */
10680   __Pyx_RefNannyFinishContext();
10681 }
10682 
10683 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":933
10684  *     PyArray_SetBaseObject(arr, base)
10685  *
10686  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
10687  *     base = PyArray_BASE(arr)
10688  *     if base is NULL:
10689  */
10690 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)10691 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
10692   PyObject *__pyx_v_base;
10693   PyObject *__pyx_r = NULL;
10694   __Pyx_RefNannyDeclarations
10695   int __pyx_t_1;
10696   __Pyx_RefNannySetupContext("get_array_base", 0);
10697 
10698   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":934
10699  *
10700  * cdef inline object get_array_base(ndarray arr):
10701  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
10702  *     if base is NULL:
10703  *         return None
10704  */
10705   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
10706 
10707   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":935
10708  * cdef inline object get_array_base(ndarray arr):
10709  *     base = PyArray_BASE(arr)
10710  *     if base is NULL:             # <<<<<<<<<<<<<<
10711  *         return None
10712  *     return <object>base
10713  */
10714   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
10715   if (__pyx_t_1) {
10716 
10717     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":936
10718  *     base = PyArray_BASE(arr)
10719  *     if base is NULL:
10720  *         return None             # <<<<<<<<<<<<<<
10721  *     return <object>base
10722  *
10723  */
10724     __Pyx_XDECREF(__pyx_r);
10725     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10726     goto __pyx_L0;
10727 
10728     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":935
10729  * cdef inline object get_array_base(ndarray arr):
10730  *     base = PyArray_BASE(arr)
10731  *     if base is NULL:             # <<<<<<<<<<<<<<
10732  *         return None
10733  *     return <object>base
10734  */
10735   }
10736 
10737   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":937
10738  *     if base is NULL:
10739  *         return None
10740  *     return <object>base             # <<<<<<<<<<<<<<
10741  *
10742  * # Versions of the import_* functions which are more suitable for
10743  */
10744   __Pyx_XDECREF(__pyx_r);
10745   __Pyx_INCREF(((PyObject *)__pyx_v_base));
10746   __pyx_r = ((PyObject *)__pyx_v_base);
10747   goto __pyx_L0;
10748 
10749   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":933
10750  *     PyArray_SetBaseObject(arr, base)
10751  *
10752  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
10753  *     base = PyArray_BASE(arr)
10754  *     if base is NULL:
10755  */
10756 
10757   /* function exit code */
10758   __pyx_L0:;
10759   __Pyx_XGIVEREF(__pyx_r);
10760   __Pyx_RefNannyFinishContext();
10761   return __pyx_r;
10762 }
10763 
10764 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":941
10765  * # Versions of the import_* functions which are more suitable for
10766  * # Cython code.
10767  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
10768  *     try:
10769  *         __pyx_import_array()
10770  */
10771 
__pyx_f_5numpy_import_array(void)10772 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
10773   int __pyx_r;
10774   __Pyx_RefNannyDeclarations
10775   PyObject *__pyx_t_1 = NULL;
10776   PyObject *__pyx_t_2 = NULL;
10777   PyObject *__pyx_t_3 = NULL;
10778   int __pyx_t_4;
10779   PyObject *__pyx_t_5 = NULL;
10780   PyObject *__pyx_t_6 = NULL;
10781   PyObject *__pyx_t_7 = NULL;
10782   PyObject *__pyx_t_8 = NULL;
10783   int __pyx_lineno = 0;
10784   const char *__pyx_filename = NULL;
10785   int __pyx_clineno = 0;
10786   __Pyx_RefNannySetupContext("import_array", 0);
10787 
10788   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":942
10789  * # Cython code.
10790  * cdef inline int import_array() except -1:
10791  *     try:             # <<<<<<<<<<<<<<
10792  *         __pyx_import_array()
10793  *     except Exception:
10794  */
10795   {
10796     __Pyx_PyThreadState_declare
10797     __Pyx_PyThreadState_assign
10798     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10799     __Pyx_XGOTREF(__pyx_t_1);
10800     __Pyx_XGOTREF(__pyx_t_2);
10801     __Pyx_XGOTREF(__pyx_t_3);
10802     /*try:*/ {
10803 
10804       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":943
10805  * cdef inline int import_array() except -1:
10806  *     try:
10807  *         __pyx_import_array()             # <<<<<<<<<<<<<<
10808  *     except Exception:
10809  *         raise ImportError("numpy.core.multiarray failed to import")
10810  */
10811       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
10812 
10813       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":942
10814  * # Cython code.
10815  * cdef inline int import_array() except -1:
10816  *     try:             # <<<<<<<<<<<<<<
10817  *         __pyx_import_array()
10818  *     except Exception:
10819  */
10820     }
10821     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10822     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10823     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10824     goto __pyx_L8_try_end;
10825     __pyx_L3_error:;
10826 
10827     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":944
10828  *     try:
10829  *         __pyx_import_array()
10830  *     except Exception:             # <<<<<<<<<<<<<<
10831  *         raise ImportError("numpy.core.multiarray failed to import")
10832  *
10833  */
10834     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
10835     if (__pyx_t_4) {
10836       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
10837       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
10838       __Pyx_GOTREF(__pyx_t_5);
10839       __Pyx_GOTREF(__pyx_t_6);
10840       __Pyx_GOTREF(__pyx_t_7);
10841 
10842       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":945
10843  *         __pyx_import_array()
10844  *     except Exception:
10845  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
10846  *
10847  * cdef inline int import_umath() except -1:
10848  */
10849       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
10850       __Pyx_GOTREF(__pyx_t_8);
10851       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
10852       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10853       __PYX_ERR(2, 945, __pyx_L5_except_error)
10854     }
10855     goto __pyx_L5_except_error;
10856     __pyx_L5_except_error:;
10857 
10858     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":942
10859  * # Cython code.
10860  * cdef inline int import_array() except -1:
10861  *     try:             # <<<<<<<<<<<<<<
10862  *         __pyx_import_array()
10863  *     except Exception:
10864  */
10865     __Pyx_XGIVEREF(__pyx_t_1);
10866     __Pyx_XGIVEREF(__pyx_t_2);
10867     __Pyx_XGIVEREF(__pyx_t_3);
10868     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
10869     goto __pyx_L1_error;
10870     __pyx_L8_try_end:;
10871   }
10872 
10873   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":941
10874  * # Versions of the import_* functions which are more suitable for
10875  * # Cython code.
10876  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
10877  *     try:
10878  *         __pyx_import_array()
10879  */
10880 
10881   /* function exit code */
10882   __pyx_r = 0;
10883   goto __pyx_L0;
10884   __pyx_L1_error:;
10885   __Pyx_XDECREF(__pyx_t_5);
10886   __Pyx_XDECREF(__pyx_t_6);
10887   __Pyx_XDECREF(__pyx_t_7);
10888   __Pyx_XDECREF(__pyx_t_8);
10889   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
10890   __pyx_r = -1;
10891   __pyx_L0:;
10892   __Pyx_RefNannyFinishContext();
10893   return __pyx_r;
10894 }
10895 
10896 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":947
10897  *         raise ImportError("numpy.core.multiarray failed to import")
10898  *
10899  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
10900  *     try:
10901  *         _import_umath()
10902  */
10903 
__pyx_f_5numpy_import_umath(void)10904 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
10905   int __pyx_r;
10906   __Pyx_RefNannyDeclarations
10907   PyObject *__pyx_t_1 = NULL;
10908   PyObject *__pyx_t_2 = NULL;
10909   PyObject *__pyx_t_3 = NULL;
10910   int __pyx_t_4;
10911   PyObject *__pyx_t_5 = NULL;
10912   PyObject *__pyx_t_6 = NULL;
10913   PyObject *__pyx_t_7 = NULL;
10914   PyObject *__pyx_t_8 = NULL;
10915   int __pyx_lineno = 0;
10916   const char *__pyx_filename = NULL;
10917   int __pyx_clineno = 0;
10918   __Pyx_RefNannySetupContext("import_umath", 0);
10919 
10920   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":948
10921  *
10922  * cdef inline int import_umath() except -1:
10923  *     try:             # <<<<<<<<<<<<<<
10924  *         _import_umath()
10925  *     except Exception:
10926  */
10927   {
10928     __Pyx_PyThreadState_declare
10929     __Pyx_PyThreadState_assign
10930     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10931     __Pyx_XGOTREF(__pyx_t_1);
10932     __Pyx_XGOTREF(__pyx_t_2);
10933     __Pyx_XGOTREF(__pyx_t_3);
10934     /*try:*/ {
10935 
10936       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":949
10937  * cdef inline int import_umath() except -1:
10938  *     try:
10939  *         _import_umath()             # <<<<<<<<<<<<<<
10940  *     except Exception:
10941  *         raise ImportError("numpy.core.umath failed to import")
10942  */
10943       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
10944 
10945       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":948
10946  *
10947  * cdef inline int import_umath() except -1:
10948  *     try:             # <<<<<<<<<<<<<<
10949  *         _import_umath()
10950  *     except Exception:
10951  */
10952     }
10953     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10954     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10955     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10956     goto __pyx_L8_try_end;
10957     __pyx_L3_error:;
10958 
10959     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":950
10960  *     try:
10961  *         _import_umath()
10962  *     except Exception:             # <<<<<<<<<<<<<<
10963  *         raise ImportError("numpy.core.umath failed to import")
10964  *
10965  */
10966     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
10967     if (__pyx_t_4) {
10968       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
10969       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
10970       __Pyx_GOTREF(__pyx_t_5);
10971       __Pyx_GOTREF(__pyx_t_6);
10972       __Pyx_GOTREF(__pyx_t_7);
10973 
10974       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":951
10975  *         _import_umath()
10976  *     except Exception:
10977  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
10978  *
10979  * cdef inline int import_ufunc() except -1:
10980  */
10981       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
10982       __Pyx_GOTREF(__pyx_t_8);
10983       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
10984       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10985       __PYX_ERR(2, 951, __pyx_L5_except_error)
10986     }
10987     goto __pyx_L5_except_error;
10988     __pyx_L5_except_error:;
10989 
10990     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":948
10991  *
10992  * cdef inline int import_umath() except -1:
10993  *     try:             # <<<<<<<<<<<<<<
10994  *         _import_umath()
10995  *     except Exception:
10996  */
10997     __Pyx_XGIVEREF(__pyx_t_1);
10998     __Pyx_XGIVEREF(__pyx_t_2);
10999     __Pyx_XGIVEREF(__pyx_t_3);
11000     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
11001     goto __pyx_L1_error;
11002     __pyx_L8_try_end:;
11003   }
11004 
11005   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":947
11006  *         raise ImportError("numpy.core.multiarray failed to import")
11007  *
11008  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
11009  *     try:
11010  *         _import_umath()
11011  */
11012 
11013   /* function exit code */
11014   __pyx_r = 0;
11015   goto __pyx_L0;
11016   __pyx_L1_error:;
11017   __Pyx_XDECREF(__pyx_t_5);
11018   __Pyx_XDECREF(__pyx_t_6);
11019   __Pyx_XDECREF(__pyx_t_7);
11020   __Pyx_XDECREF(__pyx_t_8);
11021   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
11022   __pyx_r = -1;
11023   __pyx_L0:;
11024   __Pyx_RefNannyFinishContext();
11025   return __pyx_r;
11026 }
11027 
11028 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":953
11029  *         raise ImportError("numpy.core.umath failed to import")
11030  *
11031  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
11032  *     try:
11033  *         _import_umath()
11034  */
11035 
__pyx_f_5numpy_import_ufunc(void)11036 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
11037   int __pyx_r;
11038   __Pyx_RefNannyDeclarations
11039   PyObject *__pyx_t_1 = NULL;
11040   PyObject *__pyx_t_2 = NULL;
11041   PyObject *__pyx_t_3 = NULL;
11042   int __pyx_t_4;
11043   PyObject *__pyx_t_5 = NULL;
11044   PyObject *__pyx_t_6 = NULL;
11045   PyObject *__pyx_t_7 = NULL;
11046   PyObject *__pyx_t_8 = NULL;
11047   int __pyx_lineno = 0;
11048   const char *__pyx_filename = NULL;
11049   int __pyx_clineno = 0;
11050   __Pyx_RefNannySetupContext("import_ufunc", 0);
11051 
11052   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":954
11053  *
11054  * cdef inline int import_ufunc() except -1:
11055  *     try:             # <<<<<<<<<<<<<<
11056  *         _import_umath()
11057  *     except Exception:
11058  */
11059   {
11060     __Pyx_PyThreadState_declare
11061     __Pyx_PyThreadState_assign
11062     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
11063     __Pyx_XGOTREF(__pyx_t_1);
11064     __Pyx_XGOTREF(__pyx_t_2);
11065     __Pyx_XGOTREF(__pyx_t_3);
11066     /*try:*/ {
11067 
11068       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":955
11069  * cdef inline int import_ufunc() except -1:
11070  *     try:
11071  *         _import_umath()             # <<<<<<<<<<<<<<
11072  *     except Exception:
11073  *         raise ImportError("numpy.core.umath failed to import")
11074  */
11075       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
11076 
11077       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":954
11078  *
11079  * cdef inline int import_ufunc() except -1:
11080  *     try:             # <<<<<<<<<<<<<<
11081  *         _import_umath()
11082  *     except Exception:
11083  */
11084     }
11085     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11086     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11087     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11088     goto __pyx_L8_try_end;
11089     __pyx_L3_error:;
11090 
11091     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":956
11092  *     try:
11093  *         _import_umath()
11094  *     except Exception:             # <<<<<<<<<<<<<<
11095  *         raise ImportError("numpy.core.umath failed to import")
11096  *
11097  */
11098     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
11099     if (__pyx_t_4) {
11100       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
11101       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
11102       __Pyx_GOTREF(__pyx_t_5);
11103       __Pyx_GOTREF(__pyx_t_6);
11104       __Pyx_GOTREF(__pyx_t_7);
11105 
11106       /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":957
11107  *         _import_umath()
11108  *     except Exception:
11109  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
11110  *
11111  * cdef extern from *:
11112  */
11113       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
11114       __Pyx_GOTREF(__pyx_t_8);
11115       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
11116       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11117       __PYX_ERR(2, 957, __pyx_L5_except_error)
11118     }
11119     goto __pyx_L5_except_error;
11120     __pyx_L5_except_error:;
11121 
11122     /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":954
11123  *
11124  * cdef inline int import_ufunc() except -1:
11125  *     try:             # <<<<<<<<<<<<<<
11126  *         _import_umath()
11127  *     except Exception:
11128  */
11129     __Pyx_XGIVEREF(__pyx_t_1);
11130     __Pyx_XGIVEREF(__pyx_t_2);
11131     __Pyx_XGIVEREF(__pyx_t_3);
11132     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
11133     goto __pyx_L1_error;
11134     __pyx_L8_try_end:;
11135   }
11136 
11137   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":953
11138  *         raise ImportError("numpy.core.umath failed to import")
11139  *
11140  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
11141  *     try:
11142  *         _import_umath()
11143  */
11144 
11145   /* function exit code */
11146   __pyx_r = 0;
11147   goto __pyx_L0;
11148   __pyx_L1_error:;
11149   __Pyx_XDECREF(__pyx_t_5);
11150   __Pyx_XDECREF(__pyx_t_6);
11151   __Pyx_XDECREF(__pyx_t_7);
11152   __Pyx_XDECREF(__pyx_t_8);
11153   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
11154   __pyx_r = -1;
11155   __pyx_L0:;
11156   __Pyx_RefNannyFinishContext();
11157   return __pyx_r;
11158 }
11159 
11160 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":967
11161  *
11162  *
11163  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
11164  *     """
11165  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
11166  */
11167 
__pyx_f_5numpy_is_timedelta64_object(PyObject * __pyx_v_obj)11168 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
11169   int __pyx_r;
11170   __Pyx_RefNannyDeclarations
11171   __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
11172 
11173   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":979
11174  *     bool
11175  *     """
11176  *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
11177  *
11178  *
11179  */
11180   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
11181   goto __pyx_L0;
11182 
11183   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":967
11184  *
11185  *
11186  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
11187  *     """
11188  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
11189  */
11190 
11191   /* function exit code */
11192   __pyx_L0:;
11193   __Pyx_RefNannyFinishContext();
11194   return __pyx_r;
11195 }
11196 
11197 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":982
11198  *
11199  *
11200  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
11201  *     """
11202  *     Cython equivalent of `isinstance(obj, np.datetime64)`
11203  */
11204 
__pyx_f_5numpy_is_datetime64_object(PyObject * __pyx_v_obj)11205 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
11206   int __pyx_r;
11207   __Pyx_RefNannyDeclarations
11208   __Pyx_RefNannySetupContext("is_datetime64_object", 0);
11209 
11210   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":994
11211  *     bool
11212  *     """
11213  *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
11214  *
11215  *
11216  */
11217   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
11218   goto __pyx_L0;
11219 
11220   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":982
11221  *
11222  *
11223  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
11224  *     """
11225  *     Cython equivalent of `isinstance(obj, np.datetime64)`
11226  */
11227 
11228   /* function exit code */
11229   __pyx_L0:;
11230   __Pyx_RefNannyFinishContext();
11231   return __pyx_r;
11232 }
11233 
11234 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":997
11235  *
11236  *
11237  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
11238  *     """
11239  *     returns the int64 value underlying scalar numpy datetime64 object
11240  */
11241 
__pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_v_obj)11242 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
11243   npy_datetime __pyx_r;
11244 
11245   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":1004
11246  *     also needed.  That can be found using `get_datetime64_unit`.
11247  *     """
11248  *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
11249  *
11250  *
11251  */
11252   __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
11253   goto __pyx_L0;
11254 
11255   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":997
11256  *
11257  *
11258  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
11259  *     """
11260  *     returns the int64 value underlying scalar numpy datetime64 object
11261  */
11262 
11263   /* function exit code */
11264   __pyx_L0:;
11265   return __pyx_r;
11266 }
11267 
11268 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":1007
11269  *
11270  *
11271  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
11272  *     """
11273  *     returns the int64 value underlying scalar numpy timedelta64 object
11274  */
11275 
__pyx_f_5numpy_get_timedelta64_value(PyObject * __pyx_v_obj)11276 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
11277   npy_timedelta __pyx_r;
11278 
11279   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":1011
11280  *     returns the int64 value underlying scalar numpy timedelta64 object
11281  *     """
11282  *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
11283  *
11284  *
11285  */
11286   __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
11287   goto __pyx_L0;
11288 
11289   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":1007
11290  *
11291  *
11292  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
11293  *     """
11294  *     returns the int64 value underlying scalar numpy timedelta64 object
11295  */
11296 
11297   /* function exit code */
11298   __pyx_L0:;
11299   return __pyx_r;
11300 }
11301 
11302 /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":1014
11303  *
11304  *
11305  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
11306  *     """
11307  *     returns the unit part of the dtype for a numpy datetime64 object.
11308  */
11309 
__pyx_f_5numpy_get_datetime64_unit(PyObject * __pyx_v_obj)11310 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
11311   NPY_DATETIMEUNIT __pyx_r;
11312 
11313   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":1018
11314  *     returns the unit part of the dtype for a numpy datetime64 object.
11315  *     """
11316  *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
11317  */
11318   __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
11319   goto __pyx_L0;
11320 
11321   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":1014
11322  *
11323  *
11324  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
11325  *     """
11326  *     returns the unit part of the dtype for a numpy datetime64 object.
11327  */
11328 
11329   /* function exit code */
11330   __pyx_L0:;
11331   return __pyx_r;
11332 }
11333 
11334 /* "View.MemoryView":122
11335  *         cdef bint dtype_is_object
11336  *
11337  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
11338  *                   mode="c", bint allocate_buffer=True):
11339  *
11340  */
11341 
11342 /* Python wrapper */
11343 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_array___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11344 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11345   PyObject *__pyx_v_shape = 0;
11346   Py_ssize_t __pyx_v_itemsize;
11347   PyObject *__pyx_v_format = 0;
11348   PyObject *__pyx_v_mode = 0;
11349   int __pyx_v_allocate_buffer;
11350   int __pyx_lineno = 0;
11351   const char *__pyx_filename = NULL;
11352   int __pyx_clineno = 0;
11353   int __pyx_r;
11354   __Pyx_RefNannyDeclarations
11355   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
11356   {
11357     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
11358     PyObject* values[5] = {0,0,0,0,0};
11359     values[3] = ((PyObject *)__pyx_n_s_c);
11360     if (unlikely(__pyx_kwds)) {
11361       Py_ssize_t kw_args;
11362       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11363       switch (pos_args) {
11364         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11365         CYTHON_FALLTHROUGH;
11366         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11367         CYTHON_FALLTHROUGH;
11368         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11369         CYTHON_FALLTHROUGH;
11370         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11371         CYTHON_FALLTHROUGH;
11372         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11373         CYTHON_FALLTHROUGH;
11374         case  0: break;
11375         default: goto __pyx_L5_argtuple_error;
11376       }
11377       kw_args = PyDict_Size(__pyx_kwds);
11378       switch (pos_args) {
11379         case  0:
11380         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
11381         else goto __pyx_L5_argtuple_error;
11382         CYTHON_FALLTHROUGH;
11383         case  1:
11384         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
11385         else {
11386           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
11387         }
11388         CYTHON_FALLTHROUGH;
11389         case  2:
11390         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
11391         else {
11392           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
11393         }
11394         CYTHON_FALLTHROUGH;
11395         case  3:
11396         if (kw_args > 0) {
11397           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
11398           if (value) { values[3] = value; kw_args--; }
11399         }
11400         CYTHON_FALLTHROUGH;
11401         case  4:
11402         if (kw_args > 0) {
11403           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
11404           if (value) { values[4] = value; kw_args--; }
11405         }
11406       }
11407       if (unlikely(kw_args > 0)) {
11408         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
11409       }
11410     } else {
11411       switch (PyTuple_GET_SIZE(__pyx_args)) {
11412         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11413         CYTHON_FALLTHROUGH;
11414         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11415         CYTHON_FALLTHROUGH;
11416         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11417         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11418         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11419         break;
11420         default: goto __pyx_L5_argtuple_error;
11421       }
11422     }
11423     __pyx_v_shape = ((PyObject*)values[0]);
11424     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
11425     __pyx_v_format = values[2];
11426     __pyx_v_mode = values[3];
11427     if (values[4]) {
11428       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
11429     } else {
11430 
11431       /* "View.MemoryView":123
11432  *
11433  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
11434  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
11435  *
11436  *         cdef int idx
11437  */
11438       __pyx_v_allocate_buffer = ((int)1);
11439     }
11440   }
11441   goto __pyx_L4_argument_unpacking_done;
11442   __pyx_L5_argtuple_error:;
11443   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
11444   __pyx_L3_error:;
11445   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11446   __Pyx_RefNannyFinishContext();
11447   return -1;
11448   __pyx_L4_argument_unpacking_done:;
11449   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
11450   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
11451     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
11452   }
11453   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
11454 
11455   /* "View.MemoryView":122
11456  *         cdef bint dtype_is_object
11457  *
11458  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
11459  *                   mode="c", bint allocate_buffer=True):
11460  *
11461  */
11462 
11463   /* function exit code */
11464   goto __pyx_L0;
11465   __pyx_L1_error:;
11466   __pyx_r = -1;
11467   __pyx_L0:;
11468   __Pyx_RefNannyFinishContext();
11469   return __pyx_r;
11470 }
11471 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,PyObject * __pyx_v_format,PyObject * __pyx_v_mode,int __pyx_v_allocate_buffer)11472 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
11473   int __pyx_v_idx;
11474   Py_ssize_t __pyx_v_i;
11475   Py_ssize_t __pyx_v_dim;
11476   PyObject **__pyx_v_p;
11477   char __pyx_v_order;
11478   int __pyx_r;
11479   __Pyx_RefNannyDeclarations
11480   Py_ssize_t __pyx_t_1;
11481   int __pyx_t_2;
11482   PyObject *__pyx_t_3 = NULL;
11483   int __pyx_t_4;
11484   PyObject *__pyx_t_5 = NULL;
11485   PyObject *__pyx_t_6 = NULL;
11486   char *__pyx_t_7;
11487   int __pyx_t_8;
11488   Py_ssize_t __pyx_t_9;
11489   PyObject *__pyx_t_10 = NULL;
11490   Py_ssize_t __pyx_t_11;
11491   int __pyx_lineno = 0;
11492   const char *__pyx_filename = NULL;
11493   int __pyx_clineno = 0;
11494   __Pyx_RefNannySetupContext("__cinit__", 0);
11495   __Pyx_INCREF(__pyx_v_format);
11496 
11497   /* "View.MemoryView":129
11498  *         cdef PyObject **p
11499  *
11500  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
11501  *         self.itemsize = itemsize
11502  *
11503  */
11504   if (unlikely(__pyx_v_shape == Py_None)) {
11505     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
11506     __PYX_ERR(1, 129, __pyx_L1_error)
11507   }
11508   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
11509   __pyx_v_self->ndim = ((int)__pyx_t_1);
11510 
11511   /* "View.MemoryView":130
11512  *
11513  *         self.ndim = <int> len(shape)
11514  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
11515  *
11516  *         if not self.ndim:
11517  */
11518   __pyx_v_self->itemsize = __pyx_v_itemsize;
11519 
11520   /* "View.MemoryView":132
11521  *         self.itemsize = itemsize
11522  *
11523  *         if not self.ndim:             # <<<<<<<<<<<<<<
11524  *             raise ValueError("Empty shape tuple for cython.array")
11525  *
11526  */
11527   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
11528   if (unlikely(__pyx_t_2)) {
11529 
11530     /* "View.MemoryView":133
11531  *
11532  *         if not self.ndim:
11533  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
11534  *
11535  *         if itemsize <= 0:
11536  */
11537     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
11538     __Pyx_GOTREF(__pyx_t_3);
11539     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11540     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11541     __PYX_ERR(1, 133, __pyx_L1_error)
11542 
11543     /* "View.MemoryView":132
11544  *         self.itemsize = itemsize
11545  *
11546  *         if not self.ndim:             # <<<<<<<<<<<<<<
11547  *             raise ValueError("Empty shape tuple for cython.array")
11548  *
11549  */
11550   }
11551 
11552   /* "View.MemoryView":135
11553  *             raise ValueError("Empty shape tuple for cython.array")
11554  *
11555  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
11556  *             raise ValueError("itemsize <= 0 for cython.array")
11557  *
11558  */
11559   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
11560   if (unlikely(__pyx_t_2)) {
11561 
11562     /* "View.MemoryView":136
11563  *
11564  *         if itemsize <= 0:
11565  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
11566  *
11567  *         if not isinstance(format, bytes):
11568  */
11569     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
11570     __Pyx_GOTREF(__pyx_t_3);
11571     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11572     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11573     __PYX_ERR(1, 136, __pyx_L1_error)
11574 
11575     /* "View.MemoryView":135
11576  *             raise ValueError("Empty shape tuple for cython.array")
11577  *
11578  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
11579  *             raise ValueError("itemsize <= 0 for cython.array")
11580  *
11581  */
11582   }
11583 
11584   /* "View.MemoryView":138
11585  *             raise ValueError("itemsize <= 0 for cython.array")
11586  *
11587  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
11588  *             format = format.encode('ASCII')
11589  *         self._format = format  # keep a reference to the byte string
11590  */
11591   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
11592   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
11593   if (__pyx_t_4) {
11594 
11595     /* "View.MemoryView":139
11596  *
11597  *         if not isinstance(format, bytes):
11598  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
11599  *         self._format = format  # keep a reference to the byte string
11600  *         self.format = self._format
11601  */
11602     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
11603     __Pyx_GOTREF(__pyx_t_5);
11604     __pyx_t_6 = NULL;
11605     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11606       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
11607       if (likely(__pyx_t_6)) {
11608         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11609         __Pyx_INCREF(__pyx_t_6);
11610         __Pyx_INCREF(function);
11611         __Pyx_DECREF_SET(__pyx_t_5, function);
11612       }
11613     }
11614     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
11615     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11616     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
11617     __Pyx_GOTREF(__pyx_t_3);
11618     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11619     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
11620     __pyx_t_3 = 0;
11621 
11622     /* "View.MemoryView":138
11623  *             raise ValueError("itemsize <= 0 for cython.array")
11624  *
11625  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
11626  *             format = format.encode('ASCII')
11627  *         self._format = format  # keep a reference to the byte string
11628  */
11629   }
11630 
11631   /* "View.MemoryView":140
11632  *         if not isinstance(format, bytes):
11633  *             format = format.encode('ASCII')
11634  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
11635  *         self.format = self._format
11636  *
11637  */
11638   if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
11639   __pyx_t_3 = __pyx_v_format;
11640   __Pyx_INCREF(__pyx_t_3);
11641   __Pyx_GIVEREF(__pyx_t_3);
11642   __Pyx_GOTREF(__pyx_v_self->_format);
11643   __Pyx_DECREF(__pyx_v_self->_format);
11644   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
11645   __pyx_t_3 = 0;
11646 
11647   /* "View.MemoryView":141
11648  *             format = format.encode('ASCII')
11649  *         self._format = format  # keep a reference to the byte string
11650  *         self.format = self._format             # <<<<<<<<<<<<<<
11651  *
11652  *
11653  */
11654   if (unlikely(__pyx_v_self->_format == Py_None)) {
11655     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
11656     __PYX_ERR(1, 141, __pyx_L1_error)
11657   }
11658   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
11659   __pyx_v_self->format = __pyx_t_7;
11660 
11661   /* "View.MemoryView":144
11662  *
11663  *
11664  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
11665  *         self._strides = self._shape + self.ndim
11666  *
11667  */
11668   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
11669 
11670   /* "View.MemoryView":145
11671  *
11672  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
11673  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
11674  *
11675  *         if not self._shape:
11676  */
11677   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
11678 
11679   /* "View.MemoryView":147
11680  *         self._strides = self._shape + self.ndim
11681  *
11682  *         if not self._shape:             # <<<<<<<<<<<<<<
11683  *             raise MemoryError("unable to allocate shape and strides.")
11684  *
11685  */
11686   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
11687   if (unlikely(__pyx_t_4)) {
11688 
11689     /* "View.MemoryView":148
11690  *
11691  *         if not self._shape:
11692  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
11693  *
11694  *
11695  */
11696     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
11697     __Pyx_GOTREF(__pyx_t_3);
11698     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11699     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11700     __PYX_ERR(1, 148, __pyx_L1_error)
11701 
11702     /* "View.MemoryView":147
11703  *         self._strides = self._shape + self.ndim
11704  *
11705  *         if not self._shape:             # <<<<<<<<<<<<<<
11706  *             raise MemoryError("unable to allocate shape and strides.")
11707  *
11708  */
11709   }
11710 
11711   /* "View.MemoryView":151
11712  *
11713  *
11714  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
11715  *             if dim <= 0:
11716  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11717  */
11718   __pyx_t_8 = 0;
11719   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
11720   for (;;) {
11721     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
11722     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11723     __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
11724     #else
11725     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
11726     __Pyx_GOTREF(__pyx_t_5);
11727     #endif
11728     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
11729     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11730     __pyx_v_dim = __pyx_t_9;
11731     __pyx_v_idx = __pyx_t_8;
11732     __pyx_t_8 = (__pyx_t_8 + 1);
11733 
11734     /* "View.MemoryView":152
11735  *
11736  *         for idx, dim in enumerate(shape):
11737  *             if dim <= 0:             # <<<<<<<<<<<<<<
11738  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11739  *             self._shape[idx] = dim
11740  */
11741     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
11742     if (unlikely(__pyx_t_4)) {
11743 
11744       /* "View.MemoryView":153
11745  *         for idx, dim in enumerate(shape):
11746  *             if dim <= 0:
11747  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
11748  *             self._shape[idx] = dim
11749  *
11750  */
11751       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
11752       __Pyx_GOTREF(__pyx_t_5);
11753       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
11754       __Pyx_GOTREF(__pyx_t_6);
11755       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
11756       __Pyx_GOTREF(__pyx_t_10);
11757       __Pyx_GIVEREF(__pyx_t_5);
11758       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
11759       __Pyx_GIVEREF(__pyx_t_6);
11760       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
11761       __pyx_t_5 = 0;
11762       __pyx_t_6 = 0;
11763       __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
11764       __Pyx_GOTREF(__pyx_t_6);
11765       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11766       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
11767       __Pyx_GOTREF(__pyx_t_10);
11768       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11769       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11770       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11771       __PYX_ERR(1, 153, __pyx_L1_error)
11772 
11773       /* "View.MemoryView":152
11774  *
11775  *         for idx, dim in enumerate(shape):
11776  *             if dim <= 0:             # <<<<<<<<<<<<<<
11777  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11778  *             self._shape[idx] = dim
11779  */
11780     }
11781 
11782     /* "View.MemoryView":154
11783  *             if dim <= 0:
11784  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11785  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
11786  *
11787  *         cdef char order
11788  */
11789     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
11790 
11791     /* "View.MemoryView":151
11792  *
11793  *
11794  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
11795  *             if dim <= 0:
11796  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
11797  */
11798   }
11799   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11800 
11801   /* "View.MemoryView":157
11802  *
11803  *         cdef char order
11804  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
11805  *             order = b'F'
11806  *             self.mode = u'fortran'
11807  */
11808   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
11809   if (__pyx_t_4) {
11810 
11811     /* "View.MemoryView":158
11812  *         cdef char order
11813  *         if mode == 'fortran':
11814  *             order = b'F'             # <<<<<<<<<<<<<<
11815  *             self.mode = u'fortran'
11816  *         elif mode == 'c':
11817  */
11818     __pyx_v_order = 'F';
11819 
11820     /* "View.MemoryView":159
11821  *         if mode == 'fortran':
11822  *             order = b'F'
11823  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
11824  *         elif mode == 'c':
11825  *             order = b'C'
11826  */
11827     __Pyx_INCREF(__pyx_n_u_fortran);
11828     __Pyx_GIVEREF(__pyx_n_u_fortran);
11829     __Pyx_GOTREF(__pyx_v_self->mode);
11830     __Pyx_DECREF(__pyx_v_self->mode);
11831     __pyx_v_self->mode = __pyx_n_u_fortran;
11832 
11833     /* "View.MemoryView":157
11834  *
11835  *         cdef char order
11836  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
11837  *             order = b'F'
11838  *             self.mode = u'fortran'
11839  */
11840     goto __pyx_L10;
11841   }
11842 
11843   /* "View.MemoryView":160
11844  *             order = b'F'
11845  *             self.mode = u'fortran'
11846  *         elif mode == 'c':             # <<<<<<<<<<<<<<
11847  *             order = b'C'
11848  *             self.mode = u'c'
11849  */
11850   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
11851   if (likely(__pyx_t_4)) {
11852 
11853     /* "View.MemoryView":161
11854  *             self.mode = u'fortran'
11855  *         elif mode == 'c':
11856  *             order = b'C'             # <<<<<<<<<<<<<<
11857  *             self.mode = u'c'
11858  *         else:
11859  */
11860     __pyx_v_order = 'C';
11861 
11862     /* "View.MemoryView":162
11863  *         elif mode == 'c':
11864  *             order = b'C'
11865  *             self.mode = u'c'             # <<<<<<<<<<<<<<
11866  *         else:
11867  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
11868  */
11869     __Pyx_INCREF(__pyx_n_u_c);
11870     __Pyx_GIVEREF(__pyx_n_u_c);
11871     __Pyx_GOTREF(__pyx_v_self->mode);
11872     __Pyx_DECREF(__pyx_v_self->mode);
11873     __pyx_v_self->mode = __pyx_n_u_c;
11874 
11875     /* "View.MemoryView":160
11876  *             order = b'F'
11877  *             self.mode = u'fortran'
11878  *         elif mode == 'c':             # <<<<<<<<<<<<<<
11879  *             order = b'C'
11880  *             self.mode = u'c'
11881  */
11882     goto __pyx_L10;
11883   }
11884 
11885   /* "View.MemoryView":164
11886  *             self.mode = u'c'
11887  *         else:
11888  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
11889  *
11890  *         self.len = fill_contig_strides_array(self._shape, self._strides,
11891  */
11892   /*else*/ {
11893     __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
11894     __Pyx_GOTREF(__pyx_t_3);
11895     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
11896     __Pyx_GOTREF(__pyx_t_10);
11897     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11898     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11899     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11900     __PYX_ERR(1, 164, __pyx_L1_error)
11901   }
11902   __pyx_L10:;
11903 
11904   /* "View.MemoryView":166
11905  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
11906  *
11907  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
11908  *                                              itemsize, self.ndim, order)
11909  *
11910  */
11911   __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
11912 
11913   /* "View.MemoryView":169
11914  *                                              itemsize, self.ndim, order)
11915  *
11916  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
11917  *         self.dtype_is_object = format == b'O'
11918  *         if allocate_buffer:
11919  */
11920   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
11921 
11922   /* "View.MemoryView":170
11923  *
11924  *         self.free_data = allocate_buffer
11925  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
11926  *         if allocate_buffer:
11927  *
11928  */
11929   __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
11930   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
11931   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11932   __pyx_v_self->dtype_is_object = __pyx_t_4;
11933 
11934   /* "View.MemoryView":171
11935  *         self.free_data = allocate_buffer
11936  *         self.dtype_is_object = format == b'O'
11937  *         if allocate_buffer:             # <<<<<<<<<<<<<<
11938  *
11939  *
11940  */
11941   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
11942   if (__pyx_t_4) {
11943 
11944     /* "View.MemoryView":174
11945  *
11946  *
11947  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
11948  *             if not self.data:
11949  *                 raise MemoryError("unable to allocate array data.")
11950  */
11951     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
11952 
11953     /* "View.MemoryView":175
11954  *
11955  *             self.data = <char *>malloc(self.len)
11956  *             if not self.data:             # <<<<<<<<<<<<<<
11957  *                 raise MemoryError("unable to allocate array data.")
11958  *
11959  */
11960     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
11961     if (unlikely(__pyx_t_4)) {
11962 
11963       /* "View.MemoryView":176
11964  *             self.data = <char *>malloc(self.len)
11965  *             if not self.data:
11966  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
11967  *
11968  *             if self.dtype_is_object:
11969  */
11970       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
11971       __Pyx_GOTREF(__pyx_t_10);
11972       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11973       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11974       __PYX_ERR(1, 176, __pyx_L1_error)
11975 
11976       /* "View.MemoryView":175
11977  *
11978  *             self.data = <char *>malloc(self.len)
11979  *             if not self.data:             # <<<<<<<<<<<<<<
11980  *                 raise MemoryError("unable to allocate array data.")
11981  *
11982  */
11983     }
11984 
11985     /* "View.MemoryView":178
11986  *                 raise MemoryError("unable to allocate array data.")
11987  *
11988  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
11989  *                 p = <PyObject **> self.data
11990  *                 for i in range(self.len / itemsize):
11991  */
11992     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
11993     if (__pyx_t_4) {
11994 
11995       /* "View.MemoryView":179
11996  *
11997  *             if self.dtype_is_object:
11998  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
11999  *                 for i in range(self.len / itemsize):
12000  *                     p[i] = Py_None
12001  */
12002       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
12003 
12004       /* "View.MemoryView":180
12005  *             if self.dtype_is_object:
12006  *                 p = <PyObject **> self.data
12007  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
12008  *                     p[i] = Py_None
12009  *                     Py_INCREF(Py_None)
12010  */
12011       if (unlikely(__pyx_v_itemsize == 0)) {
12012         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
12013         __PYX_ERR(1, 180, __pyx_L1_error)
12014       }
12015       else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
12016         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
12017         __PYX_ERR(1, 180, __pyx_L1_error)
12018       }
12019       __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
12020       __pyx_t_9 = __pyx_t_1;
12021       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
12022         __pyx_v_i = __pyx_t_11;
12023 
12024         /* "View.MemoryView":181
12025  *                 p = <PyObject **> self.data
12026  *                 for i in range(self.len / itemsize):
12027  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
12028  *                     Py_INCREF(Py_None)
12029  *
12030  */
12031         (__pyx_v_p[__pyx_v_i]) = Py_None;
12032 
12033         /* "View.MemoryView":182
12034  *                 for i in range(self.len / itemsize):
12035  *                     p[i] = Py_None
12036  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
12037  *
12038  *     @cname('getbuffer')
12039  */
12040         Py_INCREF(Py_None);
12041       }
12042 
12043       /* "View.MemoryView":178
12044  *                 raise MemoryError("unable to allocate array data.")
12045  *
12046  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
12047  *                 p = <PyObject **> self.data
12048  *                 for i in range(self.len / itemsize):
12049  */
12050     }
12051 
12052     /* "View.MemoryView":171
12053  *         self.free_data = allocate_buffer
12054  *         self.dtype_is_object = format == b'O'
12055  *         if allocate_buffer:             # <<<<<<<<<<<<<<
12056  *
12057  *
12058  */
12059   }
12060 
12061   /* "View.MemoryView":122
12062  *         cdef bint dtype_is_object
12063  *
12064  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
12065  *                   mode="c", bint allocate_buffer=True):
12066  *
12067  */
12068 
12069   /* function exit code */
12070   __pyx_r = 0;
12071   goto __pyx_L0;
12072   __pyx_L1_error:;
12073   __Pyx_XDECREF(__pyx_t_3);
12074   __Pyx_XDECREF(__pyx_t_5);
12075   __Pyx_XDECREF(__pyx_t_6);
12076   __Pyx_XDECREF(__pyx_t_10);
12077   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12078   __pyx_r = -1;
12079   __pyx_L0:;
12080   __Pyx_XDECREF(__pyx_v_format);
12081   __Pyx_RefNannyFinishContext();
12082   return __pyx_r;
12083 }
12084 
12085 /* "View.MemoryView":185
12086  *
12087  *     @cname('getbuffer')
12088  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
12089  *         cdef int bufmode = -1
12090  *         if self.mode == u"c":
12091  */
12092 
12093 /* Python wrapper */
12094 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_array_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)12095 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12096   int __pyx_r;
12097   __Pyx_RefNannyDeclarations
12098   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12099   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12100 
12101   /* function exit code */
12102   __Pyx_RefNannyFinishContext();
12103   return __pyx_r;
12104 }
12105 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)12106 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12107   int __pyx_v_bufmode;
12108   int __pyx_r;
12109   __Pyx_RefNannyDeclarations
12110   int __pyx_t_1;
12111   int __pyx_t_2;
12112   PyObject *__pyx_t_3 = NULL;
12113   char *__pyx_t_4;
12114   Py_ssize_t __pyx_t_5;
12115   int __pyx_t_6;
12116   Py_ssize_t *__pyx_t_7;
12117   int __pyx_lineno = 0;
12118   const char *__pyx_filename = NULL;
12119   int __pyx_clineno = 0;
12120   if (__pyx_v_info == NULL) {
12121     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12122     return -1;
12123   }
12124   __Pyx_RefNannySetupContext("__getbuffer__", 0);
12125   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12126   __Pyx_GIVEREF(__pyx_v_info->obj);
12127 
12128   /* "View.MemoryView":186
12129  *     @cname('getbuffer')
12130  *     def __getbuffer__(self, Py_buffer *info, int flags):
12131  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
12132  *         if self.mode == u"c":
12133  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12134  */
12135   __pyx_v_bufmode = -1;
12136 
12137   /* "View.MemoryView":187
12138  *     def __getbuffer__(self, Py_buffer *info, int flags):
12139  *         cdef int bufmode = -1
12140  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
12141  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12142  *         elif self.mode == u"fortran":
12143  */
12144   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
12145   __pyx_t_2 = (__pyx_t_1 != 0);
12146   if (__pyx_t_2) {
12147 
12148     /* "View.MemoryView":188
12149  *         cdef int bufmode = -1
12150  *         if self.mode == u"c":
12151  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
12152  *         elif self.mode == u"fortran":
12153  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12154  */
12155     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12156 
12157     /* "View.MemoryView":187
12158  *     def __getbuffer__(self, Py_buffer *info, int flags):
12159  *         cdef int bufmode = -1
12160  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
12161  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12162  *         elif self.mode == u"fortran":
12163  */
12164     goto __pyx_L3;
12165   }
12166 
12167   /* "View.MemoryView":189
12168  *         if self.mode == u"c":
12169  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12170  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
12171  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12172  *         if not (flags & bufmode):
12173  */
12174   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
12175   __pyx_t_1 = (__pyx_t_2 != 0);
12176   if (__pyx_t_1) {
12177 
12178     /* "View.MemoryView":190
12179  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12180  *         elif self.mode == u"fortran":
12181  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
12182  *         if not (flags & bufmode):
12183  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
12184  */
12185     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
12186 
12187     /* "View.MemoryView":189
12188  *         if self.mode == u"c":
12189  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12190  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
12191  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12192  *         if not (flags & bufmode):
12193  */
12194   }
12195   __pyx_L3:;
12196 
12197   /* "View.MemoryView":191
12198  *         elif self.mode == u"fortran":
12199  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12200  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
12201  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
12202  *         info.buf = self.data
12203  */
12204   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
12205   if (unlikely(__pyx_t_1)) {
12206 
12207     /* "View.MemoryView":192
12208  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12209  *         if not (flags & bufmode):
12210  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
12211  *         info.buf = self.data
12212  *         info.len = self.len
12213  */
12214     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
12215     __Pyx_GOTREF(__pyx_t_3);
12216     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12217     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12218     __PYX_ERR(1, 192, __pyx_L1_error)
12219 
12220     /* "View.MemoryView":191
12221  *         elif self.mode == u"fortran":
12222  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
12223  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
12224  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
12225  *         info.buf = self.data
12226  */
12227   }
12228 
12229   /* "View.MemoryView":193
12230  *         if not (flags & bufmode):
12231  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
12232  *         info.buf = self.data             # <<<<<<<<<<<<<<
12233  *         info.len = self.len
12234  *         info.ndim = self.ndim
12235  */
12236   __pyx_t_4 = __pyx_v_self->data;
12237   __pyx_v_info->buf = __pyx_t_4;
12238 
12239   /* "View.MemoryView":194
12240  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
12241  *         info.buf = self.data
12242  *         info.len = self.len             # <<<<<<<<<<<<<<
12243  *         info.ndim = self.ndim
12244  *         info.shape = self._shape
12245  */
12246   __pyx_t_5 = __pyx_v_self->len;
12247   __pyx_v_info->len = __pyx_t_5;
12248 
12249   /* "View.MemoryView":195
12250  *         info.buf = self.data
12251  *         info.len = self.len
12252  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
12253  *         info.shape = self._shape
12254  *         info.strides = self._strides
12255  */
12256   __pyx_t_6 = __pyx_v_self->ndim;
12257   __pyx_v_info->ndim = __pyx_t_6;
12258 
12259   /* "View.MemoryView":196
12260  *         info.len = self.len
12261  *         info.ndim = self.ndim
12262  *         info.shape = self._shape             # <<<<<<<<<<<<<<
12263  *         info.strides = self._strides
12264  *         info.suboffsets = NULL
12265  */
12266   __pyx_t_7 = __pyx_v_self->_shape;
12267   __pyx_v_info->shape = __pyx_t_7;
12268 
12269   /* "View.MemoryView":197
12270  *         info.ndim = self.ndim
12271  *         info.shape = self._shape
12272  *         info.strides = self._strides             # <<<<<<<<<<<<<<
12273  *         info.suboffsets = NULL
12274  *         info.itemsize = self.itemsize
12275  */
12276   __pyx_t_7 = __pyx_v_self->_strides;
12277   __pyx_v_info->strides = __pyx_t_7;
12278 
12279   /* "View.MemoryView":198
12280  *         info.shape = self._shape
12281  *         info.strides = self._strides
12282  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
12283  *         info.itemsize = self.itemsize
12284  *         info.readonly = 0
12285  */
12286   __pyx_v_info->suboffsets = NULL;
12287 
12288   /* "View.MemoryView":199
12289  *         info.strides = self._strides
12290  *         info.suboffsets = NULL
12291  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
12292  *         info.readonly = 0
12293  *
12294  */
12295   __pyx_t_5 = __pyx_v_self->itemsize;
12296   __pyx_v_info->itemsize = __pyx_t_5;
12297 
12298   /* "View.MemoryView":200
12299  *         info.suboffsets = NULL
12300  *         info.itemsize = self.itemsize
12301  *         info.readonly = 0             # <<<<<<<<<<<<<<
12302  *
12303  *         if flags & PyBUF_FORMAT:
12304  */
12305   __pyx_v_info->readonly = 0;
12306 
12307   /* "View.MemoryView":202
12308  *         info.readonly = 0
12309  *
12310  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
12311  *             info.format = self.format
12312  *         else:
12313  */
12314   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12315   if (__pyx_t_1) {
12316 
12317     /* "View.MemoryView":203
12318  *
12319  *         if flags & PyBUF_FORMAT:
12320  *             info.format = self.format             # <<<<<<<<<<<<<<
12321  *         else:
12322  *             info.format = NULL
12323  */
12324     __pyx_t_4 = __pyx_v_self->format;
12325     __pyx_v_info->format = __pyx_t_4;
12326 
12327     /* "View.MemoryView":202
12328  *         info.readonly = 0
12329  *
12330  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
12331  *             info.format = self.format
12332  *         else:
12333  */
12334     goto __pyx_L5;
12335   }
12336 
12337   /* "View.MemoryView":205
12338  *             info.format = self.format
12339  *         else:
12340  *             info.format = NULL             # <<<<<<<<<<<<<<
12341  *
12342  *         info.obj = self
12343  */
12344   /*else*/ {
12345     __pyx_v_info->format = NULL;
12346   }
12347   __pyx_L5:;
12348 
12349   /* "View.MemoryView":207
12350  *             info.format = NULL
12351  *
12352  *         info.obj = self             # <<<<<<<<<<<<<<
12353  *
12354  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12355  */
12356   __Pyx_INCREF(((PyObject *)__pyx_v_self));
12357   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12358   __Pyx_GOTREF(__pyx_v_info->obj);
12359   __Pyx_DECREF(__pyx_v_info->obj);
12360   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12361 
12362   /* "View.MemoryView":185
12363  *
12364  *     @cname('getbuffer')
12365  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
12366  *         cdef int bufmode = -1
12367  *         if self.mode == u"c":
12368  */
12369 
12370   /* function exit code */
12371   __pyx_r = 0;
12372   goto __pyx_L0;
12373   __pyx_L1_error:;
12374   __Pyx_XDECREF(__pyx_t_3);
12375   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12376   __pyx_r = -1;
12377   if (__pyx_v_info->obj != NULL) {
12378     __Pyx_GOTREF(__pyx_v_info->obj);
12379     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12380   }
12381   goto __pyx_L2;
12382   __pyx_L0:;
12383   if (__pyx_v_info->obj == Py_None) {
12384     __Pyx_GOTREF(__pyx_v_info->obj);
12385     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12386   }
12387   __pyx_L2:;
12388   __Pyx_RefNannyFinishContext();
12389   return __pyx_r;
12390 }
12391 
12392 /* "View.MemoryView":211
12393  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12394  *
12395  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
12396  *         if self.callback_free_data != NULL:
12397  *             self.callback_free_data(self.data)
12398  */
12399 
12400 /* Python wrapper */
12401 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)12402 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
12403   __Pyx_RefNannyDeclarations
12404   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
12405   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
12406 
12407   /* function exit code */
12408   __Pyx_RefNannyFinishContext();
12409 }
12410 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)12411 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
12412   __Pyx_RefNannyDeclarations
12413   int __pyx_t_1;
12414   __Pyx_RefNannySetupContext("__dealloc__", 0);
12415 
12416   /* "View.MemoryView":212
12417  *
12418  *     def __dealloc__(array self):
12419  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
12420  *             self.callback_free_data(self.data)
12421  *         elif self.free_data:
12422  */
12423   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
12424   if (__pyx_t_1) {
12425 
12426     /* "View.MemoryView":213
12427  *     def __dealloc__(array self):
12428  *         if self.callback_free_data != NULL:
12429  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
12430  *         elif self.free_data:
12431  *             if self.dtype_is_object:
12432  */
12433     __pyx_v_self->callback_free_data(__pyx_v_self->data);
12434 
12435     /* "View.MemoryView":212
12436  *
12437  *     def __dealloc__(array self):
12438  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
12439  *             self.callback_free_data(self.data)
12440  *         elif self.free_data:
12441  */
12442     goto __pyx_L3;
12443   }
12444 
12445   /* "View.MemoryView":214
12446  *         if self.callback_free_data != NULL:
12447  *             self.callback_free_data(self.data)
12448  *         elif self.free_data:             # <<<<<<<<<<<<<<
12449  *             if self.dtype_is_object:
12450  *                 refcount_objects_in_slice(self.data, self._shape,
12451  */
12452   __pyx_t_1 = (__pyx_v_self->free_data != 0);
12453   if (__pyx_t_1) {
12454 
12455     /* "View.MemoryView":215
12456  *             self.callback_free_data(self.data)
12457  *         elif self.free_data:
12458  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
12459  *                 refcount_objects_in_slice(self.data, self._shape,
12460  *                                           self._strides, self.ndim, False)
12461  */
12462     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12463     if (__pyx_t_1) {
12464 
12465       /* "View.MemoryView":216
12466  *         elif self.free_data:
12467  *             if self.dtype_is_object:
12468  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
12469  *                                           self._strides, self.ndim, False)
12470  *             free(self.data)
12471  */
12472       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
12473 
12474       /* "View.MemoryView":215
12475  *             self.callback_free_data(self.data)
12476  *         elif self.free_data:
12477  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
12478  *                 refcount_objects_in_slice(self.data, self._shape,
12479  *                                           self._strides, self.ndim, False)
12480  */
12481     }
12482 
12483     /* "View.MemoryView":218
12484  *                 refcount_objects_in_slice(self.data, self._shape,
12485  *                                           self._strides, self.ndim, False)
12486  *             free(self.data)             # <<<<<<<<<<<<<<
12487  *         PyObject_Free(self._shape)
12488  *
12489  */
12490     free(__pyx_v_self->data);
12491 
12492     /* "View.MemoryView":214
12493  *         if self.callback_free_data != NULL:
12494  *             self.callback_free_data(self.data)
12495  *         elif self.free_data:             # <<<<<<<<<<<<<<
12496  *             if self.dtype_is_object:
12497  *                 refcount_objects_in_slice(self.data, self._shape,
12498  */
12499   }
12500   __pyx_L3:;
12501 
12502   /* "View.MemoryView":219
12503  *                                           self._strides, self.ndim, False)
12504  *             free(self.data)
12505  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
12506  *
12507  *     @property
12508  */
12509   PyObject_Free(__pyx_v_self->_shape);
12510 
12511   /* "View.MemoryView":211
12512  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
12513  *
12514  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
12515  *         if self.callback_free_data != NULL:
12516  *             self.callback_free_data(self.data)
12517  */
12518 
12519   /* function exit code */
12520   __Pyx_RefNannyFinishContext();
12521 }
12522 
12523 /* "View.MemoryView":222
12524  *
12525  *     @property
12526  *     def memview(self):             # <<<<<<<<<<<<<<
12527  *         return self.get_memview()
12528  *
12529  */
12530 
12531 /* Python wrapper */
12532 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject * __pyx_v_self)12533 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
12534   PyObject *__pyx_r = 0;
12535   __Pyx_RefNannyDeclarations
12536   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12537   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
12538 
12539   /* function exit code */
12540   __Pyx_RefNannyFinishContext();
12541   return __pyx_r;
12542 }
12543 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)12544 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
12545   PyObject *__pyx_r = NULL;
12546   __Pyx_RefNannyDeclarations
12547   PyObject *__pyx_t_1 = NULL;
12548   int __pyx_lineno = 0;
12549   const char *__pyx_filename = NULL;
12550   int __pyx_clineno = 0;
12551   __Pyx_RefNannySetupContext("__get__", 0);
12552 
12553   /* "View.MemoryView":223
12554  *     @property
12555  *     def memview(self):
12556  *         return self.get_memview()             # <<<<<<<<<<<<<<
12557  *
12558  *     @cname('get_memview')
12559  */
12560   __Pyx_XDECREF(__pyx_r);
12561   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
12562   __Pyx_GOTREF(__pyx_t_1);
12563   __pyx_r = __pyx_t_1;
12564   __pyx_t_1 = 0;
12565   goto __pyx_L0;
12566 
12567   /* "View.MemoryView":222
12568  *
12569  *     @property
12570  *     def memview(self):             # <<<<<<<<<<<<<<
12571  *         return self.get_memview()
12572  *
12573  */
12574 
12575   /* function exit code */
12576   __pyx_L1_error:;
12577   __Pyx_XDECREF(__pyx_t_1);
12578   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12579   __pyx_r = NULL;
12580   __pyx_L0:;
12581   __Pyx_XGIVEREF(__pyx_r);
12582   __Pyx_RefNannyFinishContext();
12583   return __pyx_r;
12584 }
12585 
12586 /* "View.MemoryView":226
12587  *
12588  *     @cname('get_memview')
12589  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
12590  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12591  *         return  memoryview(self, flags, self.dtype_is_object)
12592  */
12593 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)12594 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
12595   int __pyx_v_flags;
12596   PyObject *__pyx_r = NULL;
12597   __Pyx_RefNannyDeclarations
12598   PyObject *__pyx_t_1 = NULL;
12599   PyObject *__pyx_t_2 = NULL;
12600   PyObject *__pyx_t_3 = NULL;
12601   int __pyx_lineno = 0;
12602   const char *__pyx_filename = NULL;
12603   int __pyx_clineno = 0;
12604   __Pyx_RefNannySetupContext("get_memview", 0);
12605 
12606   /* "View.MemoryView":227
12607  *     @cname('get_memview')
12608  *     cdef get_memview(self):
12609  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
12610  *         return  memoryview(self, flags, self.dtype_is_object)
12611  *
12612  */
12613   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
12614 
12615   /* "View.MemoryView":228
12616  *     cdef get_memview(self):
12617  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12618  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
12619  *
12620  *     def __len__(self):
12621  */
12622   __Pyx_XDECREF(__pyx_r);
12623   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
12624   __Pyx_GOTREF(__pyx_t_1);
12625   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
12626   __Pyx_GOTREF(__pyx_t_2);
12627   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
12628   __Pyx_GOTREF(__pyx_t_3);
12629   __Pyx_INCREF(((PyObject *)__pyx_v_self));
12630   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12631   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
12632   __Pyx_GIVEREF(__pyx_t_1);
12633   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12634   __Pyx_GIVEREF(__pyx_t_2);
12635   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12636   __pyx_t_1 = 0;
12637   __pyx_t_2 = 0;
12638   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
12639   __Pyx_GOTREF(__pyx_t_2);
12640   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12641   __pyx_r = __pyx_t_2;
12642   __pyx_t_2 = 0;
12643   goto __pyx_L0;
12644 
12645   /* "View.MemoryView":226
12646  *
12647  *     @cname('get_memview')
12648  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
12649  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
12650  *         return  memoryview(self, flags, self.dtype_is_object)
12651  */
12652 
12653   /* function exit code */
12654   __pyx_L1_error:;
12655   __Pyx_XDECREF(__pyx_t_1);
12656   __Pyx_XDECREF(__pyx_t_2);
12657   __Pyx_XDECREF(__pyx_t_3);
12658   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
12659   __pyx_r = 0;
12660   __pyx_L0:;
12661   __Pyx_XGIVEREF(__pyx_r);
12662   __Pyx_RefNannyFinishContext();
12663   return __pyx_r;
12664 }
12665 
12666 /* "View.MemoryView":230
12667  *         return  memoryview(self, flags, self.dtype_is_object)
12668  *
12669  *     def __len__(self):             # <<<<<<<<<<<<<<
12670  *         return self._shape[0]
12671  *
12672  */
12673 
12674 /* Python wrapper */
12675 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)12676 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
12677   Py_ssize_t __pyx_r;
12678   __Pyx_RefNannyDeclarations
12679   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
12680   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
12681 
12682   /* function exit code */
12683   __Pyx_RefNannyFinishContext();
12684   return __pyx_r;
12685 }
12686 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)12687 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
12688   Py_ssize_t __pyx_r;
12689   __Pyx_RefNannyDeclarations
12690   __Pyx_RefNannySetupContext("__len__", 0);
12691 
12692   /* "View.MemoryView":231
12693  *
12694  *     def __len__(self):
12695  *         return self._shape[0]             # <<<<<<<<<<<<<<
12696  *
12697  *     def __getattr__(self, attr):
12698  */
12699   __pyx_r = (__pyx_v_self->_shape[0]);
12700   goto __pyx_L0;
12701 
12702   /* "View.MemoryView":230
12703  *         return  memoryview(self, flags, self.dtype_is_object)
12704  *
12705  *     def __len__(self):             # <<<<<<<<<<<<<<
12706  *         return self._shape[0]
12707  *
12708  */
12709 
12710   /* function exit code */
12711   __pyx_L0:;
12712   __Pyx_RefNannyFinishContext();
12713   return __pyx_r;
12714 }
12715 
12716 /* "View.MemoryView":233
12717  *         return self._shape[0]
12718  *
12719  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
12720  *         return getattr(self.memview, attr)
12721  *
12722  */
12723 
12724 /* Python wrapper */
12725 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
__pyx_array___getattr__(PyObject * __pyx_v_self,PyObject * __pyx_v_attr)12726 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
12727   PyObject *__pyx_r = 0;
12728   __Pyx_RefNannyDeclarations
12729   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
12730   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
12731 
12732   /* function exit code */
12733   __Pyx_RefNannyFinishContext();
12734   return __pyx_r;
12735 }
12736 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)12737 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
12738   PyObject *__pyx_r = NULL;
12739   __Pyx_RefNannyDeclarations
12740   PyObject *__pyx_t_1 = NULL;
12741   PyObject *__pyx_t_2 = NULL;
12742   int __pyx_lineno = 0;
12743   const char *__pyx_filename = NULL;
12744   int __pyx_clineno = 0;
12745   __Pyx_RefNannySetupContext("__getattr__", 0);
12746 
12747   /* "View.MemoryView":234
12748  *
12749  *     def __getattr__(self, attr):
12750  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
12751  *
12752  *     def __getitem__(self, item):
12753  */
12754   __Pyx_XDECREF(__pyx_r);
12755   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
12756   __Pyx_GOTREF(__pyx_t_1);
12757   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
12758   __Pyx_GOTREF(__pyx_t_2);
12759   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12760   __pyx_r = __pyx_t_2;
12761   __pyx_t_2 = 0;
12762   goto __pyx_L0;
12763 
12764   /* "View.MemoryView":233
12765  *         return self._shape[0]
12766  *
12767  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
12768  *         return getattr(self.memview, attr)
12769  *
12770  */
12771 
12772   /* function exit code */
12773   __pyx_L1_error:;
12774   __Pyx_XDECREF(__pyx_t_1);
12775   __Pyx_XDECREF(__pyx_t_2);
12776   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12777   __pyx_r = NULL;
12778   __pyx_L0:;
12779   __Pyx_XGIVEREF(__pyx_r);
12780   __Pyx_RefNannyFinishContext();
12781   return __pyx_r;
12782 }
12783 
12784 /* "View.MemoryView":236
12785  *         return getattr(self.memview, attr)
12786  *
12787  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
12788  *         return self.memview[item]
12789  *
12790  */
12791 
12792 /* Python wrapper */
12793 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
__pyx_array___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item)12794 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
12795   PyObject *__pyx_r = 0;
12796   __Pyx_RefNannyDeclarations
12797   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
12798   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
12799 
12800   /* function exit code */
12801   __Pyx_RefNannyFinishContext();
12802   return __pyx_r;
12803 }
12804 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)12805 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
12806   PyObject *__pyx_r = NULL;
12807   __Pyx_RefNannyDeclarations
12808   PyObject *__pyx_t_1 = NULL;
12809   PyObject *__pyx_t_2 = NULL;
12810   int __pyx_lineno = 0;
12811   const char *__pyx_filename = NULL;
12812   int __pyx_clineno = 0;
12813   __Pyx_RefNannySetupContext("__getitem__", 0);
12814 
12815   /* "View.MemoryView":237
12816  *
12817  *     def __getitem__(self, item):
12818  *         return self.memview[item]             # <<<<<<<<<<<<<<
12819  *
12820  *     def __setitem__(self, item, value):
12821  */
12822   __Pyx_XDECREF(__pyx_r);
12823   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
12824   __Pyx_GOTREF(__pyx_t_1);
12825   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
12826   __Pyx_GOTREF(__pyx_t_2);
12827   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12828   __pyx_r = __pyx_t_2;
12829   __pyx_t_2 = 0;
12830   goto __pyx_L0;
12831 
12832   /* "View.MemoryView":236
12833  *         return getattr(self.memview, attr)
12834  *
12835  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
12836  *         return self.memview[item]
12837  *
12838  */
12839 
12840   /* function exit code */
12841   __pyx_L1_error:;
12842   __Pyx_XDECREF(__pyx_t_1);
12843   __Pyx_XDECREF(__pyx_t_2);
12844   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12845   __pyx_r = NULL;
12846   __pyx_L0:;
12847   __Pyx_XGIVEREF(__pyx_r);
12848   __Pyx_RefNannyFinishContext();
12849   return __pyx_r;
12850 }
12851 
12852 /* "View.MemoryView":239
12853  *         return self.memview[item]
12854  *
12855  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
12856  *         self.memview[item] = value
12857  *
12858  */
12859 
12860 /* Python wrapper */
12861 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
__pyx_array___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)12862 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
12863   int __pyx_r;
12864   __Pyx_RefNannyDeclarations
12865   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
12866   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
12867 
12868   /* function exit code */
12869   __Pyx_RefNannyFinishContext();
12870   return __pyx_r;
12871 }
12872 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)12873 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
12874   int __pyx_r;
12875   __Pyx_RefNannyDeclarations
12876   PyObject *__pyx_t_1 = NULL;
12877   int __pyx_lineno = 0;
12878   const char *__pyx_filename = NULL;
12879   int __pyx_clineno = 0;
12880   __Pyx_RefNannySetupContext("__setitem__", 0);
12881 
12882   /* "View.MemoryView":240
12883  *
12884  *     def __setitem__(self, item, value):
12885  *         self.memview[item] = value             # <<<<<<<<<<<<<<
12886  *
12887  *
12888  */
12889   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
12890   __Pyx_GOTREF(__pyx_t_1);
12891   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
12892   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12893 
12894   /* "View.MemoryView":239
12895  *         return self.memview[item]
12896  *
12897  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
12898  *         self.memview[item] = value
12899  *
12900  */
12901 
12902   /* function exit code */
12903   __pyx_r = 0;
12904   goto __pyx_L0;
12905   __pyx_L1_error:;
12906   __Pyx_XDECREF(__pyx_t_1);
12907   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12908   __pyx_r = -1;
12909   __pyx_L0:;
12910   __Pyx_RefNannyFinishContext();
12911   return __pyx_r;
12912 }
12913 
12914 /* "(tree fragment)":1
12915  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12916  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12917  * def __setstate_cython__(self, __pyx_state):
12918  */
12919 
12920 /* Python wrapper */
12921 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_array_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)12922 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12923   PyObject *__pyx_r = 0;
12924   __Pyx_RefNannyDeclarations
12925   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12926   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
12927 
12928   /* function exit code */
12929   __Pyx_RefNannyFinishContext();
12930   return __pyx_r;
12931 }
12932 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)12933 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
12934   PyObject *__pyx_r = NULL;
12935   __Pyx_RefNannyDeclarations
12936   PyObject *__pyx_t_1 = NULL;
12937   int __pyx_lineno = 0;
12938   const char *__pyx_filename = NULL;
12939   int __pyx_clineno = 0;
12940   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12941 
12942   /* "(tree fragment)":2
12943  * def __reduce_cython__(self):
12944  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
12945  * def __setstate_cython__(self, __pyx_state):
12946  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12947  */
12948   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
12949   __Pyx_GOTREF(__pyx_t_1);
12950   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12951   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12952   __PYX_ERR(1, 2, __pyx_L1_error)
12953 
12954   /* "(tree fragment)":1
12955  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
12956  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12957  * def __setstate_cython__(self, __pyx_state):
12958  */
12959 
12960   /* function exit code */
12961   __pyx_L1_error:;
12962   __Pyx_XDECREF(__pyx_t_1);
12963   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12964   __pyx_r = NULL;
12965   __Pyx_XGIVEREF(__pyx_r);
12966   __Pyx_RefNannyFinishContext();
12967   return __pyx_r;
12968 }
12969 
12970 /* "(tree fragment)":3
12971  * def __reduce_cython__(self):
12972  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12973  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
12974  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12975  */
12976 
12977 /* Python wrapper */
12978 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_array_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)12979 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12980   PyObject *__pyx_r = 0;
12981   __Pyx_RefNannyDeclarations
12982   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12983   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12984 
12985   /* function exit code */
12986   __Pyx_RefNannyFinishContext();
12987   return __pyx_r;
12988 }
12989 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)12990 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12991   PyObject *__pyx_r = NULL;
12992   __Pyx_RefNannyDeclarations
12993   PyObject *__pyx_t_1 = NULL;
12994   int __pyx_lineno = 0;
12995   const char *__pyx_filename = NULL;
12996   int __pyx_clineno = 0;
12997   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12998 
12999   /* "(tree fragment)":4
13000  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13001  * def __setstate_cython__(self, __pyx_state):
13002  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
13003  */
13004   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13005   __Pyx_GOTREF(__pyx_t_1);
13006   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13007   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13008   __PYX_ERR(1, 4, __pyx_L1_error)
13009 
13010   /* "(tree fragment)":3
13011  * def __reduce_cython__(self):
13012  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13013  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
13014  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13015  */
13016 
13017   /* function exit code */
13018   __pyx_L1_error:;
13019   __Pyx_XDECREF(__pyx_t_1);
13020   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13021   __pyx_r = NULL;
13022   __Pyx_XGIVEREF(__pyx_r);
13023   __Pyx_RefNannyFinishContext();
13024   return __pyx_r;
13025 }
13026 
13027 /* "View.MemoryView":244
13028  *
13029  * @cname("__pyx_array_new")
13030  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
13031  *                           char *mode, char *buf):
13032  *     cdef array result
13033  */
13034 
__pyx_array_new(PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,char * __pyx_v_format,char * __pyx_v_mode,char * __pyx_v_buf)13035 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
13036   struct __pyx_array_obj *__pyx_v_result = 0;
13037   struct __pyx_array_obj *__pyx_r = NULL;
13038   __Pyx_RefNannyDeclarations
13039   int __pyx_t_1;
13040   PyObject *__pyx_t_2 = NULL;
13041   PyObject *__pyx_t_3 = NULL;
13042   PyObject *__pyx_t_4 = NULL;
13043   PyObject *__pyx_t_5 = NULL;
13044   int __pyx_lineno = 0;
13045   const char *__pyx_filename = NULL;
13046   int __pyx_clineno = 0;
13047   __Pyx_RefNannySetupContext("array_cwrapper", 0);
13048 
13049   /* "View.MemoryView":248
13050  *     cdef array result
13051  *
13052  *     if buf == NULL:             # <<<<<<<<<<<<<<
13053  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
13054  *     else:
13055  */
13056   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
13057   if (__pyx_t_1) {
13058 
13059     /* "View.MemoryView":249
13060  *
13061  *     if buf == NULL:
13062  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
13063  *     else:
13064  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
13065  */
13066     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
13067     __Pyx_GOTREF(__pyx_t_2);
13068     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
13069     __Pyx_GOTREF(__pyx_t_3);
13070     __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
13071     __Pyx_GOTREF(__pyx_t_4);
13072     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
13073     __Pyx_GOTREF(__pyx_t_5);
13074     __Pyx_INCREF(__pyx_v_shape);
13075     __Pyx_GIVEREF(__pyx_v_shape);
13076     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
13077     __Pyx_GIVEREF(__pyx_t_2);
13078     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
13079     __Pyx_GIVEREF(__pyx_t_3);
13080     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
13081     __Pyx_GIVEREF(__pyx_t_4);
13082     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
13083     __pyx_t_2 = 0;
13084     __pyx_t_3 = 0;
13085     __pyx_t_4 = 0;
13086     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
13087     __Pyx_GOTREF(__pyx_t_4);
13088     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13089     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
13090     __pyx_t_4 = 0;
13091 
13092     /* "View.MemoryView":248
13093  *     cdef array result
13094  *
13095  *     if buf == NULL:             # <<<<<<<<<<<<<<
13096  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
13097  *     else:
13098  */
13099     goto __pyx_L3;
13100   }
13101 
13102   /* "View.MemoryView":251
13103  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
13104  *     else:
13105  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
13106  *                        allocate_buffer=False)
13107  *         result.data = buf
13108  */
13109   /*else*/ {
13110     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
13111     __Pyx_GOTREF(__pyx_t_4);
13112     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
13113     __Pyx_GOTREF(__pyx_t_5);
13114     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
13115     __Pyx_GOTREF(__pyx_t_3);
13116     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
13117     __Pyx_GOTREF(__pyx_t_2);
13118     __Pyx_INCREF(__pyx_v_shape);
13119     __Pyx_GIVEREF(__pyx_v_shape);
13120     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
13121     __Pyx_GIVEREF(__pyx_t_4);
13122     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
13123     __Pyx_GIVEREF(__pyx_t_5);
13124     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
13125     __Pyx_GIVEREF(__pyx_t_3);
13126     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
13127     __pyx_t_4 = 0;
13128     __pyx_t_5 = 0;
13129     __pyx_t_3 = 0;
13130 
13131     /* "View.MemoryView":252
13132  *     else:
13133  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
13134  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
13135  *         result.data = buf
13136  *
13137  */
13138     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
13139     __Pyx_GOTREF(__pyx_t_3);
13140     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
13141 
13142     /* "View.MemoryView":251
13143  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
13144  *     else:
13145  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
13146  *                        allocate_buffer=False)
13147  *         result.data = buf
13148  */
13149     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
13150     __Pyx_GOTREF(__pyx_t_5);
13151     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13152     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13153     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
13154     __pyx_t_5 = 0;
13155 
13156     /* "View.MemoryView":253
13157  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
13158  *                        allocate_buffer=False)
13159  *         result.data = buf             # <<<<<<<<<<<<<<
13160  *
13161  *     return result
13162  */
13163     __pyx_v_result->data = __pyx_v_buf;
13164   }
13165   __pyx_L3:;
13166 
13167   /* "View.MemoryView":255
13168  *         result.data = buf
13169  *
13170  *     return result             # <<<<<<<<<<<<<<
13171  *
13172  *
13173  */
13174   __Pyx_XDECREF(((PyObject *)__pyx_r));
13175   __Pyx_INCREF(((PyObject *)__pyx_v_result));
13176   __pyx_r = __pyx_v_result;
13177   goto __pyx_L0;
13178 
13179   /* "View.MemoryView":244
13180  *
13181  * @cname("__pyx_array_new")
13182  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
13183  *                           char *mode, char *buf):
13184  *     cdef array result
13185  */
13186 
13187   /* function exit code */
13188   __pyx_L1_error:;
13189   __Pyx_XDECREF(__pyx_t_2);
13190   __Pyx_XDECREF(__pyx_t_3);
13191   __Pyx_XDECREF(__pyx_t_4);
13192   __Pyx_XDECREF(__pyx_t_5);
13193   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13194   __pyx_r = 0;
13195   __pyx_L0:;
13196   __Pyx_XDECREF((PyObject *)__pyx_v_result);
13197   __Pyx_XGIVEREF((PyObject *)__pyx_r);
13198   __Pyx_RefNannyFinishContext();
13199   return __pyx_r;
13200 }
13201 
13202 /* "View.MemoryView":281
13203  * cdef class Enum(object):
13204  *     cdef object name
13205  *     def __init__(self, name):             # <<<<<<<<<<<<<<
13206  *         self.name = name
13207  *     def __repr__(self):
13208  */
13209 
13210 /* Python wrapper */
13211 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_MemviewEnum___init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13212 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13213   PyObject *__pyx_v_name = 0;
13214   int __pyx_lineno = 0;
13215   const char *__pyx_filename = NULL;
13216   int __pyx_clineno = 0;
13217   int __pyx_r;
13218   __Pyx_RefNannyDeclarations
13219   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
13220   {
13221     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
13222     PyObject* values[1] = {0};
13223     if (unlikely(__pyx_kwds)) {
13224       Py_ssize_t kw_args;
13225       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13226       switch (pos_args) {
13227         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13228         CYTHON_FALLTHROUGH;
13229         case  0: break;
13230         default: goto __pyx_L5_argtuple_error;
13231       }
13232       kw_args = PyDict_Size(__pyx_kwds);
13233       switch (pos_args) {
13234         case  0:
13235         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
13236         else goto __pyx_L5_argtuple_error;
13237       }
13238       if (unlikely(kw_args > 0)) {
13239         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
13240       }
13241     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
13242       goto __pyx_L5_argtuple_error;
13243     } else {
13244       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13245     }
13246     __pyx_v_name = values[0];
13247   }
13248   goto __pyx_L4_argument_unpacking_done;
13249   __pyx_L5_argtuple_error:;
13250   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
13251   __pyx_L3_error:;
13252   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13253   __Pyx_RefNannyFinishContext();
13254   return -1;
13255   __pyx_L4_argument_unpacking_done:;
13256   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
13257 
13258   /* function exit code */
13259   __Pyx_RefNannyFinishContext();
13260   return __pyx_r;
13261 }
13262 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)13263 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
13264   int __pyx_r;
13265   __Pyx_RefNannyDeclarations
13266   __Pyx_RefNannySetupContext("__init__", 0);
13267 
13268   /* "View.MemoryView":282
13269  *     cdef object name
13270  *     def __init__(self, name):
13271  *         self.name = name             # <<<<<<<<<<<<<<
13272  *     def __repr__(self):
13273  *         return self.name
13274  */
13275   __Pyx_INCREF(__pyx_v_name);
13276   __Pyx_GIVEREF(__pyx_v_name);
13277   __Pyx_GOTREF(__pyx_v_self->name);
13278   __Pyx_DECREF(__pyx_v_self->name);
13279   __pyx_v_self->name = __pyx_v_name;
13280 
13281   /* "View.MemoryView":281
13282  * cdef class Enum(object):
13283  *     cdef object name
13284  *     def __init__(self, name):             # <<<<<<<<<<<<<<
13285  *         self.name = name
13286  *     def __repr__(self):
13287  */
13288 
13289   /* function exit code */
13290   __pyx_r = 0;
13291   __Pyx_RefNannyFinishContext();
13292   return __pyx_r;
13293 }
13294 
13295 /* "View.MemoryView":283
13296  *     def __init__(self, name):
13297  *         self.name = name
13298  *     def __repr__(self):             # <<<<<<<<<<<<<<
13299  *         return self.name
13300  *
13301  */
13302 
13303 /* Python wrapper */
13304 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)13305 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
13306   PyObject *__pyx_r = 0;
13307   __Pyx_RefNannyDeclarations
13308   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13309   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13310 
13311   /* function exit code */
13312   __Pyx_RefNannyFinishContext();
13313   return __pyx_r;
13314 }
13315 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)13316 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13317   PyObject *__pyx_r = NULL;
13318   __Pyx_RefNannyDeclarations
13319   __Pyx_RefNannySetupContext("__repr__", 0);
13320 
13321   /* "View.MemoryView":284
13322  *         self.name = name
13323  *     def __repr__(self):
13324  *         return self.name             # <<<<<<<<<<<<<<
13325  *
13326  * cdef generic = Enum("<strided and direct or indirect>")
13327  */
13328   __Pyx_XDECREF(__pyx_r);
13329   __Pyx_INCREF(__pyx_v_self->name);
13330   __pyx_r = __pyx_v_self->name;
13331   goto __pyx_L0;
13332 
13333   /* "View.MemoryView":283
13334  *     def __init__(self, name):
13335  *         self.name = name
13336  *     def __repr__(self):             # <<<<<<<<<<<<<<
13337  *         return self.name
13338  *
13339  */
13340 
13341   /* function exit code */
13342   __pyx_L0:;
13343   __Pyx_XGIVEREF(__pyx_r);
13344   __Pyx_RefNannyFinishContext();
13345   return __pyx_r;
13346 }
13347 
13348 /* "(tree fragment)":1
13349  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
13350  *     cdef tuple state
13351  *     cdef object _dict
13352  */
13353 
13354 /* Python wrapper */
13355 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)13356 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13357   PyObject *__pyx_r = 0;
13358   __Pyx_RefNannyDeclarations
13359   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13360   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
13361 
13362   /* function exit code */
13363   __Pyx_RefNannyFinishContext();
13364   return __pyx_r;
13365 }
13366 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)13367 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
13368   PyObject *__pyx_v_state = 0;
13369   PyObject *__pyx_v__dict = 0;
13370   int __pyx_v_use_setstate;
13371   PyObject *__pyx_r = NULL;
13372   __Pyx_RefNannyDeclarations
13373   PyObject *__pyx_t_1 = NULL;
13374   int __pyx_t_2;
13375   int __pyx_t_3;
13376   PyObject *__pyx_t_4 = NULL;
13377   PyObject *__pyx_t_5 = NULL;
13378   int __pyx_lineno = 0;
13379   const char *__pyx_filename = NULL;
13380   int __pyx_clineno = 0;
13381   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13382 
13383   /* "(tree fragment)":5
13384  *     cdef object _dict
13385  *     cdef bint use_setstate
13386  *     state = (self.name,)             # <<<<<<<<<<<<<<
13387  *     _dict = getattr(self, '__dict__', None)
13388  *     if _dict is not None:
13389  */
13390   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
13391   __Pyx_GOTREF(__pyx_t_1);
13392   __Pyx_INCREF(__pyx_v_self->name);
13393   __Pyx_GIVEREF(__pyx_v_self->name);
13394   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
13395   __pyx_v_state = ((PyObject*)__pyx_t_1);
13396   __pyx_t_1 = 0;
13397 
13398   /* "(tree fragment)":6
13399  *     cdef bint use_setstate
13400  *     state = (self.name,)
13401  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
13402  *     if _dict is not None:
13403  *         state += (_dict,)
13404  */
13405   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
13406   __Pyx_GOTREF(__pyx_t_1);
13407   __pyx_v__dict = __pyx_t_1;
13408   __pyx_t_1 = 0;
13409 
13410   /* "(tree fragment)":7
13411  *     state = (self.name,)
13412  *     _dict = getattr(self, '__dict__', None)
13413  *     if _dict is not None:             # <<<<<<<<<<<<<<
13414  *         state += (_dict,)
13415  *         use_setstate = True
13416  */
13417   __pyx_t_2 = (__pyx_v__dict != Py_None);
13418   __pyx_t_3 = (__pyx_t_2 != 0);
13419   if (__pyx_t_3) {
13420 
13421     /* "(tree fragment)":8
13422  *     _dict = getattr(self, '__dict__', None)
13423  *     if _dict is not None:
13424  *         state += (_dict,)             # <<<<<<<<<<<<<<
13425  *         use_setstate = True
13426  *     else:
13427  */
13428     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
13429     __Pyx_GOTREF(__pyx_t_1);
13430     __Pyx_INCREF(__pyx_v__dict);
13431     __Pyx_GIVEREF(__pyx_v__dict);
13432     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
13433     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
13434     __Pyx_GOTREF(__pyx_t_4);
13435     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13436     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
13437     __pyx_t_4 = 0;
13438 
13439     /* "(tree fragment)":9
13440  *     if _dict is not None:
13441  *         state += (_dict,)
13442  *         use_setstate = True             # <<<<<<<<<<<<<<
13443  *     else:
13444  *         use_setstate = self.name is not None
13445  */
13446     __pyx_v_use_setstate = 1;
13447 
13448     /* "(tree fragment)":7
13449  *     state = (self.name,)
13450  *     _dict = getattr(self, '__dict__', None)
13451  *     if _dict is not None:             # <<<<<<<<<<<<<<
13452  *         state += (_dict,)
13453  *         use_setstate = True
13454  */
13455     goto __pyx_L3;
13456   }
13457 
13458   /* "(tree fragment)":11
13459  *         use_setstate = True
13460  *     else:
13461  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
13462  *     if use_setstate:
13463  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13464  */
13465   /*else*/ {
13466     __pyx_t_3 = (__pyx_v_self->name != Py_None);
13467     __pyx_v_use_setstate = __pyx_t_3;
13468   }
13469   __pyx_L3:;
13470 
13471   /* "(tree fragment)":12
13472  *     else:
13473  *         use_setstate = self.name is not None
13474  *     if use_setstate:             # <<<<<<<<<<<<<<
13475  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13476  *     else:
13477  */
13478   __pyx_t_3 = (__pyx_v_use_setstate != 0);
13479   if (__pyx_t_3) {
13480 
13481     /* "(tree fragment)":13
13482  *         use_setstate = self.name is not None
13483  *     if use_setstate:
13484  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
13485  *     else:
13486  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13487  */
13488     __Pyx_XDECREF(__pyx_r);
13489     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
13490     __Pyx_GOTREF(__pyx_t_4);
13491     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
13492     __Pyx_GOTREF(__pyx_t_1);
13493     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13494     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13495     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13496     __Pyx_INCREF(__pyx_int_184977713);
13497     __Pyx_GIVEREF(__pyx_int_184977713);
13498     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13499     __Pyx_INCREF(Py_None);
13500     __Pyx_GIVEREF(Py_None);
13501     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
13502     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
13503     __Pyx_GOTREF(__pyx_t_5);
13504     __Pyx_GIVEREF(__pyx_t_4);
13505     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
13506     __Pyx_GIVEREF(__pyx_t_1);
13507     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
13508     __Pyx_INCREF(__pyx_v_state);
13509     __Pyx_GIVEREF(__pyx_v_state);
13510     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
13511     __pyx_t_4 = 0;
13512     __pyx_t_1 = 0;
13513     __pyx_r = __pyx_t_5;
13514     __pyx_t_5 = 0;
13515     goto __pyx_L0;
13516 
13517     /* "(tree fragment)":12
13518  *     else:
13519  *         use_setstate = self.name is not None
13520  *     if use_setstate:             # <<<<<<<<<<<<<<
13521  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13522  *     else:
13523  */
13524   }
13525 
13526   /* "(tree fragment)":15
13527  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
13528  *     else:
13529  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
13530  * def __setstate_cython__(self, __pyx_state):
13531  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
13532  */
13533   /*else*/ {
13534     __Pyx_XDECREF(__pyx_r);
13535     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
13536     __Pyx_GOTREF(__pyx_t_5);
13537     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
13538     __Pyx_GOTREF(__pyx_t_1);
13539     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13540     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13541     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13542     __Pyx_INCREF(__pyx_int_184977713);
13543     __Pyx_GIVEREF(__pyx_int_184977713);
13544     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
13545     __Pyx_INCREF(__pyx_v_state);
13546     __Pyx_GIVEREF(__pyx_v_state);
13547     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
13548     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
13549     __Pyx_GOTREF(__pyx_t_4);
13550     __Pyx_GIVEREF(__pyx_t_5);
13551     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
13552     __Pyx_GIVEREF(__pyx_t_1);
13553     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
13554     __pyx_t_5 = 0;
13555     __pyx_t_1 = 0;
13556     __pyx_r = __pyx_t_4;
13557     __pyx_t_4 = 0;
13558     goto __pyx_L0;
13559   }
13560 
13561   /* "(tree fragment)":1
13562  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
13563  *     cdef tuple state
13564  *     cdef object _dict
13565  */
13566 
13567   /* function exit code */
13568   __pyx_L1_error:;
13569   __Pyx_XDECREF(__pyx_t_1);
13570   __Pyx_XDECREF(__pyx_t_4);
13571   __Pyx_XDECREF(__pyx_t_5);
13572   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13573   __pyx_r = NULL;
13574   __pyx_L0:;
13575   __Pyx_XDECREF(__pyx_v_state);
13576   __Pyx_XDECREF(__pyx_v__dict);
13577   __Pyx_XGIVEREF(__pyx_r);
13578   __Pyx_RefNannyFinishContext();
13579   return __pyx_r;
13580 }
13581 
13582 /* "(tree fragment)":16
13583  *     else:
13584  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13585  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
13586  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
13587  */
13588 
13589 /* Python wrapper */
13590 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)13591 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13592   PyObject *__pyx_r = 0;
13593   __Pyx_RefNannyDeclarations
13594   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13595   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13596 
13597   /* function exit code */
13598   __Pyx_RefNannyFinishContext();
13599   return __pyx_r;
13600 }
13601 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)13602 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13603   PyObject *__pyx_r = NULL;
13604   __Pyx_RefNannyDeclarations
13605   PyObject *__pyx_t_1 = NULL;
13606   int __pyx_lineno = 0;
13607   const char *__pyx_filename = NULL;
13608   int __pyx_clineno = 0;
13609   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13610 
13611   /* "(tree fragment)":17
13612  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13613  * def __setstate_cython__(self, __pyx_state):
13614  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
13615  */
13616   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
13617   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
13618   __Pyx_GOTREF(__pyx_t_1);
13619   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13620 
13621   /* "(tree fragment)":16
13622  *     else:
13623  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
13624  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
13625  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
13626  */
13627 
13628   /* function exit code */
13629   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13630   goto __pyx_L0;
13631   __pyx_L1_error:;
13632   __Pyx_XDECREF(__pyx_t_1);
13633   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13634   __pyx_r = NULL;
13635   __pyx_L0:;
13636   __Pyx_XGIVEREF(__pyx_r);
13637   __Pyx_RefNannyFinishContext();
13638   return __pyx_r;
13639 }
13640 
13641 /* "View.MemoryView":298
13642  *
13643  * @cname('__pyx_align_pointer')
13644  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
13645  *     "Align pointer memory on a given boundary"
13646  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
13647  */
13648 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)13649 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
13650   Py_intptr_t __pyx_v_aligned_p;
13651   size_t __pyx_v_offset;
13652   void *__pyx_r;
13653   int __pyx_t_1;
13654 
13655   /* "View.MemoryView":300
13656  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
13657  *     "Align pointer memory on a given boundary"
13658  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
13659  *     cdef size_t offset
13660  *
13661  */
13662   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
13663 
13664   /* "View.MemoryView":304
13665  *
13666  *     with cython.cdivision(True):
13667  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
13668  *
13669  *     if offset > 0:
13670  */
13671   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
13672 
13673   /* "View.MemoryView":306
13674  *         offset = aligned_p % alignment
13675  *
13676  *     if offset > 0:             # <<<<<<<<<<<<<<
13677  *         aligned_p += alignment - offset
13678  *
13679  */
13680   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
13681   if (__pyx_t_1) {
13682 
13683     /* "View.MemoryView":307
13684  *
13685  *     if offset > 0:
13686  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
13687  *
13688  *     return <void *> aligned_p
13689  */
13690     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
13691 
13692     /* "View.MemoryView":306
13693  *         offset = aligned_p % alignment
13694  *
13695  *     if offset > 0:             # <<<<<<<<<<<<<<
13696  *         aligned_p += alignment - offset
13697  *
13698  */
13699   }
13700 
13701   /* "View.MemoryView":309
13702  *         aligned_p += alignment - offset
13703  *
13704  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
13705  *
13706  *
13707  */
13708   __pyx_r = ((void *)__pyx_v_aligned_p);
13709   goto __pyx_L0;
13710 
13711   /* "View.MemoryView":298
13712  *
13713  * @cname('__pyx_align_pointer')
13714  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
13715  *     "Align pointer memory on a given boundary"
13716  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
13717  */
13718 
13719   /* function exit code */
13720   __pyx_L0:;
13721   return __pyx_r;
13722 }
13723 
13724 /* "View.MemoryView":345
13725  *     cdef __Pyx_TypeInfo *typeinfo
13726  *
13727  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
13728  *         self.obj = obj
13729  *         self.flags = flags
13730  */
13731 
13732 /* Python wrapper */
13733 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_memoryview___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13734 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13735   PyObject *__pyx_v_obj = 0;
13736   int __pyx_v_flags;
13737   int __pyx_v_dtype_is_object;
13738   int __pyx_lineno = 0;
13739   const char *__pyx_filename = NULL;
13740   int __pyx_clineno = 0;
13741   int __pyx_r;
13742   __Pyx_RefNannyDeclarations
13743   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
13744   {
13745     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
13746     PyObject* values[3] = {0,0,0};
13747     if (unlikely(__pyx_kwds)) {
13748       Py_ssize_t kw_args;
13749       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13750       switch (pos_args) {
13751         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13752         CYTHON_FALLTHROUGH;
13753         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13754         CYTHON_FALLTHROUGH;
13755         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13756         CYTHON_FALLTHROUGH;
13757         case  0: break;
13758         default: goto __pyx_L5_argtuple_error;
13759       }
13760       kw_args = PyDict_Size(__pyx_kwds);
13761       switch (pos_args) {
13762         case  0:
13763         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
13764         else goto __pyx_L5_argtuple_error;
13765         CYTHON_FALLTHROUGH;
13766         case  1:
13767         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
13768         else {
13769           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
13770         }
13771         CYTHON_FALLTHROUGH;
13772         case  2:
13773         if (kw_args > 0) {
13774           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
13775           if (value) { values[2] = value; kw_args--; }
13776         }
13777       }
13778       if (unlikely(kw_args > 0)) {
13779         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
13780       }
13781     } else {
13782       switch (PyTuple_GET_SIZE(__pyx_args)) {
13783         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13784         CYTHON_FALLTHROUGH;
13785         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13786         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13787         break;
13788         default: goto __pyx_L5_argtuple_error;
13789       }
13790     }
13791     __pyx_v_obj = values[0];
13792     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
13793     if (values[2]) {
13794       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
13795     } else {
13796       __pyx_v_dtype_is_object = ((int)0);
13797     }
13798   }
13799   goto __pyx_L4_argument_unpacking_done;
13800   __pyx_L5_argtuple_error:;
13801   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
13802   __pyx_L3_error:;
13803   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13804   __Pyx_RefNannyFinishContext();
13805   return -1;
13806   __pyx_L4_argument_unpacking_done:;
13807   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
13808 
13809   /* function exit code */
13810   __Pyx_RefNannyFinishContext();
13811   return __pyx_r;
13812 }
13813 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj,int __pyx_v_flags,int __pyx_v_dtype_is_object)13814 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
13815   int __pyx_r;
13816   __Pyx_RefNannyDeclarations
13817   int __pyx_t_1;
13818   int __pyx_t_2;
13819   int __pyx_t_3;
13820   int __pyx_t_4;
13821   int __pyx_lineno = 0;
13822   const char *__pyx_filename = NULL;
13823   int __pyx_clineno = 0;
13824   __Pyx_RefNannySetupContext("__cinit__", 0);
13825 
13826   /* "View.MemoryView":346
13827  *
13828  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
13829  *         self.obj = obj             # <<<<<<<<<<<<<<
13830  *         self.flags = flags
13831  *         if type(self) is memoryview or obj is not None:
13832  */
13833   __Pyx_INCREF(__pyx_v_obj);
13834   __Pyx_GIVEREF(__pyx_v_obj);
13835   __Pyx_GOTREF(__pyx_v_self->obj);
13836   __Pyx_DECREF(__pyx_v_self->obj);
13837   __pyx_v_self->obj = __pyx_v_obj;
13838 
13839   /* "View.MemoryView":347
13840  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
13841  *         self.obj = obj
13842  *         self.flags = flags             # <<<<<<<<<<<<<<
13843  *         if type(self) is memoryview or obj is not None:
13844  *             __Pyx_GetBuffer(obj, &self.view, flags)
13845  */
13846   __pyx_v_self->flags = __pyx_v_flags;
13847 
13848   /* "View.MemoryView":348
13849  *         self.obj = obj
13850  *         self.flags = flags
13851  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
13852  *             __Pyx_GetBuffer(obj, &self.view, flags)
13853  *             if <PyObject *> self.view.obj == NULL:
13854  */
13855   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
13856   __pyx_t_3 = (__pyx_t_2 != 0);
13857   if (!__pyx_t_3) {
13858   } else {
13859     __pyx_t_1 = __pyx_t_3;
13860     goto __pyx_L4_bool_binop_done;
13861   }
13862   __pyx_t_3 = (__pyx_v_obj != Py_None);
13863   __pyx_t_2 = (__pyx_t_3 != 0);
13864   __pyx_t_1 = __pyx_t_2;
13865   __pyx_L4_bool_binop_done:;
13866   if (__pyx_t_1) {
13867 
13868     /* "View.MemoryView":349
13869  *         self.flags = flags
13870  *         if type(self) is memoryview or obj is not None:
13871  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
13872  *             if <PyObject *> self.view.obj == NULL:
13873  *                 (<__pyx_buffer *> &self.view).obj = Py_None
13874  */
13875     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
13876 
13877     /* "View.MemoryView":350
13878  *         if type(self) is memoryview or obj is not None:
13879  *             __Pyx_GetBuffer(obj, &self.view, flags)
13880  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
13881  *                 (<__pyx_buffer *> &self.view).obj = Py_None
13882  *                 Py_INCREF(Py_None)
13883  */
13884     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
13885     if (__pyx_t_1) {
13886 
13887       /* "View.MemoryView":351
13888  *             __Pyx_GetBuffer(obj, &self.view, flags)
13889  *             if <PyObject *> self.view.obj == NULL:
13890  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
13891  *                 Py_INCREF(Py_None)
13892  *
13893  */
13894       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
13895 
13896       /* "View.MemoryView":352
13897  *             if <PyObject *> self.view.obj == NULL:
13898  *                 (<__pyx_buffer *> &self.view).obj = Py_None
13899  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
13900  *
13901  *         global __pyx_memoryview_thread_locks_used
13902  */
13903       Py_INCREF(Py_None);
13904 
13905       /* "View.MemoryView":350
13906  *         if type(self) is memoryview or obj is not None:
13907  *             __Pyx_GetBuffer(obj, &self.view, flags)
13908  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
13909  *                 (<__pyx_buffer *> &self.view).obj = Py_None
13910  *                 Py_INCREF(Py_None)
13911  */
13912     }
13913 
13914     /* "View.MemoryView":348
13915  *         self.obj = obj
13916  *         self.flags = flags
13917  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
13918  *             __Pyx_GetBuffer(obj, &self.view, flags)
13919  *             if <PyObject *> self.view.obj == NULL:
13920  */
13921   }
13922 
13923   /* "View.MemoryView":355
13924  *
13925  *         global __pyx_memoryview_thread_locks_used
13926  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
13927  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
13928  *             __pyx_memoryview_thread_locks_used += 1
13929  */
13930   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
13931   if (__pyx_t_1) {
13932 
13933     /* "View.MemoryView":356
13934  *         global __pyx_memoryview_thread_locks_used
13935  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
13936  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
13937  *             __pyx_memoryview_thread_locks_used += 1
13938  *         if self.lock is NULL:
13939  */
13940     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
13941 
13942     /* "View.MemoryView":357
13943  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
13944  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
13945  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
13946  *         if self.lock is NULL:
13947  *             self.lock = PyThread_allocate_lock()
13948  */
13949     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
13950 
13951     /* "View.MemoryView":355
13952  *
13953  *         global __pyx_memoryview_thread_locks_used
13954  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
13955  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
13956  *             __pyx_memoryview_thread_locks_used += 1
13957  */
13958   }
13959 
13960   /* "View.MemoryView":358
13961  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
13962  *             __pyx_memoryview_thread_locks_used += 1
13963  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
13964  *             self.lock = PyThread_allocate_lock()
13965  *             if self.lock is NULL:
13966  */
13967   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
13968   if (__pyx_t_1) {
13969 
13970     /* "View.MemoryView":359
13971  *             __pyx_memoryview_thread_locks_used += 1
13972  *         if self.lock is NULL:
13973  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
13974  *             if self.lock is NULL:
13975  *                 raise MemoryError
13976  */
13977     __pyx_v_self->lock = PyThread_allocate_lock();
13978 
13979     /* "View.MemoryView":360
13980  *         if self.lock is NULL:
13981  *             self.lock = PyThread_allocate_lock()
13982  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
13983  *                 raise MemoryError
13984  *
13985  */
13986     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
13987     if (unlikely(__pyx_t_1)) {
13988 
13989       /* "View.MemoryView":361
13990  *             self.lock = PyThread_allocate_lock()
13991  *             if self.lock is NULL:
13992  *                 raise MemoryError             # <<<<<<<<<<<<<<
13993  *
13994  *         if flags & PyBUF_FORMAT:
13995  */
13996       PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
13997 
13998       /* "View.MemoryView":360
13999  *         if self.lock is NULL:
14000  *             self.lock = PyThread_allocate_lock()
14001  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
14002  *                 raise MemoryError
14003  *
14004  */
14005     }
14006 
14007     /* "View.MemoryView":358
14008  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
14009  *             __pyx_memoryview_thread_locks_used += 1
14010  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
14011  *             self.lock = PyThread_allocate_lock()
14012  *             if self.lock is NULL:
14013  */
14014   }
14015 
14016   /* "View.MemoryView":363
14017  *                 raise MemoryError
14018  *
14019  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
14020  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14021  *         else:
14022  */
14023   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
14024   if (__pyx_t_1) {
14025 
14026     /* "View.MemoryView":364
14027  *
14028  *         if flags & PyBUF_FORMAT:
14029  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
14030  *         else:
14031  *             self.dtype_is_object = dtype_is_object
14032  */
14033     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
14034     if (__pyx_t_2) {
14035     } else {
14036       __pyx_t_1 = __pyx_t_2;
14037       goto __pyx_L11_bool_binop_done;
14038     }
14039     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
14040     __pyx_t_1 = __pyx_t_2;
14041     __pyx_L11_bool_binop_done:;
14042     __pyx_v_self->dtype_is_object = __pyx_t_1;
14043 
14044     /* "View.MemoryView":363
14045  *                 raise MemoryError
14046  *
14047  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
14048  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14049  *         else:
14050  */
14051     goto __pyx_L10;
14052   }
14053 
14054   /* "View.MemoryView":366
14055  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
14056  *         else:
14057  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
14058  *
14059  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
14060  */
14061   /*else*/ {
14062     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
14063   }
14064   __pyx_L10:;
14065 
14066   /* "View.MemoryView":368
14067  *             self.dtype_is_object = dtype_is_object
14068  *
14069  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
14070  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
14071  *         self.typeinfo = NULL
14072  */
14073   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
14074 
14075   /* "View.MemoryView":370
14076  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
14077  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
14078  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
14079  *
14080  *     def __dealloc__(memoryview self):
14081  */
14082   __pyx_v_self->typeinfo = NULL;
14083 
14084   /* "View.MemoryView":345
14085  *     cdef __Pyx_TypeInfo *typeinfo
14086  *
14087  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
14088  *         self.obj = obj
14089  *         self.flags = flags
14090  */
14091 
14092   /* function exit code */
14093   __pyx_r = 0;
14094   goto __pyx_L0;
14095   __pyx_L1_error:;
14096   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14097   __pyx_r = -1;
14098   __pyx_L0:;
14099   __Pyx_RefNannyFinishContext();
14100   return __pyx_r;
14101 }
14102 
14103 /* "View.MemoryView":372
14104  *         self.typeinfo = NULL
14105  *
14106  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
14107  *         if self.obj is not None:
14108  *             __Pyx_ReleaseBuffer(&self.view)
14109  */
14110 
14111 /* Python wrapper */
14112 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)14113 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
14114   __Pyx_RefNannyDeclarations
14115   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14116   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14117 
14118   /* function exit code */
14119   __Pyx_RefNannyFinishContext();
14120 }
14121 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)14122 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
14123   int __pyx_v_i;
14124   __Pyx_RefNannyDeclarations
14125   int __pyx_t_1;
14126   int __pyx_t_2;
14127   int __pyx_t_3;
14128   int __pyx_t_4;
14129   int __pyx_t_5;
14130   PyThread_type_lock __pyx_t_6;
14131   PyThread_type_lock __pyx_t_7;
14132   __Pyx_RefNannySetupContext("__dealloc__", 0);
14133 
14134   /* "View.MemoryView":373
14135  *
14136  *     def __dealloc__(memoryview self):
14137  *         if self.obj is not None:             # <<<<<<<<<<<<<<
14138  *             __Pyx_ReleaseBuffer(&self.view)
14139  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
14140  */
14141   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
14142   __pyx_t_2 = (__pyx_t_1 != 0);
14143   if (__pyx_t_2) {
14144 
14145     /* "View.MemoryView":374
14146  *     def __dealloc__(memoryview self):
14147  *         if self.obj is not None:
14148  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
14149  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
14150  *
14151  */
14152     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
14153 
14154     /* "View.MemoryView":373
14155  *
14156  *     def __dealloc__(memoryview self):
14157  *         if self.obj is not None:             # <<<<<<<<<<<<<<
14158  *             __Pyx_ReleaseBuffer(&self.view)
14159  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
14160  */
14161     goto __pyx_L3;
14162   }
14163 
14164   /* "View.MemoryView":375
14165  *         if self.obj is not None:
14166  *             __Pyx_ReleaseBuffer(&self.view)
14167  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
14168  *
14169  *             (<__pyx_buffer *> &self.view).obj = NULL
14170  */
14171   __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
14172   if (__pyx_t_2) {
14173 
14174     /* "View.MemoryView":377
14175  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
14176  *
14177  *             (<__pyx_buffer *> &self.view).obj = NULL             # <<<<<<<<<<<<<<
14178  *             Py_DECREF(Py_None)
14179  *
14180  */
14181     ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
14182 
14183     /* "View.MemoryView":378
14184  *
14185  *             (<__pyx_buffer *> &self.view).obj = NULL
14186  *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
14187  *
14188  *         cdef int i
14189  */
14190     Py_DECREF(Py_None);
14191 
14192     /* "View.MemoryView":375
14193  *         if self.obj is not None:
14194  *             __Pyx_ReleaseBuffer(&self.view)
14195  *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
14196  *
14197  *             (<__pyx_buffer *> &self.view).obj = NULL
14198  */
14199   }
14200   __pyx_L3:;
14201 
14202   /* "View.MemoryView":382
14203  *         cdef int i
14204  *         global __pyx_memoryview_thread_locks_used
14205  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
14206  *             for i in range(__pyx_memoryview_thread_locks_used):
14207  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
14208  */
14209   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
14210   if (__pyx_t_2) {
14211 
14212     /* "View.MemoryView":383
14213  *         global __pyx_memoryview_thread_locks_used
14214  *         if self.lock != NULL:
14215  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
14216  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
14217  *                     __pyx_memoryview_thread_locks_used -= 1
14218  */
14219     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
14220     __pyx_t_4 = __pyx_t_3;
14221     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
14222       __pyx_v_i = __pyx_t_5;
14223 
14224       /* "View.MemoryView":384
14225  *         if self.lock != NULL:
14226  *             for i in range(__pyx_memoryview_thread_locks_used):
14227  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
14228  *                     __pyx_memoryview_thread_locks_used -= 1
14229  *                     if i != __pyx_memoryview_thread_locks_used:
14230  */
14231       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
14232       if (__pyx_t_2) {
14233 
14234         /* "View.MemoryView":385
14235  *             for i in range(__pyx_memoryview_thread_locks_used):
14236  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
14237  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
14238  *                     if i != __pyx_memoryview_thread_locks_used:
14239  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14240  */
14241         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
14242 
14243         /* "View.MemoryView":386
14244  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
14245  *                     __pyx_memoryview_thread_locks_used -= 1
14246  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
14247  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14248  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14249  */
14250         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
14251         if (__pyx_t_2) {
14252 
14253           /* "View.MemoryView":388
14254  *                     if i != __pyx_memoryview_thread_locks_used:
14255  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14256  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
14257  *                     break
14258  *             else:
14259  */
14260           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
14261           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
14262 
14263           /* "View.MemoryView":387
14264  *                     __pyx_memoryview_thread_locks_used -= 1
14265  *                     if i != __pyx_memoryview_thread_locks_used:
14266  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
14267  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14268  *                     break
14269  */
14270           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
14271           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
14272 
14273           /* "View.MemoryView":386
14274  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
14275  *                     __pyx_memoryview_thread_locks_used -= 1
14276  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
14277  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14278  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14279  */
14280         }
14281 
14282         /* "View.MemoryView":389
14283  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
14284  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
14285  *                     break             # <<<<<<<<<<<<<<
14286  *             else:
14287  *                 PyThread_free_lock(self.lock)
14288  */
14289         goto __pyx_L6_break;
14290 
14291         /* "View.MemoryView":384
14292  *         if self.lock != NULL:
14293  *             for i in range(__pyx_memoryview_thread_locks_used):
14294  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
14295  *                     __pyx_memoryview_thread_locks_used -= 1
14296  *                     if i != __pyx_memoryview_thread_locks_used:
14297  */
14298       }
14299     }
14300     /*else*/ {
14301 
14302       /* "View.MemoryView":391
14303  *                     break
14304  *             else:
14305  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
14306  *
14307  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
14308  */
14309       PyThread_free_lock(__pyx_v_self->lock);
14310     }
14311     __pyx_L6_break:;
14312 
14313     /* "View.MemoryView":382
14314  *         cdef int i
14315  *         global __pyx_memoryview_thread_locks_used
14316  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
14317  *             for i in range(__pyx_memoryview_thread_locks_used):
14318  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
14319  */
14320   }
14321 
14322   /* "View.MemoryView":372
14323  *         self.typeinfo = NULL
14324  *
14325  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
14326  *         if self.obj is not None:
14327  *             __Pyx_ReleaseBuffer(&self.view)
14328  */
14329 
14330   /* function exit code */
14331   __Pyx_RefNannyFinishContext();
14332 }
14333 
14334 /* "View.MemoryView":393
14335  *                 PyThread_free_lock(self.lock)
14336  *
14337  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
14338  *         cdef Py_ssize_t dim
14339  *         cdef char *itemp = <char *> self.view.buf
14340  */
14341 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)14342 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14343   Py_ssize_t __pyx_v_dim;
14344   char *__pyx_v_itemp;
14345   PyObject *__pyx_v_idx = NULL;
14346   char *__pyx_r;
14347   __Pyx_RefNannyDeclarations
14348   Py_ssize_t __pyx_t_1;
14349   PyObject *__pyx_t_2 = NULL;
14350   Py_ssize_t __pyx_t_3;
14351   PyObject *(*__pyx_t_4)(PyObject *);
14352   PyObject *__pyx_t_5 = NULL;
14353   Py_ssize_t __pyx_t_6;
14354   char *__pyx_t_7;
14355   int __pyx_lineno = 0;
14356   const char *__pyx_filename = NULL;
14357   int __pyx_clineno = 0;
14358   __Pyx_RefNannySetupContext("get_item_pointer", 0);
14359 
14360   /* "View.MemoryView":395
14361  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
14362  *         cdef Py_ssize_t dim
14363  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
14364  *
14365  *         for dim, idx in enumerate(index):
14366  */
14367   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
14368 
14369   /* "View.MemoryView":397
14370  *         cdef char *itemp = <char *> self.view.buf
14371  *
14372  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
14373  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
14374  *
14375  */
14376   __pyx_t_1 = 0;
14377   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
14378     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
14379     __pyx_t_4 = NULL;
14380   } else {
14381     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
14382     __Pyx_GOTREF(__pyx_t_2);
14383     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
14384   }
14385   for (;;) {
14386     if (likely(!__pyx_t_4)) {
14387       if (likely(PyList_CheckExact(__pyx_t_2))) {
14388         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
14389         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14390         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
14391         #else
14392         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
14393         __Pyx_GOTREF(__pyx_t_5);
14394         #endif
14395       } else {
14396         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
14397         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14398         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
14399         #else
14400         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
14401         __Pyx_GOTREF(__pyx_t_5);
14402         #endif
14403       }
14404     } else {
14405       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
14406       if (unlikely(!__pyx_t_5)) {
14407         PyObject* exc_type = PyErr_Occurred();
14408         if (exc_type) {
14409           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14410           else __PYX_ERR(1, 397, __pyx_L1_error)
14411         }
14412         break;
14413       }
14414       __Pyx_GOTREF(__pyx_t_5);
14415     }
14416     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
14417     __pyx_t_5 = 0;
14418     __pyx_v_dim = __pyx_t_1;
14419     __pyx_t_1 = (__pyx_t_1 + 1);
14420 
14421     /* "View.MemoryView":398
14422  *
14423  *         for dim, idx in enumerate(index):
14424  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
14425  *
14426  *         return itemp
14427  */
14428     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
14429     __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
14430     __pyx_v_itemp = __pyx_t_7;
14431 
14432     /* "View.MemoryView":397
14433  *         cdef char *itemp = <char *> self.view.buf
14434  *
14435  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
14436  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
14437  *
14438  */
14439   }
14440   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14441 
14442   /* "View.MemoryView":400
14443  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
14444  *
14445  *         return itemp             # <<<<<<<<<<<<<<
14446  *
14447  *
14448  */
14449   __pyx_r = __pyx_v_itemp;
14450   goto __pyx_L0;
14451 
14452   /* "View.MemoryView":393
14453  *                 PyThread_free_lock(self.lock)
14454  *
14455  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
14456  *         cdef Py_ssize_t dim
14457  *         cdef char *itemp = <char *> self.view.buf
14458  */
14459 
14460   /* function exit code */
14461   __pyx_L1_error:;
14462   __Pyx_XDECREF(__pyx_t_2);
14463   __Pyx_XDECREF(__pyx_t_5);
14464   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
14465   __pyx_r = NULL;
14466   __pyx_L0:;
14467   __Pyx_XDECREF(__pyx_v_idx);
14468   __Pyx_RefNannyFinishContext();
14469   return __pyx_r;
14470 }
14471 
14472 /* "View.MemoryView":403
14473  *
14474  *
14475  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
14476  *         if index is Ellipsis:
14477  *             return self
14478  */
14479 
14480 /* Python wrapper */
14481 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
__pyx_memoryview___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index)14482 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
14483   PyObject *__pyx_r = 0;
14484   __Pyx_RefNannyDeclarations
14485   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
14486   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
14487 
14488   /* function exit code */
14489   __Pyx_RefNannyFinishContext();
14490   return __pyx_r;
14491 }
14492 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)14493 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
14494   PyObject *__pyx_v_have_slices = NULL;
14495   PyObject *__pyx_v_indices = NULL;
14496   char *__pyx_v_itemp;
14497   PyObject *__pyx_r = NULL;
14498   __Pyx_RefNannyDeclarations
14499   int __pyx_t_1;
14500   int __pyx_t_2;
14501   PyObject *__pyx_t_3 = NULL;
14502   PyObject *__pyx_t_4 = NULL;
14503   PyObject *__pyx_t_5 = NULL;
14504   char *__pyx_t_6;
14505   int __pyx_lineno = 0;
14506   const char *__pyx_filename = NULL;
14507   int __pyx_clineno = 0;
14508   __Pyx_RefNannySetupContext("__getitem__", 0);
14509 
14510   /* "View.MemoryView":404
14511  *
14512  *     def __getitem__(memoryview self, object index):
14513  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
14514  *             return self
14515  *
14516  */
14517   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
14518   __pyx_t_2 = (__pyx_t_1 != 0);
14519   if (__pyx_t_2) {
14520 
14521     /* "View.MemoryView":405
14522  *     def __getitem__(memoryview self, object index):
14523  *         if index is Ellipsis:
14524  *             return self             # <<<<<<<<<<<<<<
14525  *
14526  *         have_slices, indices = _unellipsify(index, self.view.ndim)
14527  */
14528     __Pyx_XDECREF(__pyx_r);
14529     __Pyx_INCREF(((PyObject *)__pyx_v_self));
14530     __pyx_r = ((PyObject *)__pyx_v_self);
14531     goto __pyx_L0;
14532 
14533     /* "View.MemoryView":404
14534  *
14535  *     def __getitem__(memoryview self, object index):
14536  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
14537  *             return self
14538  *
14539  */
14540   }
14541 
14542   /* "View.MemoryView":407
14543  *             return self
14544  *
14545  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
14546  *
14547  *         cdef char *itemp
14548  */
14549   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
14550   __Pyx_GOTREF(__pyx_t_3);
14551   if (likely(__pyx_t_3 != Py_None)) {
14552     PyObject* sequence = __pyx_t_3;
14553     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14554     if (unlikely(size != 2)) {
14555       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14556       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14557       __PYX_ERR(1, 407, __pyx_L1_error)
14558     }
14559     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14560     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
14561     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
14562     __Pyx_INCREF(__pyx_t_4);
14563     __Pyx_INCREF(__pyx_t_5);
14564     #else
14565     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
14566     __Pyx_GOTREF(__pyx_t_4);
14567     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
14568     __Pyx_GOTREF(__pyx_t_5);
14569     #endif
14570     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14571   } else {
14572     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
14573   }
14574   __pyx_v_have_slices = __pyx_t_4;
14575   __pyx_t_4 = 0;
14576   __pyx_v_indices = __pyx_t_5;
14577   __pyx_t_5 = 0;
14578 
14579   /* "View.MemoryView":410
14580  *
14581  *         cdef char *itemp
14582  *         if have_slices:             # <<<<<<<<<<<<<<
14583  *             return memview_slice(self, indices)
14584  *         else:
14585  */
14586   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
14587   if (__pyx_t_2) {
14588 
14589     /* "View.MemoryView":411
14590  *         cdef char *itemp
14591  *         if have_slices:
14592  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
14593  *         else:
14594  *             itemp = self.get_item_pointer(indices)
14595  */
14596     __Pyx_XDECREF(__pyx_r);
14597     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
14598     __Pyx_GOTREF(__pyx_t_3);
14599     __pyx_r = __pyx_t_3;
14600     __pyx_t_3 = 0;
14601     goto __pyx_L0;
14602 
14603     /* "View.MemoryView":410
14604  *
14605  *         cdef char *itemp
14606  *         if have_slices:             # <<<<<<<<<<<<<<
14607  *             return memview_slice(self, indices)
14608  *         else:
14609  */
14610   }
14611 
14612   /* "View.MemoryView":413
14613  *             return memview_slice(self, indices)
14614  *         else:
14615  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
14616  *             return self.convert_item_to_object(itemp)
14617  *
14618  */
14619   /*else*/ {
14620     __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
14621     __pyx_v_itemp = __pyx_t_6;
14622 
14623     /* "View.MemoryView":414
14624  *         else:
14625  *             itemp = self.get_item_pointer(indices)
14626  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
14627  *
14628  *     def __setitem__(memoryview self, object index, object value):
14629  */
14630     __Pyx_XDECREF(__pyx_r);
14631     __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
14632     __Pyx_GOTREF(__pyx_t_3);
14633     __pyx_r = __pyx_t_3;
14634     __pyx_t_3 = 0;
14635     goto __pyx_L0;
14636   }
14637 
14638   /* "View.MemoryView":403
14639  *
14640  *
14641  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
14642  *         if index is Ellipsis:
14643  *             return self
14644  */
14645 
14646   /* function exit code */
14647   __pyx_L1_error:;
14648   __Pyx_XDECREF(__pyx_t_3);
14649   __Pyx_XDECREF(__pyx_t_4);
14650   __Pyx_XDECREF(__pyx_t_5);
14651   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14652   __pyx_r = NULL;
14653   __pyx_L0:;
14654   __Pyx_XDECREF(__pyx_v_have_slices);
14655   __Pyx_XDECREF(__pyx_v_indices);
14656   __Pyx_XGIVEREF(__pyx_r);
14657   __Pyx_RefNannyFinishContext();
14658   return __pyx_r;
14659 }
14660 
14661 /* "View.MemoryView":416
14662  *             return self.convert_item_to_object(itemp)
14663  *
14664  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
14665  *         if self.view.readonly:
14666  *             raise TypeError("Cannot assign to read-only memoryview")
14667  */
14668 
14669 /* Python wrapper */
14670 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
__pyx_memoryview___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)14671 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14672   int __pyx_r;
14673   __Pyx_RefNannyDeclarations
14674   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
14675   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
14676 
14677   /* function exit code */
14678   __Pyx_RefNannyFinishContext();
14679   return __pyx_r;
14680 }
14681 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)14682 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14683   PyObject *__pyx_v_have_slices = NULL;
14684   PyObject *__pyx_v_obj = NULL;
14685   int __pyx_r;
14686   __Pyx_RefNannyDeclarations
14687   int __pyx_t_1;
14688   PyObject *__pyx_t_2 = NULL;
14689   PyObject *__pyx_t_3 = NULL;
14690   PyObject *__pyx_t_4 = NULL;
14691   int __pyx_lineno = 0;
14692   const char *__pyx_filename = NULL;
14693   int __pyx_clineno = 0;
14694   __Pyx_RefNannySetupContext("__setitem__", 0);
14695   __Pyx_INCREF(__pyx_v_index);
14696 
14697   /* "View.MemoryView":417
14698  *
14699  *     def __setitem__(memoryview self, object index, object value):
14700  *         if self.view.readonly:             # <<<<<<<<<<<<<<
14701  *             raise TypeError("Cannot assign to read-only memoryview")
14702  *
14703  */
14704   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
14705   if (unlikely(__pyx_t_1)) {
14706 
14707     /* "View.MemoryView":418
14708  *     def __setitem__(memoryview self, object index, object value):
14709  *         if self.view.readonly:
14710  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
14711  *
14712  *         have_slices, index = _unellipsify(index, self.view.ndim)
14713  */
14714     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
14715     __Pyx_GOTREF(__pyx_t_2);
14716     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14717     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14718     __PYX_ERR(1, 418, __pyx_L1_error)
14719 
14720     /* "View.MemoryView":417
14721  *
14722  *     def __setitem__(memoryview self, object index, object value):
14723  *         if self.view.readonly:             # <<<<<<<<<<<<<<
14724  *             raise TypeError("Cannot assign to read-only memoryview")
14725  *
14726  */
14727   }
14728 
14729   /* "View.MemoryView":420
14730  *             raise TypeError("Cannot assign to read-only memoryview")
14731  *
14732  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
14733  *
14734  *         if have_slices:
14735  */
14736   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
14737   __Pyx_GOTREF(__pyx_t_2);
14738   if (likely(__pyx_t_2 != Py_None)) {
14739     PyObject* sequence = __pyx_t_2;
14740     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14741     if (unlikely(size != 2)) {
14742       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14743       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14744       __PYX_ERR(1, 420, __pyx_L1_error)
14745     }
14746     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14747     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
14748     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
14749     __Pyx_INCREF(__pyx_t_3);
14750     __Pyx_INCREF(__pyx_t_4);
14751     #else
14752     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
14753     __Pyx_GOTREF(__pyx_t_3);
14754     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
14755     __Pyx_GOTREF(__pyx_t_4);
14756     #endif
14757     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14758   } else {
14759     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
14760   }
14761   __pyx_v_have_slices = __pyx_t_3;
14762   __pyx_t_3 = 0;
14763   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
14764   __pyx_t_4 = 0;
14765 
14766   /* "View.MemoryView":422
14767  *         have_slices, index = _unellipsify(index, self.view.ndim)
14768  *
14769  *         if have_slices:             # <<<<<<<<<<<<<<
14770  *             obj = self.is_slice(value)
14771  *             if obj:
14772  */
14773   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
14774   if (__pyx_t_1) {
14775 
14776     /* "View.MemoryView":423
14777  *
14778  *         if have_slices:
14779  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
14780  *             if obj:
14781  *                 self.setitem_slice_assignment(self[index], obj)
14782  */
14783     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
14784     __Pyx_GOTREF(__pyx_t_2);
14785     __pyx_v_obj = __pyx_t_2;
14786     __pyx_t_2 = 0;
14787 
14788     /* "View.MemoryView":424
14789  *         if have_slices:
14790  *             obj = self.is_slice(value)
14791  *             if obj:             # <<<<<<<<<<<<<<
14792  *                 self.setitem_slice_assignment(self[index], obj)
14793  *             else:
14794  */
14795     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
14796     if (__pyx_t_1) {
14797 
14798       /* "View.MemoryView":425
14799  *             obj = self.is_slice(value)
14800  *             if obj:
14801  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
14802  *             else:
14803  *                 self.setitem_slice_assign_scalar(self[index], value)
14804  */
14805       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
14806       __Pyx_GOTREF(__pyx_t_2);
14807       __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
14808       __Pyx_GOTREF(__pyx_t_4);
14809       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14810       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14811 
14812       /* "View.MemoryView":424
14813  *         if have_slices:
14814  *             obj = self.is_slice(value)
14815  *             if obj:             # <<<<<<<<<<<<<<
14816  *                 self.setitem_slice_assignment(self[index], obj)
14817  *             else:
14818  */
14819       goto __pyx_L5;
14820     }
14821 
14822     /* "View.MemoryView":427
14823  *                 self.setitem_slice_assignment(self[index], obj)
14824  *             else:
14825  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
14826  *         else:
14827  *             self.setitem_indexed(index, value)
14828  */
14829     /*else*/ {
14830       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
14831       __Pyx_GOTREF(__pyx_t_4);
14832       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
14833       __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
14834       __Pyx_GOTREF(__pyx_t_2);
14835       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14836       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14837     }
14838     __pyx_L5:;
14839 
14840     /* "View.MemoryView":422
14841  *         have_slices, index = _unellipsify(index, self.view.ndim)
14842  *
14843  *         if have_slices:             # <<<<<<<<<<<<<<
14844  *             obj = self.is_slice(value)
14845  *             if obj:
14846  */
14847     goto __pyx_L4;
14848   }
14849 
14850   /* "View.MemoryView":429
14851  *                 self.setitem_slice_assign_scalar(self[index], value)
14852  *         else:
14853  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
14854  *
14855  *     cdef is_slice(self, obj):
14856  */
14857   /*else*/ {
14858     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
14859     __Pyx_GOTREF(__pyx_t_2);
14860     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14861   }
14862   __pyx_L4:;
14863 
14864   /* "View.MemoryView":416
14865  *             return self.convert_item_to_object(itemp)
14866  *
14867  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
14868  *         if self.view.readonly:
14869  *             raise TypeError("Cannot assign to read-only memoryview")
14870  */
14871 
14872   /* function exit code */
14873   __pyx_r = 0;
14874   goto __pyx_L0;
14875   __pyx_L1_error:;
14876   __Pyx_XDECREF(__pyx_t_2);
14877   __Pyx_XDECREF(__pyx_t_3);
14878   __Pyx_XDECREF(__pyx_t_4);
14879   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14880   __pyx_r = -1;
14881   __pyx_L0:;
14882   __Pyx_XDECREF(__pyx_v_have_slices);
14883   __Pyx_XDECREF(__pyx_v_obj);
14884   __Pyx_XDECREF(__pyx_v_index);
14885   __Pyx_RefNannyFinishContext();
14886   return __pyx_r;
14887 }
14888 
14889 /* "View.MemoryView":431
14890  *             self.setitem_indexed(index, value)
14891  *
14892  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
14893  *         if not isinstance(obj, memoryview):
14894  *             try:
14895  */
14896 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)14897 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
14898   PyObject *__pyx_r = NULL;
14899   __Pyx_RefNannyDeclarations
14900   int __pyx_t_1;
14901   int __pyx_t_2;
14902   PyObject *__pyx_t_3 = NULL;
14903   PyObject *__pyx_t_4 = NULL;
14904   PyObject *__pyx_t_5 = NULL;
14905   PyObject *__pyx_t_6 = NULL;
14906   PyObject *__pyx_t_7 = NULL;
14907   PyObject *__pyx_t_8 = NULL;
14908   int __pyx_t_9;
14909   int __pyx_lineno = 0;
14910   const char *__pyx_filename = NULL;
14911   int __pyx_clineno = 0;
14912   __Pyx_RefNannySetupContext("is_slice", 0);
14913   __Pyx_INCREF(__pyx_v_obj);
14914 
14915   /* "View.MemoryView":432
14916  *
14917  *     cdef is_slice(self, obj):
14918  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
14919  *             try:
14920  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
14921  */
14922   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
14923   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14924   if (__pyx_t_2) {
14925 
14926     /* "View.MemoryView":433
14927  *     cdef is_slice(self, obj):
14928  *         if not isinstance(obj, memoryview):
14929  *             try:             # <<<<<<<<<<<<<<
14930  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
14931  *                                  self.dtype_is_object)
14932  */
14933     {
14934       __Pyx_PyThreadState_declare
14935       __Pyx_PyThreadState_assign
14936       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
14937       __Pyx_XGOTREF(__pyx_t_3);
14938       __Pyx_XGOTREF(__pyx_t_4);
14939       __Pyx_XGOTREF(__pyx_t_5);
14940       /*try:*/ {
14941 
14942         /* "View.MemoryView":434
14943  *         if not isinstance(obj, memoryview):
14944  *             try:
14945  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
14946  *                                  self.dtype_is_object)
14947  *             except TypeError:
14948  */
14949         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
14950         __Pyx_GOTREF(__pyx_t_6);
14951 
14952         /* "View.MemoryView":435
14953  *             try:
14954  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
14955  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
14956  *             except TypeError:
14957  *                 return None
14958  */
14959         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
14960         __Pyx_GOTREF(__pyx_t_7);
14961 
14962         /* "View.MemoryView":434
14963  *         if not isinstance(obj, memoryview):
14964  *             try:
14965  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
14966  *                                  self.dtype_is_object)
14967  *             except TypeError:
14968  */
14969         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
14970         __Pyx_GOTREF(__pyx_t_8);
14971         __Pyx_INCREF(__pyx_v_obj);
14972         __Pyx_GIVEREF(__pyx_v_obj);
14973         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
14974         __Pyx_GIVEREF(__pyx_t_6);
14975         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
14976         __Pyx_GIVEREF(__pyx_t_7);
14977         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
14978         __pyx_t_6 = 0;
14979         __pyx_t_7 = 0;
14980         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
14981         __Pyx_GOTREF(__pyx_t_7);
14982         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14983         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
14984         __pyx_t_7 = 0;
14985 
14986         /* "View.MemoryView":433
14987  *     cdef is_slice(self, obj):
14988  *         if not isinstance(obj, memoryview):
14989  *             try:             # <<<<<<<<<<<<<<
14990  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
14991  *                                  self.dtype_is_object)
14992  */
14993       }
14994       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14995       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14996       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14997       goto __pyx_L9_try_end;
14998       __pyx_L4_error:;
14999       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15000       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15001       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15002 
15003       /* "View.MemoryView":436
15004  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15005  *                                  self.dtype_is_object)
15006  *             except TypeError:             # <<<<<<<<<<<<<<
15007  *                 return None
15008  *
15009  */
15010       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
15011       if (__pyx_t_9) {
15012         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15013         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
15014         __Pyx_GOTREF(__pyx_t_7);
15015         __Pyx_GOTREF(__pyx_t_8);
15016         __Pyx_GOTREF(__pyx_t_6);
15017 
15018         /* "View.MemoryView":437
15019  *                                  self.dtype_is_object)
15020  *             except TypeError:
15021  *                 return None             # <<<<<<<<<<<<<<
15022  *
15023  *         return obj
15024  */
15025         __Pyx_XDECREF(__pyx_r);
15026         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15027         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15028         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15029         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15030         goto __pyx_L7_except_return;
15031       }
15032       goto __pyx_L6_except_error;
15033       __pyx_L6_except_error:;
15034 
15035       /* "View.MemoryView":433
15036  *     cdef is_slice(self, obj):
15037  *         if not isinstance(obj, memoryview):
15038  *             try:             # <<<<<<<<<<<<<<
15039  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15040  *                                  self.dtype_is_object)
15041  */
15042       __Pyx_XGIVEREF(__pyx_t_3);
15043       __Pyx_XGIVEREF(__pyx_t_4);
15044       __Pyx_XGIVEREF(__pyx_t_5);
15045       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15046       goto __pyx_L1_error;
15047       __pyx_L7_except_return:;
15048       __Pyx_XGIVEREF(__pyx_t_3);
15049       __Pyx_XGIVEREF(__pyx_t_4);
15050       __Pyx_XGIVEREF(__pyx_t_5);
15051       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15052       goto __pyx_L0;
15053       __pyx_L9_try_end:;
15054     }
15055 
15056     /* "View.MemoryView":432
15057  *
15058  *     cdef is_slice(self, obj):
15059  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
15060  *             try:
15061  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
15062  */
15063   }
15064 
15065   /* "View.MemoryView":439
15066  *                 return None
15067  *
15068  *         return obj             # <<<<<<<<<<<<<<
15069  *
15070  *     cdef setitem_slice_assignment(self, dst, src):
15071  */
15072   __Pyx_XDECREF(__pyx_r);
15073   __Pyx_INCREF(__pyx_v_obj);
15074   __pyx_r = __pyx_v_obj;
15075   goto __pyx_L0;
15076 
15077   /* "View.MemoryView":431
15078  *             self.setitem_indexed(index, value)
15079  *
15080  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
15081  *         if not isinstance(obj, memoryview):
15082  *             try:
15083  */
15084 
15085   /* function exit code */
15086   __pyx_L1_error:;
15087   __Pyx_XDECREF(__pyx_t_6);
15088   __Pyx_XDECREF(__pyx_t_7);
15089   __Pyx_XDECREF(__pyx_t_8);
15090   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15091   __pyx_r = 0;
15092   __pyx_L0:;
15093   __Pyx_XDECREF(__pyx_v_obj);
15094   __Pyx_XGIVEREF(__pyx_r);
15095   __Pyx_RefNannyFinishContext();
15096   return __pyx_r;
15097 }
15098 
15099 /* "View.MemoryView":441
15100  *         return obj
15101  *
15102  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
15103  *         cdef __Pyx_memviewslice dst_slice
15104  *         cdef __Pyx_memviewslice src_slice
15105  */
15106 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)15107 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
15108   __Pyx_memviewslice __pyx_v_dst_slice;
15109   __Pyx_memviewslice __pyx_v_src_slice;
15110   PyObject *__pyx_r = NULL;
15111   __Pyx_RefNannyDeclarations
15112   __Pyx_memviewslice *__pyx_t_1;
15113   __Pyx_memviewslice *__pyx_t_2;
15114   PyObject *__pyx_t_3 = NULL;
15115   int __pyx_t_4;
15116   int __pyx_t_5;
15117   int __pyx_t_6;
15118   int __pyx_lineno = 0;
15119   const char *__pyx_filename = NULL;
15120   int __pyx_clineno = 0;
15121   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
15122 
15123   /* "View.MemoryView":445
15124  *         cdef __Pyx_memviewslice src_slice
15125  *
15126  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
15127  *                                  get_slice_from_memview(dst, &dst_slice)[0],
15128  *                                  src.ndim, dst.ndim, self.dtype_is_object)
15129  */
15130   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
15131   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
15132 
15133   /* "View.MemoryView":446
15134  *
15135  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
15136  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
15137  *                                  src.ndim, dst.ndim, self.dtype_is_object)
15138  *
15139  */
15140   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
15141   __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
15142 
15143   /* "View.MemoryView":447
15144  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
15145  *                                  get_slice_from_memview(dst, &dst_slice)[0],
15146  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
15147  *
15148  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
15149  */
15150   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
15151   __Pyx_GOTREF(__pyx_t_3);
15152   __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
15153   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15154   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
15155   __Pyx_GOTREF(__pyx_t_3);
15156   __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
15157   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15158 
15159   /* "View.MemoryView":445
15160  *         cdef __Pyx_memviewslice src_slice
15161  *
15162  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
15163  *                                  get_slice_from_memview(dst, &dst_slice)[0],
15164  *                                  src.ndim, dst.ndim, self.dtype_is_object)
15165  */
15166   __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
15167 
15168   /* "View.MemoryView":441
15169  *         return obj
15170  *
15171  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
15172  *         cdef __Pyx_memviewslice dst_slice
15173  *         cdef __Pyx_memviewslice src_slice
15174  */
15175 
15176   /* function exit code */
15177   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15178   goto __pyx_L0;
15179   __pyx_L1_error:;
15180   __Pyx_XDECREF(__pyx_t_3);
15181   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
15182   __pyx_r = 0;
15183   __pyx_L0:;
15184   __Pyx_XGIVEREF(__pyx_r);
15185   __Pyx_RefNannyFinishContext();
15186   return __pyx_r;
15187 }
15188 
15189 /* "View.MemoryView":449
15190  *                                  src.ndim, dst.ndim, self.dtype_is_object)
15191  *
15192  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
15193  *         cdef int array[128]
15194  *         cdef void *tmp = NULL
15195  */
15196 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)15197 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
15198   int __pyx_v_array[0x80];
15199   void *__pyx_v_tmp;
15200   void *__pyx_v_item;
15201   __Pyx_memviewslice *__pyx_v_dst_slice;
15202   __Pyx_memviewslice __pyx_v_tmp_slice;
15203   PyObject *__pyx_r = NULL;
15204   __Pyx_RefNannyDeclarations
15205   __Pyx_memviewslice *__pyx_t_1;
15206   int __pyx_t_2;
15207   PyObject *__pyx_t_3 = NULL;
15208   int __pyx_t_4;
15209   int __pyx_t_5;
15210   char const *__pyx_t_6;
15211   PyObject *__pyx_t_7 = NULL;
15212   PyObject *__pyx_t_8 = NULL;
15213   PyObject *__pyx_t_9 = NULL;
15214   PyObject *__pyx_t_10 = NULL;
15215   PyObject *__pyx_t_11 = NULL;
15216   PyObject *__pyx_t_12 = NULL;
15217   int __pyx_lineno = 0;
15218   const char *__pyx_filename = NULL;
15219   int __pyx_clineno = 0;
15220   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
15221 
15222   /* "View.MemoryView":451
15223  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
15224  *         cdef int array[128]
15225  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
15226  *         cdef void *item
15227  *
15228  */
15229   __pyx_v_tmp = NULL;
15230 
15231   /* "View.MemoryView":456
15232  *         cdef __Pyx_memviewslice *dst_slice
15233  *         cdef __Pyx_memviewslice tmp_slice
15234  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
15235  *
15236  *         if <size_t>self.view.itemsize > sizeof(array):
15237  */
15238   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
15239   __pyx_v_dst_slice = __pyx_t_1;
15240 
15241   /* "View.MemoryView":458
15242  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
15243  *
15244  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
15245  *             tmp = PyMem_Malloc(self.view.itemsize)
15246  *             if tmp == NULL:
15247  */
15248   __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
15249   if (__pyx_t_2) {
15250 
15251     /* "View.MemoryView":459
15252  *
15253  *         if <size_t>self.view.itemsize > sizeof(array):
15254  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
15255  *             if tmp == NULL:
15256  *                 raise MemoryError
15257  */
15258     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
15259 
15260     /* "View.MemoryView":460
15261  *         if <size_t>self.view.itemsize > sizeof(array):
15262  *             tmp = PyMem_Malloc(self.view.itemsize)
15263  *             if tmp == NULL:             # <<<<<<<<<<<<<<
15264  *                 raise MemoryError
15265  *             item = tmp
15266  */
15267     __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
15268     if (unlikely(__pyx_t_2)) {
15269 
15270       /* "View.MemoryView":461
15271  *             tmp = PyMem_Malloc(self.view.itemsize)
15272  *             if tmp == NULL:
15273  *                 raise MemoryError             # <<<<<<<<<<<<<<
15274  *             item = tmp
15275  *         else:
15276  */
15277       PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
15278 
15279       /* "View.MemoryView":460
15280  *         if <size_t>self.view.itemsize > sizeof(array):
15281  *             tmp = PyMem_Malloc(self.view.itemsize)
15282  *             if tmp == NULL:             # <<<<<<<<<<<<<<
15283  *                 raise MemoryError
15284  *             item = tmp
15285  */
15286     }
15287 
15288     /* "View.MemoryView":462
15289  *             if tmp == NULL:
15290  *                 raise MemoryError
15291  *             item = tmp             # <<<<<<<<<<<<<<
15292  *         else:
15293  *             item = <void *> array
15294  */
15295     __pyx_v_item = __pyx_v_tmp;
15296 
15297     /* "View.MemoryView":458
15298  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
15299  *
15300  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
15301  *             tmp = PyMem_Malloc(self.view.itemsize)
15302  *             if tmp == NULL:
15303  */
15304     goto __pyx_L3;
15305   }
15306 
15307   /* "View.MemoryView":464
15308  *             item = tmp
15309  *         else:
15310  *             item = <void *> array             # <<<<<<<<<<<<<<
15311  *
15312  *         try:
15313  */
15314   /*else*/ {
15315     __pyx_v_item = ((void *)__pyx_v_array);
15316   }
15317   __pyx_L3:;
15318 
15319   /* "View.MemoryView":466
15320  *             item = <void *> array
15321  *
15322  *         try:             # <<<<<<<<<<<<<<
15323  *             if self.dtype_is_object:
15324  *                 (<PyObject **> item)[0] = <PyObject *> value
15325  */
15326   /*try:*/ {
15327 
15328     /* "View.MemoryView":467
15329  *
15330  *         try:
15331  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
15332  *                 (<PyObject **> item)[0] = <PyObject *> value
15333  *             else:
15334  */
15335     __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
15336     if (__pyx_t_2) {
15337 
15338       /* "View.MemoryView":468
15339  *         try:
15340  *             if self.dtype_is_object:
15341  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
15342  *             else:
15343  *                 self.assign_item_from_object(<char *> item, value)
15344  */
15345       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
15346 
15347       /* "View.MemoryView":467
15348  *
15349  *         try:
15350  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
15351  *                 (<PyObject **> item)[0] = <PyObject *> value
15352  *             else:
15353  */
15354       goto __pyx_L8;
15355     }
15356 
15357     /* "View.MemoryView":470
15358  *                 (<PyObject **> item)[0] = <PyObject *> value
15359  *             else:
15360  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
15361  *
15362  *
15363  */
15364     /*else*/ {
15365       __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
15366       __Pyx_GOTREF(__pyx_t_3);
15367       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15368     }
15369     __pyx_L8:;
15370 
15371     /* "View.MemoryView":474
15372  *
15373  *
15374  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
15375  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15376  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15377  */
15378     __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
15379     if (__pyx_t_2) {
15380 
15381       /* "View.MemoryView":475
15382  *
15383  *             if self.view.suboffsets != NULL:
15384  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
15385  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15386  *                                 item, self.dtype_is_object)
15387  */
15388       __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
15389       __Pyx_GOTREF(__pyx_t_3);
15390       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15391 
15392       /* "View.MemoryView":474
15393  *
15394  *
15395  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
15396  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15397  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
15398  */
15399     }
15400 
15401     /* "View.MemoryView":476
15402  *             if self.view.suboffsets != NULL:
15403  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
15404  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
15405  *                                 item, self.dtype_is_object)
15406  *         finally:
15407  */
15408     __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
15409   }
15410 
15411   /* "View.MemoryView":479
15412  *                                 item, self.dtype_is_object)
15413  *         finally:
15414  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
15415  *
15416  *     cdef setitem_indexed(self, index, value):
15417  */
15418   /*finally:*/ {
15419     /*normal exit:*/{
15420       PyMem_Free(__pyx_v_tmp);
15421       goto __pyx_L7;
15422     }
15423     __pyx_L6_error:;
15424     /*exception exit:*/{
15425       __Pyx_PyThreadState_declare
15426       __Pyx_PyThreadState_assign
15427       __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15428       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15429       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
15430       if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
15431       __Pyx_XGOTREF(__pyx_t_7);
15432       __Pyx_XGOTREF(__pyx_t_8);
15433       __Pyx_XGOTREF(__pyx_t_9);
15434       __Pyx_XGOTREF(__pyx_t_10);
15435       __Pyx_XGOTREF(__pyx_t_11);
15436       __Pyx_XGOTREF(__pyx_t_12);
15437       __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
15438       {
15439         PyMem_Free(__pyx_v_tmp);
15440       }
15441       if (PY_MAJOR_VERSION >= 3) {
15442         __Pyx_XGIVEREF(__pyx_t_10);
15443         __Pyx_XGIVEREF(__pyx_t_11);
15444         __Pyx_XGIVEREF(__pyx_t_12);
15445         __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
15446       }
15447       __Pyx_XGIVEREF(__pyx_t_7);
15448       __Pyx_XGIVEREF(__pyx_t_8);
15449       __Pyx_XGIVEREF(__pyx_t_9);
15450       __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
15451       __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
15452       __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
15453       goto __pyx_L1_error;
15454     }
15455     __pyx_L7:;
15456   }
15457 
15458   /* "View.MemoryView":449
15459  *                                  src.ndim, dst.ndim, self.dtype_is_object)
15460  *
15461  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
15462  *         cdef int array[128]
15463  *         cdef void *tmp = NULL
15464  */
15465 
15466   /* function exit code */
15467   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15468   goto __pyx_L0;
15469   __pyx_L1_error:;
15470   __Pyx_XDECREF(__pyx_t_3);
15471   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
15472   __pyx_r = 0;
15473   __pyx_L0:;
15474   __Pyx_XGIVEREF(__pyx_r);
15475   __Pyx_RefNannyFinishContext();
15476   return __pyx_r;
15477 }
15478 
15479 /* "View.MemoryView":481
15480  *             PyMem_Free(tmp)
15481  *
15482  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
15483  *         cdef char *itemp = self.get_item_pointer(index)
15484  *         self.assign_item_from_object(itemp, value)
15485  */
15486 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)15487 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
15488   char *__pyx_v_itemp;
15489   PyObject *__pyx_r = NULL;
15490   __Pyx_RefNannyDeclarations
15491   char *__pyx_t_1;
15492   PyObject *__pyx_t_2 = NULL;
15493   int __pyx_lineno = 0;
15494   const char *__pyx_filename = NULL;
15495   int __pyx_clineno = 0;
15496   __Pyx_RefNannySetupContext("setitem_indexed", 0);
15497 
15498   /* "View.MemoryView":482
15499  *
15500  *     cdef setitem_indexed(self, index, value):
15501  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
15502  *         self.assign_item_from_object(itemp, value)
15503  *
15504  */
15505   __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
15506   __pyx_v_itemp = __pyx_t_1;
15507 
15508   /* "View.MemoryView":483
15509  *     cdef setitem_indexed(self, index, value):
15510  *         cdef char *itemp = self.get_item_pointer(index)
15511  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
15512  *
15513  *     cdef convert_item_to_object(self, char *itemp):
15514  */
15515   __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
15516   __Pyx_GOTREF(__pyx_t_2);
15517   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15518 
15519   /* "View.MemoryView":481
15520  *             PyMem_Free(tmp)
15521  *
15522  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
15523  *         cdef char *itemp = self.get_item_pointer(index)
15524  *         self.assign_item_from_object(itemp, value)
15525  */
15526 
15527   /* function exit code */
15528   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15529   goto __pyx_L0;
15530   __pyx_L1_error:;
15531   __Pyx_XDECREF(__pyx_t_2);
15532   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
15533   __pyx_r = 0;
15534   __pyx_L0:;
15535   __Pyx_XGIVEREF(__pyx_r);
15536   __Pyx_RefNannyFinishContext();
15537   return __pyx_r;
15538 }
15539 
15540 /* "View.MemoryView":485
15541  *         self.assign_item_from_object(itemp, value)
15542  *
15543  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
15544  *         """Only used if instantiated manually by the user, or if Cython doesn't
15545  *         know how to convert the type"""
15546  */
15547 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)15548 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
15549   PyObject *__pyx_v_struct = NULL;
15550   PyObject *__pyx_v_bytesitem = 0;
15551   PyObject *__pyx_v_result = NULL;
15552   PyObject *__pyx_r = NULL;
15553   __Pyx_RefNannyDeclarations
15554   PyObject *__pyx_t_1 = NULL;
15555   PyObject *__pyx_t_2 = NULL;
15556   PyObject *__pyx_t_3 = NULL;
15557   PyObject *__pyx_t_4 = NULL;
15558   PyObject *__pyx_t_5 = NULL;
15559   PyObject *__pyx_t_6 = NULL;
15560   PyObject *__pyx_t_7 = NULL;
15561   int __pyx_t_8;
15562   PyObject *__pyx_t_9 = NULL;
15563   size_t __pyx_t_10;
15564   int __pyx_t_11;
15565   int __pyx_lineno = 0;
15566   const char *__pyx_filename = NULL;
15567   int __pyx_clineno = 0;
15568   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
15569 
15570   /* "View.MemoryView":488
15571  *         """Only used if instantiated manually by the user, or if Cython doesn't
15572  *         know how to convert the type"""
15573  *         import struct             # <<<<<<<<<<<<<<
15574  *         cdef bytes bytesitem
15575  *
15576  */
15577   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
15578   __Pyx_GOTREF(__pyx_t_1);
15579   __pyx_v_struct = __pyx_t_1;
15580   __pyx_t_1 = 0;
15581 
15582   /* "View.MemoryView":491
15583  *         cdef bytes bytesitem
15584  *
15585  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
15586  *         try:
15587  *             result = struct.unpack(self.view.format, bytesitem)
15588  */
15589   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
15590   __Pyx_GOTREF(__pyx_t_1);
15591   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
15592   __pyx_t_1 = 0;
15593 
15594   /* "View.MemoryView":492
15595  *
15596  *         bytesitem = itemp[:self.view.itemsize]
15597  *         try:             # <<<<<<<<<<<<<<
15598  *             result = struct.unpack(self.view.format, bytesitem)
15599  *         except struct.error:
15600  */
15601   {
15602     __Pyx_PyThreadState_declare
15603     __Pyx_PyThreadState_assign
15604     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
15605     __Pyx_XGOTREF(__pyx_t_2);
15606     __Pyx_XGOTREF(__pyx_t_3);
15607     __Pyx_XGOTREF(__pyx_t_4);
15608     /*try:*/ {
15609 
15610       /* "View.MemoryView":493
15611  *         bytesitem = itemp[:self.view.itemsize]
15612  *         try:
15613  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
15614  *         except struct.error:
15615  *             raise ValueError("Unable to convert item to object")
15616  */
15617       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
15618       __Pyx_GOTREF(__pyx_t_5);
15619       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
15620       __Pyx_GOTREF(__pyx_t_6);
15621       __pyx_t_7 = NULL;
15622       __pyx_t_8 = 0;
15623       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
15624         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
15625         if (likely(__pyx_t_7)) {
15626           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
15627           __Pyx_INCREF(__pyx_t_7);
15628           __Pyx_INCREF(function);
15629           __Pyx_DECREF_SET(__pyx_t_5, function);
15630           __pyx_t_8 = 1;
15631         }
15632       }
15633       #if CYTHON_FAST_PYCALL
15634       if (PyFunction_Check(__pyx_t_5)) {
15635         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
15636         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15637         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15638         __Pyx_GOTREF(__pyx_t_1);
15639         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15640       } else
15641       #endif
15642       #if CYTHON_FAST_PYCCALL
15643       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
15644         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
15645         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15646         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15647         __Pyx_GOTREF(__pyx_t_1);
15648         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15649       } else
15650       #endif
15651       {
15652         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
15653         __Pyx_GOTREF(__pyx_t_9);
15654         if (__pyx_t_7) {
15655           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
15656         }
15657         __Pyx_GIVEREF(__pyx_t_6);
15658         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
15659         __Pyx_INCREF(__pyx_v_bytesitem);
15660         __Pyx_GIVEREF(__pyx_v_bytesitem);
15661         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
15662         __pyx_t_6 = 0;
15663         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
15664         __Pyx_GOTREF(__pyx_t_1);
15665         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15666       }
15667       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15668       __pyx_v_result = __pyx_t_1;
15669       __pyx_t_1 = 0;
15670 
15671       /* "View.MemoryView":492
15672  *
15673  *         bytesitem = itemp[:self.view.itemsize]
15674  *         try:             # <<<<<<<<<<<<<<
15675  *             result = struct.unpack(self.view.format, bytesitem)
15676  *         except struct.error:
15677  */
15678     }
15679 
15680     /* "View.MemoryView":497
15681  *             raise ValueError("Unable to convert item to object")
15682  *         else:
15683  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
15684  *                 return result[0]
15685  *             return result
15686  */
15687     /*else:*/ {
15688       __pyx_t_10 = strlen(__pyx_v_self->view.format);
15689       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
15690       if (__pyx_t_11) {
15691 
15692         /* "View.MemoryView":498
15693  *         else:
15694  *             if len(self.view.format) == 1:
15695  *                 return result[0]             # <<<<<<<<<<<<<<
15696  *             return result
15697  *
15698  */
15699         __Pyx_XDECREF(__pyx_r);
15700         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
15701         __Pyx_GOTREF(__pyx_t_1);
15702         __pyx_r = __pyx_t_1;
15703         __pyx_t_1 = 0;
15704         goto __pyx_L6_except_return;
15705 
15706         /* "View.MemoryView":497
15707  *             raise ValueError("Unable to convert item to object")
15708  *         else:
15709  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
15710  *                 return result[0]
15711  *             return result
15712  */
15713       }
15714 
15715       /* "View.MemoryView":499
15716  *             if len(self.view.format) == 1:
15717  *                 return result[0]
15718  *             return result             # <<<<<<<<<<<<<<
15719  *
15720  *     cdef assign_item_from_object(self, char *itemp, object value):
15721  */
15722       __Pyx_XDECREF(__pyx_r);
15723       __Pyx_INCREF(__pyx_v_result);
15724       __pyx_r = __pyx_v_result;
15725       goto __pyx_L6_except_return;
15726     }
15727     __pyx_L3_error:;
15728     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15729     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15730     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15731     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15732     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15733 
15734     /* "View.MemoryView":494
15735  *         try:
15736  *             result = struct.unpack(self.view.format, bytesitem)
15737  *         except struct.error:             # <<<<<<<<<<<<<<
15738  *             raise ValueError("Unable to convert item to object")
15739  *         else:
15740  */
15741     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
15742     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
15743     __Pyx_GOTREF(__pyx_t_6);
15744     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
15745     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15746     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
15747     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
15748     if (__pyx_t_8) {
15749       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15750       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
15751       __Pyx_GOTREF(__pyx_t_9);
15752       __Pyx_GOTREF(__pyx_t_5);
15753       __Pyx_GOTREF(__pyx_t_1);
15754 
15755       /* "View.MemoryView":495
15756  *             result = struct.unpack(self.view.format, bytesitem)
15757  *         except struct.error:
15758  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
15759  *         else:
15760  *             if len(self.view.format) == 1:
15761  */
15762       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
15763       __Pyx_GOTREF(__pyx_t_6);
15764       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
15765       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15766       __PYX_ERR(1, 495, __pyx_L5_except_error)
15767     }
15768     goto __pyx_L5_except_error;
15769     __pyx_L5_except_error:;
15770 
15771     /* "View.MemoryView":492
15772  *
15773  *         bytesitem = itemp[:self.view.itemsize]
15774  *         try:             # <<<<<<<<<<<<<<
15775  *             result = struct.unpack(self.view.format, bytesitem)
15776  *         except struct.error:
15777  */
15778     __Pyx_XGIVEREF(__pyx_t_2);
15779     __Pyx_XGIVEREF(__pyx_t_3);
15780     __Pyx_XGIVEREF(__pyx_t_4);
15781     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
15782     goto __pyx_L1_error;
15783     __pyx_L6_except_return:;
15784     __Pyx_XGIVEREF(__pyx_t_2);
15785     __Pyx_XGIVEREF(__pyx_t_3);
15786     __Pyx_XGIVEREF(__pyx_t_4);
15787     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
15788     goto __pyx_L0;
15789   }
15790 
15791   /* "View.MemoryView":485
15792  *         self.assign_item_from_object(itemp, value)
15793  *
15794  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
15795  *         """Only used if instantiated manually by the user, or if Cython doesn't
15796  *         know how to convert the type"""
15797  */
15798 
15799   /* function exit code */
15800   __pyx_L1_error:;
15801   __Pyx_XDECREF(__pyx_t_1);
15802   __Pyx_XDECREF(__pyx_t_5);
15803   __Pyx_XDECREF(__pyx_t_6);
15804   __Pyx_XDECREF(__pyx_t_7);
15805   __Pyx_XDECREF(__pyx_t_9);
15806   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15807   __pyx_r = 0;
15808   __pyx_L0:;
15809   __Pyx_XDECREF(__pyx_v_struct);
15810   __Pyx_XDECREF(__pyx_v_bytesitem);
15811   __Pyx_XDECREF(__pyx_v_result);
15812   __Pyx_XGIVEREF(__pyx_r);
15813   __Pyx_RefNannyFinishContext();
15814   return __pyx_r;
15815 }
15816 
15817 /* "View.MemoryView":501
15818  *             return result
15819  *
15820  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
15821  *         """Only used if instantiated manually by the user, or if Cython doesn't
15822  *         know how to convert the type"""
15823  */
15824 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)15825 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15826   PyObject *__pyx_v_struct = NULL;
15827   char __pyx_v_c;
15828   PyObject *__pyx_v_bytesvalue = 0;
15829   Py_ssize_t __pyx_v_i;
15830   PyObject *__pyx_r = NULL;
15831   __Pyx_RefNannyDeclarations
15832   PyObject *__pyx_t_1 = NULL;
15833   int __pyx_t_2;
15834   int __pyx_t_3;
15835   PyObject *__pyx_t_4 = NULL;
15836   PyObject *__pyx_t_5 = NULL;
15837   PyObject *__pyx_t_6 = NULL;
15838   int __pyx_t_7;
15839   PyObject *__pyx_t_8 = NULL;
15840   Py_ssize_t __pyx_t_9;
15841   PyObject *__pyx_t_10 = NULL;
15842   char *__pyx_t_11;
15843   char *__pyx_t_12;
15844   char *__pyx_t_13;
15845   char *__pyx_t_14;
15846   int __pyx_lineno = 0;
15847   const char *__pyx_filename = NULL;
15848   int __pyx_clineno = 0;
15849   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
15850 
15851   /* "View.MemoryView":504
15852  *         """Only used if instantiated manually by the user, or if Cython doesn't
15853  *         know how to convert the type"""
15854  *         import struct             # <<<<<<<<<<<<<<
15855  *         cdef char c
15856  *         cdef bytes bytesvalue
15857  */
15858   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
15859   __Pyx_GOTREF(__pyx_t_1);
15860   __pyx_v_struct = __pyx_t_1;
15861   __pyx_t_1 = 0;
15862 
15863   /* "View.MemoryView":509
15864  *         cdef Py_ssize_t i
15865  *
15866  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
15867  *             bytesvalue = struct.pack(self.view.format, *value)
15868  *         else:
15869  */
15870   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
15871   __pyx_t_3 = (__pyx_t_2 != 0);
15872   if (__pyx_t_3) {
15873 
15874     /* "View.MemoryView":510
15875  *
15876  *         if isinstance(value, tuple):
15877  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
15878  *         else:
15879  *             bytesvalue = struct.pack(self.view.format, value)
15880  */
15881     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
15882     __Pyx_GOTREF(__pyx_t_1);
15883     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
15884     __Pyx_GOTREF(__pyx_t_4);
15885     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
15886     __Pyx_GOTREF(__pyx_t_5);
15887     __Pyx_GIVEREF(__pyx_t_4);
15888     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
15889     __pyx_t_4 = 0;
15890     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
15891     __Pyx_GOTREF(__pyx_t_4);
15892     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
15893     __Pyx_GOTREF(__pyx_t_6);
15894     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15895     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15896     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
15897     __Pyx_GOTREF(__pyx_t_4);
15898     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15899     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15900     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
15901     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
15902     __pyx_t_4 = 0;
15903 
15904     /* "View.MemoryView":509
15905  *         cdef Py_ssize_t i
15906  *
15907  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
15908  *             bytesvalue = struct.pack(self.view.format, *value)
15909  *         else:
15910  */
15911     goto __pyx_L3;
15912   }
15913 
15914   /* "View.MemoryView":512
15915  *             bytesvalue = struct.pack(self.view.format, *value)
15916  *         else:
15917  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
15918  *
15919  *         for i, c in enumerate(bytesvalue):
15920  */
15921   /*else*/ {
15922     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
15923     __Pyx_GOTREF(__pyx_t_6);
15924     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
15925     __Pyx_GOTREF(__pyx_t_1);
15926     __pyx_t_5 = NULL;
15927     __pyx_t_7 = 0;
15928     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
15929       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
15930       if (likely(__pyx_t_5)) {
15931         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
15932         __Pyx_INCREF(__pyx_t_5);
15933         __Pyx_INCREF(function);
15934         __Pyx_DECREF_SET(__pyx_t_6, function);
15935         __pyx_t_7 = 1;
15936       }
15937     }
15938     #if CYTHON_FAST_PYCALL
15939     if (PyFunction_Check(__pyx_t_6)) {
15940       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
15941       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
15942       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15943       __Pyx_GOTREF(__pyx_t_4);
15944       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15945     } else
15946     #endif
15947     #if CYTHON_FAST_PYCCALL
15948     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
15949       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
15950       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
15951       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15952       __Pyx_GOTREF(__pyx_t_4);
15953       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15954     } else
15955     #endif
15956     {
15957       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
15958       __Pyx_GOTREF(__pyx_t_8);
15959       if (__pyx_t_5) {
15960         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
15961       }
15962       __Pyx_GIVEREF(__pyx_t_1);
15963       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
15964       __Pyx_INCREF(__pyx_v_value);
15965       __Pyx_GIVEREF(__pyx_v_value);
15966       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
15967       __pyx_t_1 = 0;
15968       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
15969       __Pyx_GOTREF(__pyx_t_4);
15970       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15971     }
15972     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15973     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
15974     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
15975     __pyx_t_4 = 0;
15976   }
15977   __pyx_L3:;
15978 
15979   /* "View.MemoryView":514
15980  *             bytesvalue = struct.pack(self.view.format, value)
15981  *
15982  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
15983  *             itemp[i] = c
15984  *
15985  */
15986   __pyx_t_9 = 0;
15987   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
15988     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
15989     __PYX_ERR(1, 514, __pyx_L1_error)
15990   }
15991   __Pyx_INCREF(__pyx_v_bytesvalue);
15992   __pyx_t_10 = __pyx_v_bytesvalue;
15993   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
15994   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
15995   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
15996     __pyx_t_11 = __pyx_t_14;
15997     __pyx_v_c = (__pyx_t_11[0]);
15998 
15999     /* "View.MemoryView":515
16000  *
16001  *         for i, c in enumerate(bytesvalue):
16002  *             itemp[i] = c             # <<<<<<<<<<<<<<
16003  *
16004  *     @cname('getbuffer')
16005  */
16006     __pyx_v_i = __pyx_t_9;
16007 
16008     /* "View.MemoryView":514
16009  *             bytesvalue = struct.pack(self.view.format, value)
16010  *
16011  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
16012  *             itemp[i] = c
16013  *
16014  */
16015     __pyx_t_9 = (__pyx_t_9 + 1);
16016 
16017     /* "View.MemoryView":515
16018  *
16019  *         for i, c in enumerate(bytesvalue):
16020  *             itemp[i] = c             # <<<<<<<<<<<<<<
16021  *
16022  *     @cname('getbuffer')
16023  */
16024     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
16025   }
16026   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
16027 
16028   /* "View.MemoryView":501
16029  *             return result
16030  *
16031  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
16032  *         """Only used if instantiated manually by the user, or if Cython doesn't
16033  *         know how to convert the type"""
16034  */
16035 
16036   /* function exit code */
16037   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16038   goto __pyx_L0;
16039   __pyx_L1_error:;
16040   __Pyx_XDECREF(__pyx_t_1);
16041   __Pyx_XDECREF(__pyx_t_4);
16042   __Pyx_XDECREF(__pyx_t_5);
16043   __Pyx_XDECREF(__pyx_t_6);
16044   __Pyx_XDECREF(__pyx_t_8);
16045   __Pyx_XDECREF(__pyx_t_10);
16046   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16047   __pyx_r = 0;
16048   __pyx_L0:;
16049   __Pyx_XDECREF(__pyx_v_struct);
16050   __Pyx_XDECREF(__pyx_v_bytesvalue);
16051   __Pyx_XGIVEREF(__pyx_r);
16052   __Pyx_RefNannyFinishContext();
16053   return __pyx_r;
16054 }
16055 
16056 /* "View.MemoryView":518
16057  *
16058  *     @cname('getbuffer')
16059  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
16060  *         if flags & PyBUF_WRITABLE and self.view.readonly:
16061  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
16062  */
16063 
16064 /* Python wrapper */
16065 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_memoryview_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)16066 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
16067   int __pyx_r;
16068   __Pyx_RefNannyDeclarations
16069   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
16070   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
16071 
16072   /* function exit code */
16073   __Pyx_RefNannyFinishContext();
16074   return __pyx_r;
16075 }
16076 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)16077 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
16078   int __pyx_r;
16079   __Pyx_RefNannyDeclarations
16080   int __pyx_t_1;
16081   int __pyx_t_2;
16082   PyObject *__pyx_t_3 = NULL;
16083   Py_ssize_t *__pyx_t_4;
16084   char *__pyx_t_5;
16085   void *__pyx_t_6;
16086   int __pyx_t_7;
16087   Py_ssize_t __pyx_t_8;
16088   int __pyx_lineno = 0;
16089   const char *__pyx_filename = NULL;
16090   int __pyx_clineno = 0;
16091   if (__pyx_v_info == NULL) {
16092     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
16093     return -1;
16094   }
16095   __Pyx_RefNannySetupContext("__getbuffer__", 0);
16096   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
16097   __Pyx_GIVEREF(__pyx_v_info->obj);
16098 
16099   /* "View.MemoryView":519
16100  *     @cname('getbuffer')
16101  *     def __getbuffer__(self, Py_buffer *info, int flags):
16102  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
16103  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
16104  *
16105  */
16106   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
16107   if (__pyx_t_2) {
16108   } else {
16109     __pyx_t_1 = __pyx_t_2;
16110     goto __pyx_L4_bool_binop_done;
16111   }
16112   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
16113   __pyx_t_1 = __pyx_t_2;
16114   __pyx_L4_bool_binop_done:;
16115   if (unlikely(__pyx_t_1)) {
16116 
16117     /* "View.MemoryView":520
16118  *     def __getbuffer__(self, Py_buffer *info, int flags):
16119  *         if flags & PyBUF_WRITABLE and self.view.readonly:
16120  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
16121  *
16122  *         if flags & PyBUF_ND:
16123  */
16124     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
16125     __Pyx_GOTREF(__pyx_t_3);
16126     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16127     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16128     __PYX_ERR(1, 520, __pyx_L1_error)
16129 
16130     /* "View.MemoryView":519
16131  *     @cname('getbuffer')
16132  *     def __getbuffer__(self, Py_buffer *info, int flags):
16133  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
16134  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
16135  *
16136  */
16137   }
16138 
16139   /* "View.MemoryView":522
16140  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
16141  *
16142  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
16143  *             info.shape = self.view.shape
16144  *         else:
16145  */
16146   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
16147   if (__pyx_t_1) {
16148 
16149     /* "View.MemoryView":523
16150  *
16151  *         if flags & PyBUF_ND:
16152  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
16153  *         else:
16154  *             info.shape = NULL
16155  */
16156     __pyx_t_4 = __pyx_v_self->view.shape;
16157     __pyx_v_info->shape = __pyx_t_4;
16158 
16159     /* "View.MemoryView":522
16160  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
16161  *
16162  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
16163  *             info.shape = self.view.shape
16164  *         else:
16165  */
16166     goto __pyx_L6;
16167   }
16168 
16169   /* "View.MemoryView":525
16170  *             info.shape = self.view.shape
16171  *         else:
16172  *             info.shape = NULL             # <<<<<<<<<<<<<<
16173  *
16174  *         if flags & PyBUF_STRIDES:
16175  */
16176   /*else*/ {
16177     __pyx_v_info->shape = NULL;
16178   }
16179   __pyx_L6:;
16180 
16181   /* "View.MemoryView":527
16182  *             info.shape = NULL
16183  *
16184  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
16185  *             info.strides = self.view.strides
16186  *         else:
16187  */
16188   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
16189   if (__pyx_t_1) {
16190 
16191     /* "View.MemoryView":528
16192  *
16193  *         if flags & PyBUF_STRIDES:
16194  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
16195  *         else:
16196  *             info.strides = NULL
16197  */
16198     __pyx_t_4 = __pyx_v_self->view.strides;
16199     __pyx_v_info->strides = __pyx_t_4;
16200 
16201     /* "View.MemoryView":527
16202  *             info.shape = NULL
16203  *
16204  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
16205  *             info.strides = self.view.strides
16206  *         else:
16207  */
16208     goto __pyx_L7;
16209   }
16210 
16211   /* "View.MemoryView":530
16212  *             info.strides = self.view.strides
16213  *         else:
16214  *             info.strides = NULL             # <<<<<<<<<<<<<<
16215  *
16216  *         if flags & PyBUF_INDIRECT:
16217  */
16218   /*else*/ {
16219     __pyx_v_info->strides = NULL;
16220   }
16221   __pyx_L7:;
16222 
16223   /* "View.MemoryView":532
16224  *             info.strides = NULL
16225  *
16226  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
16227  *             info.suboffsets = self.view.suboffsets
16228  *         else:
16229  */
16230   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
16231   if (__pyx_t_1) {
16232 
16233     /* "View.MemoryView":533
16234  *
16235  *         if flags & PyBUF_INDIRECT:
16236  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
16237  *         else:
16238  *             info.suboffsets = NULL
16239  */
16240     __pyx_t_4 = __pyx_v_self->view.suboffsets;
16241     __pyx_v_info->suboffsets = __pyx_t_4;
16242 
16243     /* "View.MemoryView":532
16244  *             info.strides = NULL
16245  *
16246  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
16247  *             info.suboffsets = self.view.suboffsets
16248  *         else:
16249  */
16250     goto __pyx_L8;
16251   }
16252 
16253   /* "View.MemoryView":535
16254  *             info.suboffsets = self.view.suboffsets
16255  *         else:
16256  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
16257  *
16258  *         if flags & PyBUF_FORMAT:
16259  */
16260   /*else*/ {
16261     __pyx_v_info->suboffsets = NULL;
16262   }
16263   __pyx_L8:;
16264 
16265   /* "View.MemoryView":537
16266  *             info.suboffsets = NULL
16267  *
16268  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
16269  *             info.format = self.view.format
16270  *         else:
16271  */
16272   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
16273   if (__pyx_t_1) {
16274 
16275     /* "View.MemoryView":538
16276  *
16277  *         if flags & PyBUF_FORMAT:
16278  *             info.format = self.view.format             # <<<<<<<<<<<<<<
16279  *         else:
16280  *             info.format = NULL
16281  */
16282     __pyx_t_5 = __pyx_v_self->view.format;
16283     __pyx_v_info->format = __pyx_t_5;
16284 
16285     /* "View.MemoryView":537
16286  *             info.suboffsets = NULL
16287  *
16288  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
16289  *             info.format = self.view.format
16290  *         else:
16291  */
16292     goto __pyx_L9;
16293   }
16294 
16295   /* "View.MemoryView":540
16296  *             info.format = self.view.format
16297  *         else:
16298  *             info.format = NULL             # <<<<<<<<<<<<<<
16299  *
16300  *         info.buf = self.view.buf
16301  */
16302   /*else*/ {
16303     __pyx_v_info->format = NULL;
16304   }
16305   __pyx_L9:;
16306 
16307   /* "View.MemoryView":542
16308  *             info.format = NULL
16309  *
16310  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
16311  *         info.ndim = self.view.ndim
16312  *         info.itemsize = self.view.itemsize
16313  */
16314   __pyx_t_6 = __pyx_v_self->view.buf;
16315   __pyx_v_info->buf = __pyx_t_6;
16316 
16317   /* "View.MemoryView":543
16318  *
16319  *         info.buf = self.view.buf
16320  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
16321  *         info.itemsize = self.view.itemsize
16322  *         info.len = self.view.len
16323  */
16324   __pyx_t_7 = __pyx_v_self->view.ndim;
16325   __pyx_v_info->ndim = __pyx_t_7;
16326 
16327   /* "View.MemoryView":544
16328  *         info.buf = self.view.buf
16329  *         info.ndim = self.view.ndim
16330  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
16331  *         info.len = self.view.len
16332  *         info.readonly = self.view.readonly
16333  */
16334   __pyx_t_8 = __pyx_v_self->view.itemsize;
16335   __pyx_v_info->itemsize = __pyx_t_8;
16336 
16337   /* "View.MemoryView":545
16338  *         info.ndim = self.view.ndim
16339  *         info.itemsize = self.view.itemsize
16340  *         info.len = self.view.len             # <<<<<<<<<<<<<<
16341  *         info.readonly = self.view.readonly
16342  *         info.obj = self
16343  */
16344   __pyx_t_8 = __pyx_v_self->view.len;
16345   __pyx_v_info->len = __pyx_t_8;
16346 
16347   /* "View.MemoryView":546
16348  *         info.itemsize = self.view.itemsize
16349  *         info.len = self.view.len
16350  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
16351  *         info.obj = self
16352  *
16353  */
16354   __pyx_t_1 = __pyx_v_self->view.readonly;
16355   __pyx_v_info->readonly = __pyx_t_1;
16356 
16357   /* "View.MemoryView":547
16358  *         info.len = self.view.len
16359  *         info.readonly = self.view.readonly
16360  *         info.obj = self             # <<<<<<<<<<<<<<
16361  *
16362  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16363  */
16364   __Pyx_INCREF(((PyObject *)__pyx_v_self));
16365   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16366   __Pyx_GOTREF(__pyx_v_info->obj);
16367   __Pyx_DECREF(__pyx_v_info->obj);
16368   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
16369 
16370   /* "View.MemoryView":518
16371  *
16372  *     @cname('getbuffer')
16373  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
16374  *         if flags & PyBUF_WRITABLE and self.view.readonly:
16375  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
16376  */
16377 
16378   /* function exit code */
16379   __pyx_r = 0;
16380   goto __pyx_L0;
16381   __pyx_L1_error:;
16382   __Pyx_XDECREF(__pyx_t_3);
16383   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16384   __pyx_r = -1;
16385   if (__pyx_v_info->obj != NULL) {
16386     __Pyx_GOTREF(__pyx_v_info->obj);
16387     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16388   }
16389   goto __pyx_L2;
16390   __pyx_L0:;
16391   if (__pyx_v_info->obj == Py_None) {
16392     __Pyx_GOTREF(__pyx_v_info->obj);
16393     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
16394   }
16395   __pyx_L2:;
16396   __Pyx_RefNannyFinishContext();
16397   return __pyx_r;
16398 }
16399 
16400 /* "View.MemoryView":553
16401  *
16402  *     @property
16403  *     def T(self):             # <<<<<<<<<<<<<<
16404  *         cdef _memoryviewslice result = memoryview_copy(self)
16405  *         transpose_memslice(&result.from_slice)
16406  */
16407 
16408 /* Python wrapper */
16409 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject * __pyx_v_self)16410 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
16411   PyObject *__pyx_r = 0;
16412   __Pyx_RefNannyDeclarations
16413   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16414   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16415 
16416   /* function exit code */
16417   __Pyx_RefNannyFinishContext();
16418   return __pyx_r;
16419 }
16420 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)16421 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16422   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16423   PyObject *__pyx_r = NULL;
16424   __Pyx_RefNannyDeclarations
16425   PyObject *__pyx_t_1 = NULL;
16426   int __pyx_t_2;
16427   int __pyx_lineno = 0;
16428   const char *__pyx_filename = NULL;
16429   int __pyx_clineno = 0;
16430   __Pyx_RefNannySetupContext("__get__", 0);
16431 
16432   /* "View.MemoryView":554
16433  *     @property
16434  *     def T(self):
16435  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
16436  *         transpose_memslice(&result.from_slice)
16437  *         return result
16438  */
16439   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
16440   __Pyx_GOTREF(__pyx_t_1);
16441   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
16442   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
16443   __pyx_t_1 = 0;
16444 
16445   /* "View.MemoryView":555
16446  *     def T(self):
16447  *         cdef _memoryviewslice result = memoryview_copy(self)
16448  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
16449  *         return result
16450  *
16451  */
16452   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
16453 
16454   /* "View.MemoryView":556
16455  *         cdef _memoryviewslice result = memoryview_copy(self)
16456  *         transpose_memslice(&result.from_slice)
16457  *         return result             # <<<<<<<<<<<<<<
16458  *
16459  *     @property
16460  */
16461   __Pyx_XDECREF(__pyx_r);
16462   __Pyx_INCREF(((PyObject *)__pyx_v_result));
16463   __pyx_r = ((PyObject *)__pyx_v_result);
16464   goto __pyx_L0;
16465 
16466   /* "View.MemoryView":553
16467  *
16468  *     @property
16469  *     def T(self):             # <<<<<<<<<<<<<<
16470  *         cdef _memoryviewslice result = memoryview_copy(self)
16471  *         transpose_memslice(&result.from_slice)
16472  */
16473 
16474   /* function exit code */
16475   __pyx_L1_error:;
16476   __Pyx_XDECREF(__pyx_t_1);
16477   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16478   __pyx_r = NULL;
16479   __pyx_L0:;
16480   __Pyx_XDECREF((PyObject *)__pyx_v_result);
16481   __Pyx_XGIVEREF(__pyx_r);
16482   __Pyx_RefNannyFinishContext();
16483   return __pyx_r;
16484 }
16485 
16486 /* "View.MemoryView":559
16487  *
16488  *     @property
16489  *     def base(self):             # <<<<<<<<<<<<<<
16490  *         return self.obj
16491  *
16492  */
16493 
16494 /* Python wrapper */
16495 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject * __pyx_v_self)16496 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
16497   PyObject *__pyx_r = 0;
16498   __Pyx_RefNannyDeclarations
16499   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16500   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16501 
16502   /* function exit code */
16503   __Pyx_RefNannyFinishContext();
16504   return __pyx_r;
16505 }
16506 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)16507 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16508   PyObject *__pyx_r = NULL;
16509   __Pyx_RefNannyDeclarations
16510   __Pyx_RefNannySetupContext("__get__", 0);
16511 
16512   /* "View.MemoryView":560
16513  *     @property
16514  *     def base(self):
16515  *         return self.obj             # <<<<<<<<<<<<<<
16516  *
16517  *     @property
16518  */
16519   __Pyx_XDECREF(__pyx_r);
16520   __Pyx_INCREF(__pyx_v_self->obj);
16521   __pyx_r = __pyx_v_self->obj;
16522   goto __pyx_L0;
16523 
16524   /* "View.MemoryView":559
16525  *
16526  *     @property
16527  *     def base(self):             # <<<<<<<<<<<<<<
16528  *         return self.obj
16529  *
16530  */
16531 
16532   /* function exit code */
16533   __pyx_L0:;
16534   __Pyx_XGIVEREF(__pyx_r);
16535   __Pyx_RefNannyFinishContext();
16536   return __pyx_r;
16537 }
16538 
16539 /* "View.MemoryView":563
16540  *
16541  *     @property
16542  *     def shape(self):             # <<<<<<<<<<<<<<
16543  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
16544  *
16545  */
16546 
16547 /* Python wrapper */
16548 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject * __pyx_v_self)16549 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
16550   PyObject *__pyx_r = 0;
16551   __Pyx_RefNannyDeclarations
16552   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16553   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16554 
16555   /* function exit code */
16556   __Pyx_RefNannyFinishContext();
16557   return __pyx_r;
16558 }
16559 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)16560 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16561   Py_ssize_t __pyx_v_length;
16562   PyObject *__pyx_r = NULL;
16563   __Pyx_RefNannyDeclarations
16564   PyObject *__pyx_t_1 = NULL;
16565   Py_ssize_t *__pyx_t_2;
16566   Py_ssize_t *__pyx_t_3;
16567   Py_ssize_t *__pyx_t_4;
16568   PyObject *__pyx_t_5 = NULL;
16569   int __pyx_lineno = 0;
16570   const char *__pyx_filename = NULL;
16571   int __pyx_clineno = 0;
16572   __Pyx_RefNannySetupContext("__get__", 0);
16573 
16574   /* "View.MemoryView":564
16575  *     @property
16576  *     def shape(self):
16577  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
16578  *
16579  *     @property
16580  */
16581   __Pyx_XDECREF(__pyx_r);
16582   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
16583   __Pyx_GOTREF(__pyx_t_1);
16584   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
16585   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16586     __pyx_t_2 = __pyx_t_4;
16587     __pyx_v_length = (__pyx_t_2[0]);
16588     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
16589     __Pyx_GOTREF(__pyx_t_5);
16590     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
16591     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16592   }
16593   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
16594   __Pyx_GOTREF(__pyx_t_5);
16595   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16596   __pyx_r = __pyx_t_5;
16597   __pyx_t_5 = 0;
16598   goto __pyx_L0;
16599 
16600   /* "View.MemoryView":563
16601  *
16602  *     @property
16603  *     def shape(self):             # <<<<<<<<<<<<<<
16604  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
16605  *
16606  */
16607 
16608   /* function exit code */
16609   __pyx_L1_error:;
16610   __Pyx_XDECREF(__pyx_t_1);
16611   __Pyx_XDECREF(__pyx_t_5);
16612   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16613   __pyx_r = NULL;
16614   __pyx_L0:;
16615   __Pyx_XGIVEREF(__pyx_r);
16616   __Pyx_RefNannyFinishContext();
16617   return __pyx_r;
16618 }
16619 
16620 /* "View.MemoryView":567
16621  *
16622  *     @property
16623  *     def strides(self):             # <<<<<<<<<<<<<<
16624  *         if self.view.strides == NULL:
16625  *
16626  */
16627 
16628 /* Python wrapper */
16629 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject * __pyx_v_self)16630 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
16631   PyObject *__pyx_r = 0;
16632   __Pyx_RefNannyDeclarations
16633   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16634   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16635 
16636   /* function exit code */
16637   __Pyx_RefNannyFinishContext();
16638   return __pyx_r;
16639 }
16640 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)16641 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16642   Py_ssize_t __pyx_v_stride;
16643   PyObject *__pyx_r = NULL;
16644   __Pyx_RefNannyDeclarations
16645   int __pyx_t_1;
16646   PyObject *__pyx_t_2 = NULL;
16647   Py_ssize_t *__pyx_t_3;
16648   Py_ssize_t *__pyx_t_4;
16649   Py_ssize_t *__pyx_t_5;
16650   PyObject *__pyx_t_6 = NULL;
16651   int __pyx_lineno = 0;
16652   const char *__pyx_filename = NULL;
16653   int __pyx_clineno = 0;
16654   __Pyx_RefNannySetupContext("__get__", 0);
16655 
16656   /* "View.MemoryView":568
16657  *     @property
16658  *     def strides(self):
16659  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
16660  *
16661  *             raise ValueError("Buffer view does not expose strides")
16662  */
16663   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
16664   if (unlikely(__pyx_t_1)) {
16665 
16666     /* "View.MemoryView":570
16667  *         if self.view.strides == NULL:
16668  *
16669  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
16670  *
16671  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
16672  */
16673     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
16674     __Pyx_GOTREF(__pyx_t_2);
16675     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
16676     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16677     __PYX_ERR(1, 570, __pyx_L1_error)
16678 
16679     /* "View.MemoryView":568
16680  *     @property
16681  *     def strides(self):
16682  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
16683  *
16684  *             raise ValueError("Buffer view does not expose strides")
16685  */
16686   }
16687 
16688   /* "View.MemoryView":572
16689  *             raise ValueError("Buffer view does not expose strides")
16690  *
16691  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
16692  *
16693  *     @property
16694  */
16695   __Pyx_XDECREF(__pyx_r);
16696   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
16697   __Pyx_GOTREF(__pyx_t_2);
16698   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
16699   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
16700     __pyx_t_3 = __pyx_t_5;
16701     __pyx_v_stride = (__pyx_t_3[0]);
16702     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
16703     __Pyx_GOTREF(__pyx_t_6);
16704     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
16705     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16706   }
16707   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
16708   __Pyx_GOTREF(__pyx_t_6);
16709   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16710   __pyx_r = __pyx_t_6;
16711   __pyx_t_6 = 0;
16712   goto __pyx_L0;
16713 
16714   /* "View.MemoryView":567
16715  *
16716  *     @property
16717  *     def strides(self):             # <<<<<<<<<<<<<<
16718  *         if self.view.strides == NULL:
16719  *
16720  */
16721 
16722   /* function exit code */
16723   __pyx_L1_error:;
16724   __Pyx_XDECREF(__pyx_t_2);
16725   __Pyx_XDECREF(__pyx_t_6);
16726   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16727   __pyx_r = NULL;
16728   __pyx_L0:;
16729   __Pyx_XGIVEREF(__pyx_r);
16730   __Pyx_RefNannyFinishContext();
16731   return __pyx_r;
16732 }
16733 
16734 /* "View.MemoryView":575
16735  *
16736  *     @property
16737  *     def suboffsets(self):             # <<<<<<<<<<<<<<
16738  *         if self.view.suboffsets == NULL:
16739  *             return (-1,) * self.view.ndim
16740  */
16741 
16742 /* Python wrapper */
16743 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject * __pyx_v_self)16744 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
16745   PyObject *__pyx_r = 0;
16746   __Pyx_RefNannyDeclarations
16747   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16748   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16749 
16750   /* function exit code */
16751   __Pyx_RefNannyFinishContext();
16752   return __pyx_r;
16753 }
16754 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)16755 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16756   Py_ssize_t __pyx_v_suboffset;
16757   PyObject *__pyx_r = NULL;
16758   __Pyx_RefNannyDeclarations
16759   int __pyx_t_1;
16760   PyObject *__pyx_t_2 = NULL;
16761   PyObject *__pyx_t_3 = NULL;
16762   Py_ssize_t *__pyx_t_4;
16763   Py_ssize_t *__pyx_t_5;
16764   Py_ssize_t *__pyx_t_6;
16765   int __pyx_lineno = 0;
16766   const char *__pyx_filename = NULL;
16767   int __pyx_clineno = 0;
16768   __Pyx_RefNannySetupContext("__get__", 0);
16769 
16770   /* "View.MemoryView":576
16771  *     @property
16772  *     def suboffsets(self):
16773  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
16774  *             return (-1,) * self.view.ndim
16775  *
16776  */
16777   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
16778   if (__pyx_t_1) {
16779 
16780     /* "View.MemoryView":577
16781  *     def suboffsets(self):
16782  *         if self.view.suboffsets == NULL:
16783  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
16784  *
16785  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
16786  */
16787     __Pyx_XDECREF(__pyx_r);
16788     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
16789     __Pyx_GOTREF(__pyx_t_2);
16790     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
16791     __Pyx_GOTREF(__pyx_t_3);
16792     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16793     __pyx_r = __pyx_t_3;
16794     __pyx_t_3 = 0;
16795     goto __pyx_L0;
16796 
16797     /* "View.MemoryView":576
16798  *     @property
16799  *     def suboffsets(self):
16800  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
16801  *             return (-1,) * self.view.ndim
16802  *
16803  */
16804   }
16805 
16806   /* "View.MemoryView":579
16807  *             return (-1,) * self.view.ndim
16808  *
16809  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
16810  *
16811  *     @property
16812  */
16813   __Pyx_XDECREF(__pyx_r);
16814   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
16815   __Pyx_GOTREF(__pyx_t_3);
16816   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
16817   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
16818     __pyx_t_4 = __pyx_t_6;
16819     __pyx_v_suboffset = (__pyx_t_4[0]);
16820     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
16821     __Pyx_GOTREF(__pyx_t_2);
16822     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
16823     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16824   }
16825   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
16826   __Pyx_GOTREF(__pyx_t_2);
16827   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16828   __pyx_r = __pyx_t_2;
16829   __pyx_t_2 = 0;
16830   goto __pyx_L0;
16831 
16832   /* "View.MemoryView":575
16833  *
16834  *     @property
16835  *     def suboffsets(self):             # <<<<<<<<<<<<<<
16836  *         if self.view.suboffsets == NULL:
16837  *             return (-1,) * self.view.ndim
16838  */
16839 
16840   /* function exit code */
16841   __pyx_L1_error:;
16842   __Pyx_XDECREF(__pyx_t_2);
16843   __Pyx_XDECREF(__pyx_t_3);
16844   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16845   __pyx_r = NULL;
16846   __pyx_L0:;
16847   __Pyx_XGIVEREF(__pyx_r);
16848   __Pyx_RefNannyFinishContext();
16849   return __pyx_r;
16850 }
16851 
16852 /* "View.MemoryView":582
16853  *
16854  *     @property
16855  *     def ndim(self):             # <<<<<<<<<<<<<<
16856  *         return self.view.ndim
16857  *
16858  */
16859 
16860 /* Python wrapper */
16861 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject * __pyx_v_self)16862 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
16863   PyObject *__pyx_r = 0;
16864   __Pyx_RefNannyDeclarations
16865   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16866   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16867 
16868   /* function exit code */
16869   __Pyx_RefNannyFinishContext();
16870   return __pyx_r;
16871 }
16872 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)16873 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16874   PyObject *__pyx_r = NULL;
16875   __Pyx_RefNannyDeclarations
16876   PyObject *__pyx_t_1 = NULL;
16877   int __pyx_lineno = 0;
16878   const char *__pyx_filename = NULL;
16879   int __pyx_clineno = 0;
16880   __Pyx_RefNannySetupContext("__get__", 0);
16881 
16882   /* "View.MemoryView":583
16883  *     @property
16884  *     def ndim(self):
16885  *         return self.view.ndim             # <<<<<<<<<<<<<<
16886  *
16887  *     @property
16888  */
16889   __Pyx_XDECREF(__pyx_r);
16890   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
16891   __Pyx_GOTREF(__pyx_t_1);
16892   __pyx_r = __pyx_t_1;
16893   __pyx_t_1 = 0;
16894   goto __pyx_L0;
16895 
16896   /* "View.MemoryView":582
16897  *
16898  *     @property
16899  *     def ndim(self):             # <<<<<<<<<<<<<<
16900  *         return self.view.ndim
16901  *
16902  */
16903 
16904   /* function exit code */
16905   __pyx_L1_error:;
16906   __Pyx_XDECREF(__pyx_t_1);
16907   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16908   __pyx_r = NULL;
16909   __pyx_L0:;
16910   __Pyx_XGIVEREF(__pyx_r);
16911   __Pyx_RefNannyFinishContext();
16912   return __pyx_r;
16913 }
16914 
16915 /* "View.MemoryView":586
16916  *
16917  *     @property
16918  *     def itemsize(self):             # <<<<<<<<<<<<<<
16919  *         return self.view.itemsize
16920  *
16921  */
16922 
16923 /* Python wrapper */
16924 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject * __pyx_v_self)16925 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
16926   PyObject *__pyx_r = 0;
16927   __Pyx_RefNannyDeclarations
16928   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16929   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16930 
16931   /* function exit code */
16932   __Pyx_RefNannyFinishContext();
16933   return __pyx_r;
16934 }
16935 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)16936 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16937   PyObject *__pyx_r = NULL;
16938   __Pyx_RefNannyDeclarations
16939   PyObject *__pyx_t_1 = NULL;
16940   int __pyx_lineno = 0;
16941   const char *__pyx_filename = NULL;
16942   int __pyx_clineno = 0;
16943   __Pyx_RefNannySetupContext("__get__", 0);
16944 
16945   /* "View.MemoryView":587
16946  *     @property
16947  *     def itemsize(self):
16948  *         return self.view.itemsize             # <<<<<<<<<<<<<<
16949  *
16950  *     @property
16951  */
16952   __Pyx_XDECREF(__pyx_r);
16953   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
16954   __Pyx_GOTREF(__pyx_t_1);
16955   __pyx_r = __pyx_t_1;
16956   __pyx_t_1 = 0;
16957   goto __pyx_L0;
16958 
16959   /* "View.MemoryView":586
16960  *
16961  *     @property
16962  *     def itemsize(self):             # <<<<<<<<<<<<<<
16963  *         return self.view.itemsize
16964  *
16965  */
16966 
16967   /* function exit code */
16968   __pyx_L1_error:;
16969   __Pyx_XDECREF(__pyx_t_1);
16970   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16971   __pyx_r = NULL;
16972   __pyx_L0:;
16973   __Pyx_XGIVEREF(__pyx_r);
16974   __Pyx_RefNannyFinishContext();
16975   return __pyx_r;
16976 }
16977 
16978 /* "View.MemoryView":590
16979  *
16980  *     @property
16981  *     def nbytes(self):             # <<<<<<<<<<<<<<
16982  *         return self.size * self.view.itemsize
16983  *
16984  */
16985 
16986 /* Python wrapper */
16987 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject * __pyx_v_self)16988 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
16989   PyObject *__pyx_r = 0;
16990   __Pyx_RefNannyDeclarations
16991   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16992   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16993 
16994   /* function exit code */
16995   __Pyx_RefNannyFinishContext();
16996   return __pyx_r;
16997 }
16998 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)16999 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17000   PyObject *__pyx_r = NULL;
17001   __Pyx_RefNannyDeclarations
17002   PyObject *__pyx_t_1 = NULL;
17003   PyObject *__pyx_t_2 = NULL;
17004   PyObject *__pyx_t_3 = NULL;
17005   int __pyx_lineno = 0;
17006   const char *__pyx_filename = NULL;
17007   int __pyx_clineno = 0;
17008   __Pyx_RefNannySetupContext("__get__", 0);
17009 
17010   /* "View.MemoryView":591
17011  *     @property
17012  *     def nbytes(self):
17013  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
17014  *
17015  *     @property
17016  */
17017   __Pyx_XDECREF(__pyx_r);
17018   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
17019   __Pyx_GOTREF(__pyx_t_1);
17020   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
17021   __Pyx_GOTREF(__pyx_t_2);
17022   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
17023   __Pyx_GOTREF(__pyx_t_3);
17024   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17025   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17026   __pyx_r = __pyx_t_3;
17027   __pyx_t_3 = 0;
17028   goto __pyx_L0;
17029 
17030   /* "View.MemoryView":590
17031  *
17032  *     @property
17033  *     def nbytes(self):             # <<<<<<<<<<<<<<
17034  *         return self.size * self.view.itemsize
17035  *
17036  */
17037 
17038   /* function exit code */
17039   __pyx_L1_error:;
17040   __Pyx_XDECREF(__pyx_t_1);
17041   __Pyx_XDECREF(__pyx_t_2);
17042   __Pyx_XDECREF(__pyx_t_3);
17043   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17044   __pyx_r = NULL;
17045   __pyx_L0:;
17046   __Pyx_XGIVEREF(__pyx_r);
17047   __Pyx_RefNannyFinishContext();
17048   return __pyx_r;
17049 }
17050 
17051 /* "View.MemoryView":594
17052  *
17053  *     @property
17054  *     def size(self):             # <<<<<<<<<<<<<<
17055  *         if self._size is None:
17056  *             result = 1
17057  */
17058 
17059 /* Python wrapper */
17060 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject * __pyx_v_self)17061 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
17062   PyObject *__pyx_r = 0;
17063   __Pyx_RefNannyDeclarations
17064   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17065   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17066 
17067   /* function exit code */
17068   __Pyx_RefNannyFinishContext();
17069   return __pyx_r;
17070 }
17071 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)17072 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17073   PyObject *__pyx_v_result = NULL;
17074   PyObject *__pyx_v_length = NULL;
17075   PyObject *__pyx_r = NULL;
17076   __Pyx_RefNannyDeclarations
17077   int __pyx_t_1;
17078   int __pyx_t_2;
17079   Py_ssize_t *__pyx_t_3;
17080   Py_ssize_t *__pyx_t_4;
17081   Py_ssize_t *__pyx_t_5;
17082   PyObject *__pyx_t_6 = NULL;
17083   int __pyx_lineno = 0;
17084   const char *__pyx_filename = NULL;
17085   int __pyx_clineno = 0;
17086   __Pyx_RefNannySetupContext("__get__", 0);
17087 
17088   /* "View.MemoryView":595
17089  *     @property
17090  *     def size(self):
17091  *         if self._size is None:             # <<<<<<<<<<<<<<
17092  *             result = 1
17093  *
17094  */
17095   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
17096   __pyx_t_2 = (__pyx_t_1 != 0);
17097   if (__pyx_t_2) {
17098 
17099     /* "View.MemoryView":596
17100  *     def size(self):
17101  *         if self._size is None:
17102  *             result = 1             # <<<<<<<<<<<<<<
17103  *
17104  *             for length in self.view.shape[:self.view.ndim]:
17105  */
17106     __Pyx_INCREF(__pyx_int_1);
17107     __pyx_v_result = __pyx_int_1;
17108 
17109     /* "View.MemoryView":598
17110  *             result = 1
17111  *
17112  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
17113  *                 result *= length
17114  *
17115  */
17116     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
17117     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17118       __pyx_t_3 = __pyx_t_5;
17119       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
17120       __Pyx_GOTREF(__pyx_t_6);
17121       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
17122       __pyx_t_6 = 0;
17123 
17124       /* "View.MemoryView":599
17125  *
17126  *             for length in self.view.shape[:self.view.ndim]:
17127  *                 result *= length             # <<<<<<<<<<<<<<
17128  *
17129  *             self._size = result
17130  */
17131       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
17132       __Pyx_GOTREF(__pyx_t_6);
17133       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
17134       __pyx_t_6 = 0;
17135     }
17136 
17137     /* "View.MemoryView":601
17138  *                 result *= length
17139  *
17140  *             self._size = result             # <<<<<<<<<<<<<<
17141  *
17142  *         return self._size
17143  */
17144     __Pyx_INCREF(__pyx_v_result);
17145     __Pyx_GIVEREF(__pyx_v_result);
17146     __Pyx_GOTREF(__pyx_v_self->_size);
17147     __Pyx_DECREF(__pyx_v_self->_size);
17148     __pyx_v_self->_size = __pyx_v_result;
17149 
17150     /* "View.MemoryView":595
17151  *     @property
17152  *     def size(self):
17153  *         if self._size is None:             # <<<<<<<<<<<<<<
17154  *             result = 1
17155  *
17156  */
17157   }
17158 
17159   /* "View.MemoryView":603
17160  *             self._size = result
17161  *
17162  *         return self._size             # <<<<<<<<<<<<<<
17163  *
17164  *     def __len__(self):
17165  */
17166   __Pyx_XDECREF(__pyx_r);
17167   __Pyx_INCREF(__pyx_v_self->_size);
17168   __pyx_r = __pyx_v_self->_size;
17169   goto __pyx_L0;
17170 
17171   /* "View.MemoryView":594
17172  *
17173  *     @property
17174  *     def size(self):             # <<<<<<<<<<<<<<
17175  *         if self._size is None:
17176  *             result = 1
17177  */
17178 
17179   /* function exit code */
17180   __pyx_L1_error:;
17181   __Pyx_XDECREF(__pyx_t_6);
17182   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17183   __pyx_r = NULL;
17184   __pyx_L0:;
17185   __Pyx_XDECREF(__pyx_v_result);
17186   __Pyx_XDECREF(__pyx_v_length);
17187   __Pyx_XGIVEREF(__pyx_r);
17188   __Pyx_RefNannyFinishContext();
17189   return __pyx_r;
17190 }
17191 
17192 /* "View.MemoryView":605
17193  *         return self._size
17194  *
17195  *     def __len__(self):             # <<<<<<<<<<<<<<
17196  *         if self.view.ndim >= 1:
17197  *             return self.view.shape[0]
17198  */
17199 
17200 /* Python wrapper */
17201 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)17202 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
17203   Py_ssize_t __pyx_r;
17204   __Pyx_RefNannyDeclarations
17205   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
17206   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17207 
17208   /* function exit code */
17209   __Pyx_RefNannyFinishContext();
17210   return __pyx_r;
17211 }
17212 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)17213 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
17214   Py_ssize_t __pyx_r;
17215   __Pyx_RefNannyDeclarations
17216   int __pyx_t_1;
17217   __Pyx_RefNannySetupContext("__len__", 0);
17218 
17219   /* "View.MemoryView":606
17220  *
17221  *     def __len__(self):
17222  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
17223  *             return self.view.shape[0]
17224  *
17225  */
17226   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
17227   if (__pyx_t_1) {
17228 
17229     /* "View.MemoryView":607
17230  *     def __len__(self):
17231  *         if self.view.ndim >= 1:
17232  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
17233  *
17234  *         return 0
17235  */
17236     __pyx_r = (__pyx_v_self->view.shape[0]);
17237     goto __pyx_L0;
17238 
17239     /* "View.MemoryView":606
17240  *
17241  *     def __len__(self):
17242  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
17243  *             return self.view.shape[0]
17244  *
17245  */
17246   }
17247 
17248   /* "View.MemoryView":609
17249  *             return self.view.shape[0]
17250  *
17251  *         return 0             # <<<<<<<<<<<<<<
17252  *
17253  *     def __repr__(self):
17254  */
17255   __pyx_r = 0;
17256   goto __pyx_L0;
17257 
17258   /* "View.MemoryView":605
17259  *         return self._size
17260  *
17261  *     def __len__(self):             # <<<<<<<<<<<<<<
17262  *         if self.view.ndim >= 1:
17263  *             return self.view.shape[0]
17264  */
17265 
17266   /* function exit code */
17267   __pyx_L0:;
17268   __Pyx_RefNannyFinishContext();
17269   return __pyx_r;
17270 }
17271 
17272 /* "View.MemoryView":611
17273  *         return 0
17274  *
17275  *     def __repr__(self):             # <<<<<<<<<<<<<<
17276  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17277  *                                                id(self))
17278  */
17279 
17280 /* Python wrapper */
17281 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)17282 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
17283   PyObject *__pyx_r = 0;
17284   __Pyx_RefNannyDeclarations
17285   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
17286   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17287 
17288   /* function exit code */
17289   __Pyx_RefNannyFinishContext();
17290   return __pyx_r;
17291 }
17292 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)17293 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
17294   PyObject *__pyx_r = NULL;
17295   __Pyx_RefNannyDeclarations
17296   PyObject *__pyx_t_1 = NULL;
17297   PyObject *__pyx_t_2 = NULL;
17298   PyObject *__pyx_t_3 = NULL;
17299   int __pyx_lineno = 0;
17300   const char *__pyx_filename = NULL;
17301   int __pyx_clineno = 0;
17302   __Pyx_RefNannySetupContext("__repr__", 0);
17303 
17304   /* "View.MemoryView":612
17305  *
17306  *     def __repr__(self):
17307  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
17308  *                                                id(self))
17309  *
17310  */
17311   __Pyx_XDECREF(__pyx_r);
17312   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
17313   __Pyx_GOTREF(__pyx_t_1);
17314   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
17315   __Pyx_GOTREF(__pyx_t_2);
17316   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17317   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
17318   __Pyx_GOTREF(__pyx_t_1);
17319   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17320 
17321   /* "View.MemoryView":613
17322  *     def __repr__(self):
17323  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17324  *                                                id(self))             # <<<<<<<<<<<<<<
17325  *
17326  *     def __str__(self):
17327  */
17328   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
17329   __Pyx_GOTREF(__pyx_t_2);
17330 
17331   /* "View.MemoryView":612
17332  *
17333  *     def __repr__(self):
17334  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
17335  *                                                id(self))
17336  *
17337  */
17338   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
17339   __Pyx_GOTREF(__pyx_t_3);
17340   __Pyx_GIVEREF(__pyx_t_1);
17341   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
17342   __Pyx_GIVEREF(__pyx_t_2);
17343   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
17344   __pyx_t_1 = 0;
17345   __pyx_t_2 = 0;
17346   __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
17347   __Pyx_GOTREF(__pyx_t_2);
17348   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17349   __pyx_r = __pyx_t_2;
17350   __pyx_t_2 = 0;
17351   goto __pyx_L0;
17352 
17353   /* "View.MemoryView":611
17354  *         return 0
17355  *
17356  *     def __repr__(self):             # <<<<<<<<<<<<<<
17357  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
17358  *                                                id(self))
17359  */
17360 
17361   /* function exit code */
17362   __pyx_L1_error:;
17363   __Pyx_XDECREF(__pyx_t_1);
17364   __Pyx_XDECREF(__pyx_t_2);
17365   __Pyx_XDECREF(__pyx_t_3);
17366   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17367   __pyx_r = NULL;
17368   __pyx_L0:;
17369   __Pyx_XGIVEREF(__pyx_r);
17370   __Pyx_RefNannyFinishContext();
17371   return __pyx_r;
17372 }
17373 
17374 /* "View.MemoryView":615
17375  *                                                id(self))
17376  *
17377  *     def __str__(self):             # <<<<<<<<<<<<<<
17378  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
17379  *
17380  */
17381 
17382 /* Python wrapper */
17383 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)17384 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
17385   PyObject *__pyx_r = 0;
17386   __Pyx_RefNannyDeclarations
17387   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
17388   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17389 
17390   /* function exit code */
17391   __Pyx_RefNannyFinishContext();
17392   return __pyx_r;
17393 }
17394 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)17395 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
17396   PyObject *__pyx_r = NULL;
17397   __Pyx_RefNannyDeclarations
17398   PyObject *__pyx_t_1 = NULL;
17399   PyObject *__pyx_t_2 = NULL;
17400   int __pyx_lineno = 0;
17401   const char *__pyx_filename = NULL;
17402   int __pyx_clineno = 0;
17403   __Pyx_RefNannySetupContext("__str__", 0);
17404 
17405   /* "View.MemoryView":616
17406  *
17407  *     def __str__(self):
17408  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
17409  *
17410  *
17411  */
17412   __Pyx_XDECREF(__pyx_r);
17413   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17414   __Pyx_GOTREF(__pyx_t_1);
17415   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
17416   __Pyx_GOTREF(__pyx_t_2);
17417   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17418   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17419   __Pyx_GOTREF(__pyx_t_1);
17420   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17421   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
17422   __Pyx_GOTREF(__pyx_t_2);
17423   __Pyx_GIVEREF(__pyx_t_1);
17424   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
17425   __pyx_t_1 = 0;
17426   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
17427   __Pyx_GOTREF(__pyx_t_1);
17428   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17429   __pyx_r = __pyx_t_1;
17430   __pyx_t_1 = 0;
17431   goto __pyx_L0;
17432 
17433   /* "View.MemoryView":615
17434  *                                                id(self))
17435  *
17436  *     def __str__(self):             # <<<<<<<<<<<<<<
17437  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
17438  *
17439  */
17440 
17441   /* function exit code */
17442   __pyx_L1_error:;
17443   __Pyx_XDECREF(__pyx_t_1);
17444   __Pyx_XDECREF(__pyx_t_2);
17445   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17446   __pyx_r = NULL;
17447   __pyx_L0:;
17448   __Pyx_XGIVEREF(__pyx_r);
17449   __Pyx_RefNannyFinishContext();
17450   return __pyx_r;
17451 }
17452 
17453 /* "View.MemoryView":619
17454  *
17455  *
17456  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
17457  *         cdef __Pyx_memviewslice *mslice
17458  *         cdef __Pyx_memviewslice tmp
17459  */
17460 
17461 /* Python wrapper */
17462 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_c_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)17463 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17464   PyObject *__pyx_r = 0;
17465   __Pyx_RefNannyDeclarations
17466   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
17467   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
17468 
17469   /* function exit code */
17470   __Pyx_RefNannyFinishContext();
17471   return __pyx_r;
17472 }
17473 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)17474 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
17475   __Pyx_memviewslice *__pyx_v_mslice;
17476   __Pyx_memviewslice __pyx_v_tmp;
17477   PyObject *__pyx_r = NULL;
17478   __Pyx_RefNannyDeclarations
17479   __Pyx_memviewslice *__pyx_t_1;
17480   PyObject *__pyx_t_2 = NULL;
17481   int __pyx_lineno = 0;
17482   const char *__pyx_filename = NULL;
17483   int __pyx_clineno = 0;
17484   __Pyx_RefNannySetupContext("is_c_contig", 0);
17485 
17486   /* "View.MemoryView":622
17487  *         cdef __Pyx_memviewslice *mslice
17488  *         cdef __Pyx_memviewslice tmp
17489  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
17490  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
17491  *
17492  */
17493   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
17494   __pyx_v_mslice = __pyx_t_1;
17495 
17496   /* "View.MemoryView":623
17497  *         cdef __Pyx_memviewslice tmp
17498  *         mslice = get_slice_from_memview(self, &tmp)
17499  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
17500  *
17501  *     def is_f_contig(self):
17502  */
17503   __Pyx_XDECREF(__pyx_r);
17504   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
17505   __Pyx_GOTREF(__pyx_t_2);
17506   __pyx_r = __pyx_t_2;
17507   __pyx_t_2 = 0;
17508   goto __pyx_L0;
17509 
17510   /* "View.MemoryView":619
17511  *
17512  *
17513  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
17514  *         cdef __Pyx_memviewslice *mslice
17515  *         cdef __Pyx_memviewslice tmp
17516  */
17517 
17518   /* function exit code */
17519   __pyx_L1_error:;
17520   __Pyx_XDECREF(__pyx_t_2);
17521   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
17522   __pyx_r = NULL;
17523   __pyx_L0:;
17524   __Pyx_XGIVEREF(__pyx_r);
17525   __Pyx_RefNannyFinishContext();
17526   return __pyx_r;
17527 }
17528 
17529 /* "View.MemoryView":625
17530  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
17531  *
17532  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
17533  *         cdef __Pyx_memviewslice *mslice
17534  *         cdef __Pyx_memviewslice tmp
17535  */
17536 
17537 /* Python wrapper */
17538 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_f_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)17539 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17540   PyObject *__pyx_r = 0;
17541   __Pyx_RefNannyDeclarations
17542   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
17543   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
17544 
17545   /* function exit code */
17546   __Pyx_RefNannyFinishContext();
17547   return __pyx_r;
17548 }
17549 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)17550 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
17551   __Pyx_memviewslice *__pyx_v_mslice;
17552   __Pyx_memviewslice __pyx_v_tmp;
17553   PyObject *__pyx_r = NULL;
17554   __Pyx_RefNannyDeclarations
17555   __Pyx_memviewslice *__pyx_t_1;
17556   PyObject *__pyx_t_2 = NULL;
17557   int __pyx_lineno = 0;
17558   const char *__pyx_filename = NULL;
17559   int __pyx_clineno = 0;
17560   __Pyx_RefNannySetupContext("is_f_contig", 0);
17561 
17562   /* "View.MemoryView":628
17563  *         cdef __Pyx_memviewslice *mslice
17564  *         cdef __Pyx_memviewslice tmp
17565  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
17566  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
17567  *
17568  */
17569   __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
17570   __pyx_v_mslice = __pyx_t_1;
17571 
17572   /* "View.MemoryView":629
17573  *         cdef __Pyx_memviewslice tmp
17574  *         mslice = get_slice_from_memview(self, &tmp)
17575  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
17576  *
17577  *     def copy(self):
17578  */
17579   __Pyx_XDECREF(__pyx_r);
17580   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
17581   __Pyx_GOTREF(__pyx_t_2);
17582   __pyx_r = __pyx_t_2;
17583   __pyx_t_2 = 0;
17584   goto __pyx_L0;
17585 
17586   /* "View.MemoryView":625
17587  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
17588  *
17589  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
17590  *         cdef __Pyx_memviewslice *mslice
17591  *         cdef __Pyx_memviewslice tmp
17592  */
17593 
17594   /* function exit code */
17595   __pyx_L1_error:;
17596   __Pyx_XDECREF(__pyx_t_2);
17597   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
17598   __pyx_r = NULL;
17599   __pyx_L0:;
17600   __Pyx_XGIVEREF(__pyx_r);
17601   __Pyx_RefNannyFinishContext();
17602   return __pyx_r;
17603 }
17604 
17605 /* "View.MemoryView":631
17606  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
17607  *
17608  *     def copy(self):             # <<<<<<<<<<<<<<
17609  *         cdef __Pyx_memviewslice mslice
17610  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
17611  */
17612 
17613 /* Python wrapper */
17614 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)17615 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17616   PyObject *__pyx_r = 0;
17617   __Pyx_RefNannyDeclarations
17618   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
17619   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
17620 
17621   /* function exit code */
17622   __Pyx_RefNannyFinishContext();
17623   return __pyx_r;
17624 }
17625 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)17626 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
17627   __Pyx_memviewslice __pyx_v_mslice;
17628   int __pyx_v_flags;
17629   PyObject *__pyx_r = NULL;
17630   __Pyx_RefNannyDeclarations
17631   __Pyx_memviewslice __pyx_t_1;
17632   PyObject *__pyx_t_2 = NULL;
17633   int __pyx_lineno = 0;
17634   const char *__pyx_filename = NULL;
17635   int __pyx_clineno = 0;
17636   __Pyx_RefNannySetupContext("copy", 0);
17637 
17638   /* "View.MemoryView":633
17639  *     def copy(self):
17640  *         cdef __Pyx_memviewslice mslice
17641  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
17642  *
17643  *         slice_copy(self, &mslice)
17644  */
17645   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
17646 
17647   /* "View.MemoryView":635
17648  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
17649  *
17650  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
17651  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
17652  *                                    self.view.itemsize,
17653  */
17654   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
17655 
17656   /* "View.MemoryView":636
17657  *
17658  *         slice_copy(self, &mslice)
17659  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
17660  *                                    self.view.itemsize,
17661  *                                    flags|PyBUF_C_CONTIGUOUS,
17662  */
17663   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
17664   __pyx_v_mslice = __pyx_t_1;
17665 
17666   /* "View.MemoryView":641
17667  *                                    self.dtype_is_object)
17668  *
17669  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
17670  *
17671  *     def copy_fortran(self):
17672  */
17673   __Pyx_XDECREF(__pyx_r);
17674   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
17675   __Pyx_GOTREF(__pyx_t_2);
17676   __pyx_r = __pyx_t_2;
17677   __pyx_t_2 = 0;
17678   goto __pyx_L0;
17679 
17680   /* "View.MemoryView":631
17681  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
17682  *
17683  *     def copy(self):             # <<<<<<<<<<<<<<
17684  *         cdef __Pyx_memviewslice mslice
17685  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
17686  */
17687 
17688   /* function exit code */
17689   __pyx_L1_error:;
17690   __Pyx_XDECREF(__pyx_t_2);
17691   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17692   __pyx_r = NULL;
17693   __pyx_L0:;
17694   __Pyx_XGIVEREF(__pyx_r);
17695   __Pyx_RefNannyFinishContext();
17696   return __pyx_r;
17697 }
17698 
17699 /* "View.MemoryView":643
17700  *         return memoryview_copy_from_slice(self, &mslice)
17701  *
17702  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
17703  *         cdef __Pyx_memviewslice src, dst
17704  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
17705  */
17706 
17707 /* Python wrapper */
17708 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy_fortran(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)17709 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17710   PyObject *__pyx_r = 0;
17711   __Pyx_RefNannyDeclarations
17712   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
17713   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
17714 
17715   /* function exit code */
17716   __Pyx_RefNannyFinishContext();
17717   return __pyx_r;
17718 }
17719 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)17720 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
17721   __Pyx_memviewslice __pyx_v_src;
17722   __Pyx_memviewslice __pyx_v_dst;
17723   int __pyx_v_flags;
17724   PyObject *__pyx_r = NULL;
17725   __Pyx_RefNannyDeclarations
17726   __Pyx_memviewslice __pyx_t_1;
17727   PyObject *__pyx_t_2 = NULL;
17728   int __pyx_lineno = 0;
17729   const char *__pyx_filename = NULL;
17730   int __pyx_clineno = 0;
17731   __Pyx_RefNannySetupContext("copy_fortran", 0);
17732 
17733   /* "View.MemoryView":645
17734  *     def copy_fortran(self):
17735  *         cdef __Pyx_memviewslice src, dst
17736  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
17737  *
17738  *         slice_copy(self, &src)
17739  */
17740   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
17741 
17742   /* "View.MemoryView":647
17743  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
17744  *
17745  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
17746  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
17747  *                                 self.view.itemsize,
17748  */
17749   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
17750 
17751   /* "View.MemoryView":648
17752  *
17753  *         slice_copy(self, &src)
17754  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
17755  *                                 self.view.itemsize,
17756  *                                 flags|PyBUF_F_CONTIGUOUS,
17757  */
17758   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
17759   __pyx_v_dst = __pyx_t_1;
17760 
17761   /* "View.MemoryView":653
17762  *                                 self.dtype_is_object)
17763  *
17764  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
17765  *
17766  *
17767  */
17768   __Pyx_XDECREF(__pyx_r);
17769   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
17770   __Pyx_GOTREF(__pyx_t_2);
17771   __pyx_r = __pyx_t_2;
17772   __pyx_t_2 = 0;
17773   goto __pyx_L0;
17774 
17775   /* "View.MemoryView":643
17776  *         return memoryview_copy_from_slice(self, &mslice)
17777  *
17778  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
17779  *         cdef __Pyx_memviewslice src, dst
17780  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
17781  */
17782 
17783   /* function exit code */
17784   __pyx_L1_error:;
17785   __Pyx_XDECREF(__pyx_t_2);
17786   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
17787   __pyx_r = NULL;
17788   __pyx_L0:;
17789   __Pyx_XGIVEREF(__pyx_r);
17790   __Pyx_RefNannyFinishContext();
17791   return __pyx_r;
17792 }
17793 
17794 /* "(tree fragment)":1
17795  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
17796  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17797  * def __setstate_cython__(self, __pyx_state):
17798  */
17799 
17800 /* Python wrapper */
17801 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)17802 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17803   PyObject *__pyx_r = 0;
17804   __Pyx_RefNannyDeclarations
17805   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17806   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17807 
17808   /* function exit code */
17809   __Pyx_RefNannyFinishContext();
17810   return __pyx_r;
17811 }
17812 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)17813 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
17814   PyObject *__pyx_r = NULL;
17815   __Pyx_RefNannyDeclarations
17816   PyObject *__pyx_t_1 = NULL;
17817   int __pyx_lineno = 0;
17818   const char *__pyx_filename = NULL;
17819   int __pyx_clineno = 0;
17820   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17821 
17822   /* "(tree fragment)":2
17823  * def __reduce_cython__(self):
17824  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
17825  * def __setstate_cython__(self, __pyx_state):
17826  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17827  */
17828   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17829   __Pyx_GOTREF(__pyx_t_1);
17830   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17831   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17832   __PYX_ERR(1, 2, __pyx_L1_error)
17833 
17834   /* "(tree fragment)":1
17835  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
17836  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17837  * def __setstate_cython__(self, __pyx_state):
17838  */
17839 
17840   /* function exit code */
17841   __pyx_L1_error:;
17842   __Pyx_XDECREF(__pyx_t_1);
17843   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17844   __pyx_r = NULL;
17845   __Pyx_XGIVEREF(__pyx_r);
17846   __Pyx_RefNannyFinishContext();
17847   return __pyx_r;
17848 }
17849 
17850 /* "(tree fragment)":3
17851  * def __reduce_cython__(self):
17852  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17853  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
17854  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17855  */
17856 
17857 /* Python wrapper */
17858 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)17859 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17860   PyObject *__pyx_r = 0;
17861   __Pyx_RefNannyDeclarations
17862   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17863   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17864 
17865   /* function exit code */
17866   __Pyx_RefNannyFinishContext();
17867   return __pyx_r;
17868 }
17869 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)17870 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17871   PyObject *__pyx_r = NULL;
17872   __Pyx_RefNannyDeclarations
17873   PyObject *__pyx_t_1 = NULL;
17874   int __pyx_lineno = 0;
17875   const char *__pyx_filename = NULL;
17876   int __pyx_clineno = 0;
17877   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17878 
17879   /* "(tree fragment)":4
17880  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17881  * def __setstate_cython__(self, __pyx_state):
17882  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
17883  */
17884   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17885   __Pyx_GOTREF(__pyx_t_1);
17886   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17887   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17888   __PYX_ERR(1, 4, __pyx_L1_error)
17889 
17890   /* "(tree fragment)":3
17891  * def __reduce_cython__(self):
17892  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17893  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
17894  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17895  */
17896 
17897   /* function exit code */
17898   __pyx_L1_error:;
17899   __Pyx_XDECREF(__pyx_t_1);
17900   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17901   __pyx_r = NULL;
17902   __Pyx_XGIVEREF(__pyx_r);
17903   __Pyx_RefNannyFinishContext();
17904   return __pyx_r;
17905 }
17906 
17907 /* "View.MemoryView":657
17908  *
17909  * @cname('__pyx_memoryview_new')
17910  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
17911  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
17912  *     result.typeinfo = typeinfo
17913  */
17914 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)17915 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
17916   struct __pyx_memoryview_obj *__pyx_v_result = 0;
17917   PyObject *__pyx_r = NULL;
17918   __Pyx_RefNannyDeclarations
17919   PyObject *__pyx_t_1 = NULL;
17920   PyObject *__pyx_t_2 = NULL;
17921   PyObject *__pyx_t_3 = NULL;
17922   int __pyx_lineno = 0;
17923   const char *__pyx_filename = NULL;
17924   int __pyx_clineno = 0;
17925   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
17926 
17927   /* "View.MemoryView":658
17928  * @cname('__pyx_memoryview_new')
17929  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
17930  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
17931  *     result.typeinfo = typeinfo
17932  *     return result
17933  */
17934   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
17935   __Pyx_GOTREF(__pyx_t_1);
17936   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
17937   __Pyx_GOTREF(__pyx_t_2);
17938   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
17939   __Pyx_GOTREF(__pyx_t_3);
17940   __Pyx_INCREF(__pyx_v_o);
17941   __Pyx_GIVEREF(__pyx_v_o);
17942   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
17943   __Pyx_GIVEREF(__pyx_t_1);
17944   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
17945   __Pyx_GIVEREF(__pyx_t_2);
17946   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17947   __pyx_t_1 = 0;
17948   __pyx_t_2 = 0;
17949   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
17950   __Pyx_GOTREF(__pyx_t_2);
17951   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17952   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
17953   __pyx_t_2 = 0;
17954 
17955   /* "View.MemoryView":659
17956  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
17957  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
17958  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
17959  *     return result
17960  *
17961  */
17962   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
17963 
17964   /* "View.MemoryView":660
17965  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
17966  *     result.typeinfo = typeinfo
17967  *     return result             # <<<<<<<<<<<<<<
17968  *
17969  * @cname('__pyx_memoryview_check')
17970  */
17971   __Pyx_XDECREF(__pyx_r);
17972   __Pyx_INCREF(((PyObject *)__pyx_v_result));
17973   __pyx_r = ((PyObject *)__pyx_v_result);
17974   goto __pyx_L0;
17975 
17976   /* "View.MemoryView":657
17977  *
17978  * @cname('__pyx_memoryview_new')
17979  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
17980  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
17981  *     result.typeinfo = typeinfo
17982  */
17983 
17984   /* function exit code */
17985   __pyx_L1_error:;
17986   __Pyx_XDECREF(__pyx_t_1);
17987   __Pyx_XDECREF(__pyx_t_2);
17988   __Pyx_XDECREF(__pyx_t_3);
17989   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
17990   __pyx_r = 0;
17991   __pyx_L0:;
17992   __Pyx_XDECREF((PyObject *)__pyx_v_result);
17993   __Pyx_XGIVEREF(__pyx_r);
17994   __Pyx_RefNannyFinishContext();
17995   return __pyx_r;
17996 }
17997 
17998 /* "View.MemoryView":663
17999  *
18000  * @cname('__pyx_memoryview_check')
18001  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
18002  *     return isinstance(o, memoryview)
18003  *
18004  */
18005 
__pyx_memoryview_check(PyObject * __pyx_v_o)18006 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
18007   int __pyx_r;
18008   __Pyx_RefNannyDeclarations
18009   int __pyx_t_1;
18010   __Pyx_RefNannySetupContext("memoryview_check", 0);
18011 
18012   /* "View.MemoryView":664
18013  * @cname('__pyx_memoryview_check')
18014  * cdef inline bint memoryview_check(object o):
18015  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
18016  *
18017  * cdef tuple _unellipsify(object index, int ndim):
18018  */
18019   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
18020   __pyx_r = __pyx_t_1;
18021   goto __pyx_L0;
18022 
18023   /* "View.MemoryView":663
18024  *
18025  * @cname('__pyx_memoryview_check')
18026  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
18027  *     return isinstance(o, memoryview)
18028  *
18029  */
18030 
18031   /* function exit code */
18032   __pyx_L0:;
18033   __Pyx_RefNannyFinishContext();
18034   return __pyx_r;
18035 }
18036 
18037 /* "View.MemoryView":666
18038  *     return isinstance(o, memoryview)
18039  *
18040  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
18041  *     """
18042  *     Replace all ellipses with full slices and fill incomplete indices with
18043  */
18044 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)18045 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
18046   PyObject *__pyx_v_tup = NULL;
18047   PyObject *__pyx_v_result = NULL;
18048   int __pyx_v_have_slices;
18049   int __pyx_v_seen_ellipsis;
18050   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
18051   PyObject *__pyx_v_item = NULL;
18052   Py_ssize_t __pyx_v_nslices;
18053   PyObject *__pyx_r = NULL;
18054   __Pyx_RefNannyDeclarations
18055   int __pyx_t_1;
18056   int __pyx_t_2;
18057   PyObject *__pyx_t_3 = NULL;
18058   PyObject *__pyx_t_4 = NULL;
18059   Py_ssize_t __pyx_t_5;
18060   PyObject *(*__pyx_t_6)(PyObject *);
18061   PyObject *__pyx_t_7 = NULL;
18062   Py_ssize_t __pyx_t_8;
18063   int __pyx_t_9;
18064   int __pyx_t_10;
18065   PyObject *__pyx_t_11 = NULL;
18066   int __pyx_lineno = 0;
18067   const char *__pyx_filename = NULL;
18068   int __pyx_clineno = 0;
18069   __Pyx_RefNannySetupContext("_unellipsify", 0);
18070 
18071   /* "View.MemoryView":671
18072  *     full slices.
18073  *     """
18074  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
18075  *         tup = (index,)
18076  *     else:
18077  */
18078   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
18079   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
18080   if (__pyx_t_2) {
18081 
18082     /* "View.MemoryView":672
18083  *     """
18084  *     if not isinstance(index, tuple):
18085  *         tup = (index,)             # <<<<<<<<<<<<<<
18086  *     else:
18087  *         tup = index
18088  */
18089     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
18090     __Pyx_GOTREF(__pyx_t_3);
18091     __Pyx_INCREF(__pyx_v_index);
18092     __Pyx_GIVEREF(__pyx_v_index);
18093     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
18094     __pyx_v_tup = __pyx_t_3;
18095     __pyx_t_3 = 0;
18096 
18097     /* "View.MemoryView":671
18098  *     full slices.
18099  *     """
18100  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
18101  *         tup = (index,)
18102  *     else:
18103  */
18104     goto __pyx_L3;
18105   }
18106 
18107   /* "View.MemoryView":674
18108  *         tup = (index,)
18109  *     else:
18110  *         tup = index             # <<<<<<<<<<<<<<
18111  *
18112  *     result = []
18113  */
18114   /*else*/ {
18115     __Pyx_INCREF(__pyx_v_index);
18116     __pyx_v_tup = __pyx_v_index;
18117   }
18118   __pyx_L3:;
18119 
18120   /* "View.MemoryView":676
18121  *         tup = index
18122  *
18123  *     result = []             # <<<<<<<<<<<<<<
18124  *     have_slices = False
18125  *     seen_ellipsis = False
18126  */
18127   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
18128   __Pyx_GOTREF(__pyx_t_3);
18129   __pyx_v_result = ((PyObject*)__pyx_t_3);
18130   __pyx_t_3 = 0;
18131 
18132   /* "View.MemoryView":677
18133  *
18134  *     result = []
18135  *     have_slices = False             # <<<<<<<<<<<<<<
18136  *     seen_ellipsis = False
18137  *     for idx, item in enumerate(tup):
18138  */
18139   __pyx_v_have_slices = 0;
18140 
18141   /* "View.MemoryView":678
18142  *     result = []
18143  *     have_slices = False
18144  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
18145  *     for idx, item in enumerate(tup):
18146  *         if item is Ellipsis:
18147  */
18148   __pyx_v_seen_ellipsis = 0;
18149 
18150   /* "View.MemoryView":679
18151  *     have_slices = False
18152  *     seen_ellipsis = False
18153  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
18154  *         if item is Ellipsis:
18155  *             if not seen_ellipsis:
18156  */
18157   __Pyx_INCREF(__pyx_int_0);
18158   __pyx_t_3 = __pyx_int_0;
18159   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
18160     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
18161     __pyx_t_6 = NULL;
18162   } else {
18163     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
18164     __Pyx_GOTREF(__pyx_t_4);
18165     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
18166   }
18167   for (;;) {
18168     if (likely(!__pyx_t_6)) {
18169       if (likely(PyList_CheckExact(__pyx_t_4))) {
18170         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
18171         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18172         __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
18173         #else
18174         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18175         __Pyx_GOTREF(__pyx_t_7);
18176         #endif
18177       } else {
18178         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
18179         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18180         __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
18181         #else
18182         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18183         __Pyx_GOTREF(__pyx_t_7);
18184         #endif
18185       }
18186     } else {
18187       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
18188       if (unlikely(!__pyx_t_7)) {
18189         PyObject* exc_type = PyErr_Occurred();
18190         if (exc_type) {
18191           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18192           else __PYX_ERR(1, 679, __pyx_L1_error)
18193         }
18194         break;
18195       }
18196       __Pyx_GOTREF(__pyx_t_7);
18197     }
18198     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
18199     __pyx_t_7 = 0;
18200     __Pyx_INCREF(__pyx_t_3);
18201     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
18202     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
18203     __Pyx_GOTREF(__pyx_t_7);
18204     __Pyx_DECREF(__pyx_t_3);
18205     __pyx_t_3 = __pyx_t_7;
18206     __pyx_t_7 = 0;
18207 
18208     /* "View.MemoryView":680
18209  *     seen_ellipsis = False
18210  *     for idx, item in enumerate(tup):
18211  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
18212  *             if not seen_ellipsis:
18213  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
18214  */
18215     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
18216     __pyx_t_1 = (__pyx_t_2 != 0);
18217     if (__pyx_t_1) {
18218 
18219       /* "View.MemoryView":681
18220  *     for idx, item in enumerate(tup):
18221  *         if item is Ellipsis:
18222  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
18223  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
18224  *                 seen_ellipsis = True
18225  */
18226       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
18227       if (__pyx_t_1) {
18228 
18229         /* "View.MemoryView":682
18230  *         if item is Ellipsis:
18231  *             if not seen_ellipsis:
18232  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
18233  *                 seen_ellipsis = True
18234  *             else:
18235  */
18236         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
18237         __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
18238         __Pyx_GOTREF(__pyx_t_7);
18239         { Py_ssize_t __pyx_temp;
18240           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
18241             __Pyx_INCREF(__pyx_slice__17);
18242             __Pyx_GIVEREF(__pyx_slice__17);
18243             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__17);
18244           }
18245         }
18246         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
18247         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18248 
18249         /* "View.MemoryView":683
18250  *             if not seen_ellipsis:
18251  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
18252  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
18253  *             else:
18254  *                 result.append(slice(None))
18255  */
18256         __pyx_v_seen_ellipsis = 1;
18257 
18258         /* "View.MemoryView":681
18259  *     for idx, item in enumerate(tup):
18260  *         if item is Ellipsis:
18261  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
18262  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
18263  *                 seen_ellipsis = True
18264  */
18265         goto __pyx_L7;
18266       }
18267 
18268       /* "View.MemoryView":685
18269  *                 seen_ellipsis = True
18270  *             else:
18271  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
18272  *             have_slices = True
18273  *         else:
18274  */
18275       /*else*/ {
18276         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
18277       }
18278       __pyx_L7:;
18279 
18280       /* "View.MemoryView":686
18281  *             else:
18282  *                 result.append(slice(None))
18283  *             have_slices = True             # <<<<<<<<<<<<<<
18284  *         else:
18285  *             if not isinstance(item, slice) and not PyIndex_Check(item):
18286  */
18287       __pyx_v_have_slices = 1;
18288 
18289       /* "View.MemoryView":680
18290  *     seen_ellipsis = False
18291  *     for idx, item in enumerate(tup):
18292  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
18293  *             if not seen_ellipsis:
18294  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
18295  */
18296       goto __pyx_L6;
18297     }
18298 
18299     /* "View.MemoryView":688
18300  *             have_slices = True
18301  *         else:
18302  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
18303  *                 raise TypeError("Cannot index with type '%s'" % type(item))
18304  *
18305  */
18306     /*else*/ {
18307       __pyx_t_2 = PySlice_Check(__pyx_v_item);
18308       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
18309       if (__pyx_t_10) {
18310       } else {
18311         __pyx_t_1 = __pyx_t_10;
18312         goto __pyx_L9_bool_binop_done;
18313       }
18314       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
18315       __pyx_t_1 = __pyx_t_10;
18316       __pyx_L9_bool_binop_done:;
18317       if (unlikely(__pyx_t_1)) {
18318 
18319         /* "View.MemoryView":689
18320  *         else:
18321  *             if not isinstance(item, slice) and not PyIndex_Check(item):
18322  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
18323  *
18324  *             have_slices = have_slices or isinstance(item, slice)
18325  */
18326         __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
18327         __Pyx_GOTREF(__pyx_t_7);
18328         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
18329         __Pyx_GOTREF(__pyx_t_11);
18330         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18331         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
18332         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
18333         __PYX_ERR(1, 689, __pyx_L1_error)
18334 
18335         /* "View.MemoryView":688
18336  *             have_slices = True
18337  *         else:
18338  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
18339  *                 raise TypeError("Cannot index with type '%s'" % type(item))
18340  *
18341  */
18342       }
18343 
18344       /* "View.MemoryView":691
18345  *                 raise TypeError("Cannot index with type '%s'" % type(item))
18346  *
18347  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
18348  *             result.append(item)
18349  *
18350  */
18351       __pyx_t_10 = (__pyx_v_have_slices != 0);
18352       if (!__pyx_t_10) {
18353       } else {
18354         __pyx_t_1 = __pyx_t_10;
18355         goto __pyx_L11_bool_binop_done;
18356       }
18357       __pyx_t_10 = PySlice_Check(__pyx_v_item);
18358       __pyx_t_2 = (__pyx_t_10 != 0);
18359       __pyx_t_1 = __pyx_t_2;
18360       __pyx_L11_bool_binop_done:;
18361       __pyx_v_have_slices = __pyx_t_1;
18362 
18363       /* "View.MemoryView":692
18364  *
18365  *             have_slices = have_slices or isinstance(item, slice)
18366  *             result.append(item)             # <<<<<<<<<<<<<<
18367  *
18368  *     nslices = ndim - len(result)
18369  */
18370       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
18371     }
18372     __pyx_L6:;
18373 
18374     /* "View.MemoryView":679
18375  *     have_slices = False
18376  *     seen_ellipsis = False
18377  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
18378  *         if item is Ellipsis:
18379  *             if not seen_ellipsis:
18380  */
18381   }
18382   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18383   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18384 
18385   /* "View.MemoryView":694
18386  *             result.append(item)
18387  *
18388  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
18389  *     if nslices:
18390  *         result.extend([slice(None)] * nslices)
18391  */
18392   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
18393   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
18394 
18395   /* "View.MemoryView":695
18396  *
18397  *     nslices = ndim - len(result)
18398  *     if nslices:             # <<<<<<<<<<<<<<
18399  *         result.extend([slice(None)] * nslices)
18400  *
18401  */
18402   __pyx_t_1 = (__pyx_v_nslices != 0);
18403   if (__pyx_t_1) {
18404 
18405     /* "View.MemoryView":696
18406  *     nslices = ndim - len(result)
18407  *     if nslices:
18408  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
18409  *
18410  *     return have_slices or nslices, tuple(result)
18411  */
18412     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
18413     __Pyx_GOTREF(__pyx_t_3);
18414     { Py_ssize_t __pyx_temp;
18415       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
18416         __Pyx_INCREF(__pyx_slice__17);
18417         __Pyx_GIVEREF(__pyx_slice__17);
18418         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__17);
18419       }
18420     }
18421     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
18422     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18423 
18424     /* "View.MemoryView":695
18425  *
18426  *     nslices = ndim - len(result)
18427  *     if nslices:             # <<<<<<<<<<<<<<
18428  *         result.extend([slice(None)] * nslices)
18429  *
18430  */
18431   }
18432 
18433   /* "View.MemoryView":698
18434  *         result.extend([slice(None)] * nslices)
18435  *
18436  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
18437  *
18438  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
18439  */
18440   __Pyx_XDECREF(__pyx_r);
18441   if (!__pyx_v_have_slices) {
18442   } else {
18443     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18444     __Pyx_GOTREF(__pyx_t_4);
18445     __pyx_t_3 = __pyx_t_4;
18446     __pyx_t_4 = 0;
18447     goto __pyx_L14_bool_binop_done;
18448   }
18449   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18450   __Pyx_GOTREF(__pyx_t_4);
18451   __pyx_t_3 = __pyx_t_4;
18452   __pyx_t_4 = 0;
18453   __pyx_L14_bool_binop_done:;
18454   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
18455   __Pyx_GOTREF(__pyx_t_4);
18456   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
18457   __Pyx_GOTREF(__pyx_t_11);
18458   __Pyx_GIVEREF(__pyx_t_3);
18459   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
18460   __Pyx_GIVEREF(__pyx_t_4);
18461   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
18462   __pyx_t_3 = 0;
18463   __pyx_t_4 = 0;
18464   __pyx_r = ((PyObject*)__pyx_t_11);
18465   __pyx_t_11 = 0;
18466   goto __pyx_L0;
18467 
18468   /* "View.MemoryView":666
18469  *     return isinstance(o, memoryview)
18470  *
18471  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
18472  *     """
18473  *     Replace all ellipses with full slices and fill incomplete indices with
18474  */
18475 
18476   /* function exit code */
18477   __pyx_L1_error:;
18478   __Pyx_XDECREF(__pyx_t_3);
18479   __Pyx_XDECREF(__pyx_t_4);
18480   __Pyx_XDECREF(__pyx_t_7);
18481   __Pyx_XDECREF(__pyx_t_11);
18482   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
18483   __pyx_r = 0;
18484   __pyx_L0:;
18485   __Pyx_XDECREF(__pyx_v_tup);
18486   __Pyx_XDECREF(__pyx_v_result);
18487   __Pyx_XDECREF(__pyx_v_idx);
18488   __Pyx_XDECREF(__pyx_v_item);
18489   __Pyx_XGIVEREF(__pyx_r);
18490   __Pyx_RefNannyFinishContext();
18491   return __pyx_r;
18492 }
18493 
18494 /* "View.MemoryView":700
18495  *     return have_slices or nslices, tuple(result)
18496  *
18497  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
18498  *     for suboffset in suboffsets[:ndim]:
18499  *         if suboffset >= 0:
18500  */
18501 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)18502 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
18503   Py_ssize_t __pyx_v_suboffset;
18504   PyObject *__pyx_r = NULL;
18505   __Pyx_RefNannyDeclarations
18506   Py_ssize_t *__pyx_t_1;
18507   Py_ssize_t *__pyx_t_2;
18508   Py_ssize_t *__pyx_t_3;
18509   int __pyx_t_4;
18510   PyObject *__pyx_t_5 = NULL;
18511   int __pyx_lineno = 0;
18512   const char *__pyx_filename = NULL;
18513   int __pyx_clineno = 0;
18514   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
18515 
18516   /* "View.MemoryView":701
18517  *
18518  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
18519  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
18520  *         if suboffset >= 0:
18521  *             raise ValueError("Indirect dimensions not supported")
18522  */
18523   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
18524   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
18525     __pyx_t_1 = __pyx_t_3;
18526     __pyx_v_suboffset = (__pyx_t_1[0]);
18527 
18528     /* "View.MemoryView":702
18529  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
18530  *     for suboffset in suboffsets[:ndim]:
18531  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
18532  *             raise ValueError("Indirect dimensions not supported")
18533  *
18534  */
18535     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
18536     if (unlikely(__pyx_t_4)) {
18537 
18538       /* "View.MemoryView":703
18539  *     for suboffset in suboffsets[:ndim]:
18540  *         if suboffset >= 0:
18541  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
18542  *
18543  *
18544  */
18545       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
18546       __Pyx_GOTREF(__pyx_t_5);
18547       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
18548       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18549       __PYX_ERR(1, 703, __pyx_L1_error)
18550 
18551       /* "View.MemoryView":702
18552  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
18553  *     for suboffset in suboffsets[:ndim]:
18554  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
18555  *             raise ValueError("Indirect dimensions not supported")
18556  *
18557  */
18558     }
18559   }
18560 
18561   /* "View.MemoryView":700
18562  *     return have_slices or nslices, tuple(result)
18563  *
18564  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
18565  *     for suboffset in suboffsets[:ndim]:
18566  *         if suboffset >= 0:
18567  */
18568 
18569   /* function exit code */
18570   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18571   goto __pyx_L0;
18572   __pyx_L1_error:;
18573   __Pyx_XDECREF(__pyx_t_5);
18574   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
18575   __pyx_r = 0;
18576   __pyx_L0:;
18577   __Pyx_XGIVEREF(__pyx_r);
18578   __Pyx_RefNannyFinishContext();
18579   return __pyx_r;
18580 }
18581 
18582 /* "View.MemoryView":710
18583  *
18584  * @cname('__pyx_memview_slice')
18585  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
18586  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
18587  *     cdef bint negative_step
18588  */
18589 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)18590 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
18591   int __pyx_v_new_ndim;
18592   int __pyx_v_suboffset_dim;
18593   int __pyx_v_dim;
18594   __Pyx_memviewslice __pyx_v_src;
18595   __Pyx_memviewslice __pyx_v_dst;
18596   __Pyx_memviewslice *__pyx_v_p_src;
18597   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
18598   __Pyx_memviewslice *__pyx_v_p_dst;
18599   int *__pyx_v_p_suboffset_dim;
18600   Py_ssize_t __pyx_v_start;
18601   Py_ssize_t __pyx_v_stop;
18602   Py_ssize_t __pyx_v_step;
18603   int __pyx_v_have_start;
18604   int __pyx_v_have_stop;
18605   int __pyx_v_have_step;
18606   PyObject *__pyx_v_index = NULL;
18607   struct __pyx_memoryview_obj *__pyx_r = NULL;
18608   __Pyx_RefNannyDeclarations
18609   int __pyx_t_1;
18610   int __pyx_t_2;
18611   PyObject *__pyx_t_3 = NULL;
18612   struct __pyx_memoryview_obj *__pyx_t_4;
18613   char *__pyx_t_5;
18614   int __pyx_t_6;
18615   Py_ssize_t __pyx_t_7;
18616   PyObject *(*__pyx_t_8)(PyObject *);
18617   PyObject *__pyx_t_9 = NULL;
18618   Py_ssize_t __pyx_t_10;
18619   int __pyx_t_11;
18620   Py_ssize_t __pyx_t_12;
18621   int __pyx_lineno = 0;
18622   const char *__pyx_filename = NULL;
18623   int __pyx_clineno = 0;
18624   __Pyx_RefNannySetupContext("memview_slice", 0);
18625 
18626   /* "View.MemoryView":711
18627  * @cname('__pyx_memview_slice')
18628  * cdef memoryview memview_slice(memoryview memview, object indices):
18629  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
18630  *     cdef bint negative_step
18631  *     cdef __Pyx_memviewslice src, dst
18632  */
18633   __pyx_v_new_ndim = 0;
18634   __pyx_v_suboffset_dim = -1;
18635 
18636   /* "View.MemoryView":718
18637  *
18638  *
18639  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
18640  *
18641  *     cdef _memoryviewslice memviewsliceobj
18642  */
18643   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
18644 
18645   /* "View.MemoryView":722
18646  *     cdef _memoryviewslice memviewsliceobj
18647  *
18648  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
18649  *
18650  *     if isinstance(memview, _memoryviewslice):
18651  */
18652   #ifndef CYTHON_WITHOUT_ASSERTIONS
18653   if (unlikely(!Py_OptimizeFlag)) {
18654     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
18655       PyErr_SetNone(PyExc_AssertionError);
18656       __PYX_ERR(1, 722, __pyx_L1_error)
18657     }
18658   }
18659   #endif
18660 
18661   /* "View.MemoryView":724
18662  *     assert memview.view.ndim > 0
18663  *
18664  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
18665  *         memviewsliceobj = memview
18666  *         p_src = &memviewsliceobj.from_slice
18667  */
18668   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18669   __pyx_t_2 = (__pyx_t_1 != 0);
18670   if (__pyx_t_2) {
18671 
18672     /* "View.MemoryView":725
18673  *
18674  *     if isinstance(memview, _memoryviewslice):
18675  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
18676  *         p_src = &memviewsliceobj.from_slice
18677  *     else:
18678  */
18679     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
18680     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18681     __Pyx_INCREF(__pyx_t_3);
18682     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18683     __pyx_t_3 = 0;
18684 
18685     /* "View.MemoryView":726
18686  *     if isinstance(memview, _memoryviewslice):
18687  *         memviewsliceobj = memview
18688  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
18689  *     else:
18690  *         slice_copy(memview, &src)
18691  */
18692     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
18693 
18694     /* "View.MemoryView":724
18695  *     assert memview.view.ndim > 0
18696  *
18697  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
18698  *         memviewsliceobj = memview
18699  *         p_src = &memviewsliceobj.from_slice
18700  */
18701     goto __pyx_L3;
18702   }
18703 
18704   /* "View.MemoryView":728
18705  *         p_src = &memviewsliceobj.from_slice
18706  *     else:
18707  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
18708  *         p_src = &src
18709  *
18710  */
18711   /*else*/ {
18712     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
18713 
18714     /* "View.MemoryView":729
18715  *     else:
18716  *         slice_copy(memview, &src)
18717  *         p_src = &src             # <<<<<<<<<<<<<<
18718  *
18719  *
18720  */
18721     __pyx_v_p_src = (&__pyx_v_src);
18722   }
18723   __pyx_L3:;
18724 
18725   /* "View.MemoryView":735
18726  *
18727  *
18728  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
18729  *     dst.data = p_src.data
18730  *
18731  */
18732   __pyx_t_4 = __pyx_v_p_src->memview;
18733   __pyx_v_dst.memview = __pyx_t_4;
18734 
18735   /* "View.MemoryView":736
18736  *
18737  *     dst.memview = p_src.memview
18738  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
18739  *
18740  *
18741  */
18742   __pyx_t_5 = __pyx_v_p_src->data;
18743   __pyx_v_dst.data = __pyx_t_5;
18744 
18745   /* "View.MemoryView":741
18746  *
18747  *
18748  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
18749  *     cdef int *p_suboffset_dim = &suboffset_dim
18750  *     cdef Py_ssize_t start, stop, step
18751  */
18752   __pyx_v_p_dst = (&__pyx_v_dst);
18753 
18754   /* "View.MemoryView":742
18755  *
18756  *     cdef __Pyx_memviewslice *p_dst = &dst
18757  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
18758  *     cdef Py_ssize_t start, stop, step
18759  *     cdef bint have_start, have_stop, have_step
18760  */
18761   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
18762 
18763   /* "View.MemoryView":746
18764  *     cdef bint have_start, have_stop, have_step
18765  *
18766  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
18767  *         if PyIndex_Check(index):
18768  *             slice_memviewslice(
18769  */
18770   __pyx_t_6 = 0;
18771   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
18772     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
18773     __pyx_t_8 = NULL;
18774   } else {
18775     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
18776     __Pyx_GOTREF(__pyx_t_3);
18777     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
18778   }
18779   for (;;) {
18780     if (likely(!__pyx_t_8)) {
18781       if (likely(PyList_CheckExact(__pyx_t_3))) {
18782         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
18783         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18784         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
18785         #else
18786         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
18787         __Pyx_GOTREF(__pyx_t_9);
18788         #endif
18789       } else {
18790         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
18791         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18792         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
18793         #else
18794         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
18795         __Pyx_GOTREF(__pyx_t_9);
18796         #endif
18797       }
18798     } else {
18799       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
18800       if (unlikely(!__pyx_t_9)) {
18801         PyObject* exc_type = PyErr_Occurred();
18802         if (exc_type) {
18803           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18804           else __PYX_ERR(1, 746, __pyx_L1_error)
18805         }
18806         break;
18807       }
18808       __Pyx_GOTREF(__pyx_t_9);
18809     }
18810     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
18811     __pyx_t_9 = 0;
18812     __pyx_v_dim = __pyx_t_6;
18813     __pyx_t_6 = (__pyx_t_6 + 1);
18814 
18815     /* "View.MemoryView":747
18816  *
18817  *     for dim, index in enumerate(indices):
18818  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
18819  *             slice_memviewslice(
18820  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
18821  */
18822     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
18823     if (__pyx_t_2) {
18824 
18825       /* "View.MemoryView":751
18826  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
18827  *                 dim, new_ndim, p_suboffset_dim,
18828  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
18829  *                 0, 0, 0, # have_{start,stop,step}
18830  *                 False)
18831  */
18832       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
18833 
18834       /* "View.MemoryView":748
18835  *     for dim, index in enumerate(indices):
18836  *         if PyIndex_Check(index):
18837  *             slice_memviewslice(             # <<<<<<<<<<<<<<
18838  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
18839  *                 dim, new_ndim, p_suboffset_dim,
18840  */
18841       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
18842 
18843       /* "View.MemoryView":747
18844  *
18845  *     for dim, index in enumerate(indices):
18846  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
18847  *             slice_memviewslice(
18848  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
18849  */
18850       goto __pyx_L6;
18851     }
18852 
18853     /* "View.MemoryView":754
18854  *                 0, 0, 0, # have_{start,stop,step}
18855  *                 False)
18856  *         elif index is None:             # <<<<<<<<<<<<<<
18857  *             p_dst.shape[new_ndim] = 1
18858  *             p_dst.strides[new_ndim] = 0
18859  */
18860     __pyx_t_2 = (__pyx_v_index == Py_None);
18861     __pyx_t_1 = (__pyx_t_2 != 0);
18862     if (__pyx_t_1) {
18863 
18864       /* "View.MemoryView":755
18865  *                 False)
18866  *         elif index is None:
18867  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
18868  *             p_dst.strides[new_ndim] = 0
18869  *             p_dst.suboffsets[new_ndim] = -1
18870  */
18871       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
18872 
18873       /* "View.MemoryView":756
18874  *         elif index is None:
18875  *             p_dst.shape[new_ndim] = 1
18876  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
18877  *             p_dst.suboffsets[new_ndim] = -1
18878  *             new_ndim += 1
18879  */
18880       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
18881 
18882       /* "View.MemoryView":757
18883  *             p_dst.shape[new_ndim] = 1
18884  *             p_dst.strides[new_ndim] = 0
18885  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
18886  *             new_ndim += 1
18887  *         else:
18888  */
18889       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
18890 
18891       /* "View.MemoryView":758
18892  *             p_dst.strides[new_ndim] = 0
18893  *             p_dst.suboffsets[new_ndim] = -1
18894  *             new_ndim += 1             # <<<<<<<<<<<<<<
18895  *         else:
18896  *             start = index.start or 0
18897  */
18898       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
18899 
18900       /* "View.MemoryView":754
18901  *                 0, 0, 0, # have_{start,stop,step}
18902  *                 False)
18903  *         elif index is None:             # <<<<<<<<<<<<<<
18904  *             p_dst.shape[new_ndim] = 1
18905  *             p_dst.strides[new_ndim] = 0
18906  */
18907       goto __pyx_L6;
18908     }
18909 
18910     /* "View.MemoryView":760
18911  *             new_ndim += 1
18912  *         else:
18913  *             start = index.start or 0             # <<<<<<<<<<<<<<
18914  *             stop = index.stop or 0
18915  *             step = index.step or 0
18916  */
18917     /*else*/ {
18918       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
18919       __Pyx_GOTREF(__pyx_t_9);
18920       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
18921       if (!__pyx_t_1) {
18922         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18923       } else {
18924         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
18925         __pyx_t_10 = __pyx_t_12;
18926         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18927         goto __pyx_L7_bool_binop_done;
18928       }
18929       __pyx_t_10 = 0;
18930       __pyx_L7_bool_binop_done:;
18931       __pyx_v_start = __pyx_t_10;
18932 
18933       /* "View.MemoryView":761
18934  *         else:
18935  *             start = index.start or 0
18936  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
18937  *             step = index.step or 0
18938  *
18939  */
18940       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
18941       __Pyx_GOTREF(__pyx_t_9);
18942       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
18943       if (!__pyx_t_1) {
18944         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18945       } else {
18946         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
18947         __pyx_t_10 = __pyx_t_12;
18948         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18949         goto __pyx_L9_bool_binop_done;
18950       }
18951       __pyx_t_10 = 0;
18952       __pyx_L9_bool_binop_done:;
18953       __pyx_v_stop = __pyx_t_10;
18954 
18955       /* "View.MemoryView":762
18956  *             start = index.start or 0
18957  *             stop = index.stop or 0
18958  *             step = index.step or 0             # <<<<<<<<<<<<<<
18959  *
18960  *             have_start = index.start is not None
18961  */
18962       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
18963       __Pyx_GOTREF(__pyx_t_9);
18964       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
18965       if (!__pyx_t_1) {
18966         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18967       } else {
18968         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
18969         __pyx_t_10 = __pyx_t_12;
18970         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18971         goto __pyx_L11_bool_binop_done;
18972       }
18973       __pyx_t_10 = 0;
18974       __pyx_L11_bool_binop_done:;
18975       __pyx_v_step = __pyx_t_10;
18976 
18977       /* "View.MemoryView":764
18978  *             step = index.step or 0
18979  *
18980  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
18981  *             have_stop = index.stop is not None
18982  *             have_step = index.step is not None
18983  */
18984       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
18985       __Pyx_GOTREF(__pyx_t_9);
18986       __pyx_t_1 = (__pyx_t_9 != Py_None);
18987       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18988       __pyx_v_have_start = __pyx_t_1;
18989 
18990       /* "View.MemoryView":765
18991  *
18992  *             have_start = index.start is not None
18993  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
18994  *             have_step = index.step is not None
18995  *
18996  */
18997       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
18998       __Pyx_GOTREF(__pyx_t_9);
18999       __pyx_t_1 = (__pyx_t_9 != Py_None);
19000       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19001       __pyx_v_have_stop = __pyx_t_1;
19002 
19003       /* "View.MemoryView":766
19004  *             have_start = index.start is not None
19005  *             have_stop = index.stop is not None
19006  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
19007  *
19008  *             slice_memviewslice(
19009  */
19010       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
19011       __Pyx_GOTREF(__pyx_t_9);
19012       __pyx_t_1 = (__pyx_t_9 != Py_None);
19013       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19014       __pyx_v_have_step = __pyx_t_1;
19015 
19016       /* "View.MemoryView":768
19017  *             have_step = index.step is not None
19018  *
19019  *             slice_memviewslice(             # <<<<<<<<<<<<<<
19020  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
19021  *                 dim, new_ndim, p_suboffset_dim,
19022  */
19023       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
19024 
19025       /* "View.MemoryView":774
19026  *                 have_start, have_stop, have_step,
19027  *                 True)
19028  *             new_ndim += 1             # <<<<<<<<<<<<<<
19029  *
19030  *     if isinstance(memview, _memoryviewslice):
19031  */
19032       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
19033     }
19034     __pyx_L6:;
19035 
19036     /* "View.MemoryView":746
19037  *     cdef bint have_start, have_stop, have_step
19038  *
19039  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
19040  *         if PyIndex_Check(index):
19041  *             slice_memviewslice(
19042  */
19043   }
19044   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19045 
19046   /* "View.MemoryView":776
19047  *             new_ndim += 1
19048  *
19049  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
19050  *         return memoryview_fromslice(dst, new_ndim,
19051  *                                     memviewsliceobj.to_object_func,
19052  */
19053   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19054   __pyx_t_2 = (__pyx_t_1 != 0);
19055   if (__pyx_t_2) {
19056 
19057     /* "View.MemoryView":777
19058  *
19059  *     if isinstance(memview, _memoryviewslice):
19060  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
19061  *                                     memviewsliceobj.to_object_func,
19062  *                                     memviewsliceobj.to_dtype_func,
19063  */
19064     __Pyx_XDECREF(((PyObject *)__pyx_r));
19065 
19066     /* "View.MemoryView":778
19067  *     if isinstance(memview, _memoryviewslice):
19068  *         return memoryview_fromslice(dst, new_ndim,
19069  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
19070  *                                     memviewsliceobj.to_dtype_func,
19071  *                                     memview.dtype_is_object)
19072  */
19073     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
19074 
19075     /* "View.MemoryView":779
19076  *         return memoryview_fromslice(dst, new_ndim,
19077  *                                     memviewsliceobj.to_object_func,
19078  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
19079  *                                     memview.dtype_is_object)
19080  *     else:
19081  */
19082     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
19083 
19084     /* "View.MemoryView":777
19085  *
19086  *     if isinstance(memview, _memoryviewslice):
19087  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
19088  *                                     memviewsliceobj.to_object_func,
19089  *                                     memviewsliceobj.to_dtype_func,
19090  */
19091     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
19092     __Pyx_GOTREF(__pyx_t_3);
19093     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
19094     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
19095     __pyx_t_3 = 0;
19096     goto __pyx_L0;
19097 
19098     /* "View.MemoryView":776
19099  *             new_ndim += 1
19100  *
19101  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
19102  *         return memoryview_fromslice(dst, new_ndim,
19103  *                                     memviewsliceobj.to_object_func,
19104  */
19105   }
19106 
19107   /* "View.MemoryView":782
19108  *                                     memview.dtype_is_object)
19109  *     else:
19110  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
19111  *                                     memview.dtype_is_object)
19112  *
19113  */
19114   /*else*/ {
19115     __Pyx_XDECREF(((PyObject *)__pyx_r));
19116 
19117     /* "View.MemoryView":783
19118  *     else:
19119  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
19120  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
19121  *
19122  *
19123  */
19124     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
19125     __Pyx_GOTREF(__pyx_t_3);
19126 
19127     /* "View.MemoryView":782
19128  *                                     memview.dtype_is_object)
19129  *     else:
19130  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
19131  *                                     memview.dtype_is_object)
19132  *
19133  */
19134     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
19135     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
19136     __pyx_t_3 = 0;
19137     goto __pyx_L0;
19138   }
19139 
19140   /* "View.MemoryView":710
19141  *
19142  * @cname('__pyx_memview_slice')
19143  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
19144  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
19145  *     cdef bint negative_step
19146  */
19147 
19148   /* function exit code */
19149   __pyx_L1_error:;
19150   __Pyx_XDECREF(__pyx_t_3);
19151   __Pyx_XDECREF(__pyx_t_9);
19152   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19153   __pyx_r = 0;
19154   __pyx_L0:;
19155   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
19156   __Pyx_XDECREF(__pyx_v_index);
19157   __Pyx_XGIVEREF((PyObject *)__pyx_r);
19158   __Pyx_RefNannyFinishContext();
19159   return __pyx_r;
19160 }
19161 
19162 /* "View.MemoryView":807
19163  *
19164  * @cname('__pyx_memoryview_slice_memviewslice')
19165  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
19166  *         __Pyx_memviewslice *dst,
19167  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
19168  */
19169 
__pyx_memoryview_slice_memviewslice(__Pyx_memviewslice * __pyx_v_dst,Py_ssize_t __pyx_v_shape,Py_ssize_t __pyx_v_stride,Py_ssize_t __pyx_v_suboffset,int __pyx_v_dim,int __pyx_v_new_ndim,int * __pyx_v_suboffset_dim,Py_ssize_t __pyx_v_start,Py_ssize_t __pyx_v_stop,Py_ssize_t __pyx_v_step,int __pyx_v_have_start,int __pyx_v_have_stop,int __pyx_v_have_step,int __pyx_v_is_slice)19170 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
19171   Py_ssize_t __pyx_v_new_shape;
19172   int __pyx_v_negative_step;
19173   int __pyx_r;
19174   int __pyx_t_1;
19175   int __pyx_t_2;
19176   int __pyx_t_3;
19177   int __pyx_lineno = 0;
19178   const char *__pyx_filename = NULL;
19179   int __pyx_clineno = 0;
19180 
19181   /* "View.MemoryView":827
19182  *     cdef bint negative_step
19183  *
19184  *     if not is_slice:             # <<<<<<<<<<<<<<
19185  *
19186  *         if start < 0:
19187  */
19188   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
19189   if (__pyx_t_1) {
19190 
19191     /* "View.MemoryView":829
19192  *     if not is_slice:
19193  *
19194  *         if start < 0:             # <<<<<<<<<<<<<<
19195  *             start += shape
19196  *         if not 0 <= start < shape:
19197  */
19198     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
19199     if (__pyx_t_1) {
19200 
19201       /* "View.MemoryView":830
19202  *
19203  *         if start < 0:
19204  *             start += shape             # <<<<<<<<<<<<<<
19205  *         if not 0 <= start < shape:
19206  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19207  */
19208       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
19209 
19210       /* "View.MemoryView":829
19211  *     if not is_slice:
19212  *
19213  *         if start < 0:             # <<<<<<<<<<<<<<
19214  *             start += shape
19215  *         if not 0 <= start < shape:
19216  */
19217     }
19218 
19219     /* "View.MemoryView":831
19220  *         if start < 0:
19221  *             start += shape
19222  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
19223  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19224  *     else:
19225  */
19226     __pyx_t_1 = (0 <= __pyx_v_start);
19227     if (__pyx_t_1) {
19228       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
19229     }
19230     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
19231     if (__pyx_t_2) {
19232 
19233       /* "View.MemoryView":832
19234  *             start += shape
19235  *         if not 0 <= start < shape:
19236  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
19237  *     else:
19238  *
19239  */
19240       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
19241 
19242       /* "View.MemoryView":831
19243  *         if start < 0:
19244  *             start += shape
19245  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
19246  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
19247  *     else:
19248  */
19249     }
19250 
19251     /* "View.MemoryView":827
19252  *     cdef bint negative_step
19253  *
19254  *     if not is_slice:             # <<<<<<<<<<<<<<
19255  *
19256  *         if start < 0:
19257  */
19258     goto __pyx_L3;
19259   }
19260 
19261   /* "View.MemoryView":835
19262  *     else:
19263  *
19264  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
19265  *
19266  *         if have_step and step == 0:
19267  */
19268   /*else*/ {
19269     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
19270     if (__pyx_t_1) {
19271     } else {
19272       __pyx_t_2 = __pyx_t_1;
19273       goto __pyx_L6_bool_binop_done;
19274     }
19275     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
19276     __pyx_t_2 = __pyx_t_1;
19277     __pyx_L6_bool_binop_done:;
19278     __pyx_v_negative_step = __pyx_t_2;
19279 
19280     /* "View.MemoryView":837
19281  *         negative_step = have_step != 0 and step < 0
19282  *
19283  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
19284  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
19285  *
19286  */
19287     __pyx_t_1 = (__pyx_v_have_step != 0);
19288     if (__pyx_t_1) {
19289     } else {
19290       __pyx_t_2 = __pyx_t_1;
19291       goto __pyx_L9_bool_binop_done;
19292     }
19293     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
19294     __pyx_t_2 = __pyx_t_1;
19295     __pyx_L9_bool_binop_done:;
19296     if (__pyx_t_2) {
19297 
19298       /* "View.MemoryView":838
19299  *
19300  *         if have_step and step == 0:
19301  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
19302  *
19303  *
19304  */
19305       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
19306 
19307       /* "View.MemoryView":837
19308  *         negative_step = have_step != 0 and step < 0
19309  *
19310  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
19311  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
19312  *
19313  */
19314     }
19315 
19316     /* "View.MemoryView":841
19317  *
19318  *
19319  *         if have_start:             # <<<<<<<<<<<<<<
19320  *             if start < 0:
19321  *                 start += shape
19322  */
19323     __pyx_t_2 = (__pyx_v_have_start != 0);
19324     if (__pyx_t_2) {
19325 
19326       /* "View.MemoryView":842
19327  *
19328  *         if have_start:
19329  *             if start < 0:             # <<<<<<<<<<<<<<
19330  *                 start += shape
19331  *                 if start < 0:
19332  */
19333       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
19334       if (__pyx_t_2) {
19335 
19336         /* "View.MemoryView":843
19337  *         if have_start:
19338  *             if start < 0:
19339  *                 start += shape             # <<<<<<<<<<<<<<
19340  *                 if start < 0:
19341  *                     start = 0
19342  */
19343         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
19344 
19345         /* "View.MemoryView":844
19346  *             if start < 0:
19347  *                 start += shape
19348  *                 if start < 0:             # <<<<<<<<<<<<<<
19349  *                     start = 0
19350  *             elif start >= shape:
19351  */
19352         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
19353         if (__pyx_t_2) {
19354 
19355           /* "View.MemoryView":845
19356  *                 start += shape
19357  *                 if start < 0:
19358  *                     start = 0             # <<<<<<<<<<<<<<
19359  *             elif start >= shape:
19360  *                 if negative_step:
19361  */
19362           __pyx_v_start = 0;
19363 
19364           /* "View.MemoryView":844
19365  *             if start < 0:
19366  *                 start += shape
19367  *                 if start < 0:             # <<<<<<<<<<<<<<
19368  *                     start = 0
19369  *             elif start >= shape:
19370  */
19371         }
19372 
19373         /* "View.MemoryView":842
19374  *
19375  *         if have_start:
19376  *             if start < 0:             # <<<<<<<<<<<<<<
19377  *                 start += shape
19378  *                 if start < 0:
19379  */
19380         goto __pyx_L12;
19381       }
19382 
19383       /* "View.MemoryView":846
19384  *                 if start < 0:
19385  *                     start = 0
19386  *             elif start >= shape:             # <<<<<<<<<<<<<<
19387  *                 if negative_step:
19388  *                     start = shape - 1
19389  */
19390       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
19391       if (__pyx_t_2) {
19392 
19393         /* "View.MemoryView":847
19394  *                     start = 0
19395  *             elif start >= shape:
19396  *                 if negative_step:             # <<<<<<<<<<<<<<
19397  *                     start = shape - 1
19398  *                 else:
19399  */
19400         __pyx_t_2 = (__pyx_v_negative_step != 0);
19401         if (__pyx_t_2) {
19402 
19403           /* "View.MemoryView":848
19404  *             elif start >= shape:
19405  *                 if negative_step:
19406  *                     start = shape - 1             # <<<<<<<<<<<<<<
19407  *                 else:
19408  *                     start = shape
19409  */
19410           __pyx_v_start = (__pyx_v_shape - 1);
19411 
19412           /* "View.MemoryView":847
19413  *                     start = 0
19414  *             elif start >= shape:
19415  *                 if negative_step:             # <<<<<<<<<<<<<<
19416  *                     start = shape - 1
19417  *                 else:
19418  */
19419           goto __pyx_L14;
19420         }
19421 
19422         /* "View.MemoryView":850
19423  *                     start = shape - 1
19424  *                 else:
19425  *                     start = shape             # <<<<<<<<<<<<<<
19426  *         else:
19427  *             if negative_step:
19428  */
19429         /*else*/ {
19430           __pyx_v_start = __pyx_v_shape;
19431         }
19432         __pyx_L14:;
19433 
19434         /* "View.MemoryView":846
19435  *                 if start < 0:
19436  *                     start = 0
19437  *             elif start >= shape:             # <<<<<<<<<<<<<<
19438  *                 if negative_step:
19439  *                     start = shape - 1
19440  */
19441       }
19442       __pyx_L12:;
19443 
19444       /* "View.MemoryView":841
19445  *
19446  *
19447  *         if have_start:             # <<<<<<<<<<<<<<
19448  *             if start < 0:
19449  *                 start += shape
19450  */
19451       goto __pyx_L11;
19452     }
19453 
19454     /* "View.MemoryView":852
19455  *                     start = shape
19456  *         else:
19457  *             if negative_step:             # <<<<<<<<<<<<<<
19458  *                 start = shape - 1
19459  *             else:
19460  */
19461     /*else*/ {
19462       __pyx_t_2 = (__pyx_v_negative_step != 0);
19463       if (__pyx_t_2) {
19464 
19465         /* "View.MemoryView":853
19466  *         else:
19467  *             if negative_step:
19468  *                 start = shape - 1             # <<<<<<<<<<<<<<
19469  *             else:
19470  *                 start = 0
19471  */
19472         __pyx_v_start = (__pyx_v_shape - 1);
19473 
19474         /* "View.MemoryView":852
19475  *                     start = shape
19476  *         else:
19477  *             if negative_step:             # <<<<<<<<<<<<<<
19478  *                 start = shape - 1
19479  *             else:
19480  */
19481         goto __pyx_L15;
19482       }
19483 
19484       /* "View.MemoryView":855
19485  *                 start = shape - 1
19486  *             else:
19487  *                 start = 0             # <<<<<<<<<<<<<<
19488  *
19489  *         if have_stop:
19490  */
19491       /*else*/ {
19492         __pyx_v_start = 0;
19493       }
19494       __pyx_L15:;
19495     }
19496     __pyx_L11:;
19497 
19498     /* "View.MemoryView":857
19499  *                 start = 0
19500  *
19501  *         if have_stop:             # <<<<<<<<<<<<<<
19502  *             if stop < 0:
19503  *                 stop += shape
19504  */
19505     __pyx_t_2 = (__pyx_v_have_stop != 0);
19506     if (__pyx_t_2) {
19507 
19508       /* "View.MemoryView":858
19509  *
19510  *         if have_stop:
19511  *             if stop < 0:             # <<<<<<<<<<<<<<
19512  *                 stop += shape
19513  *                 if stop < 0:
19514  */
19515       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
19516       if (__pyx_t_2) {
19517 
19518         /* "View.MemoryView":859
19519  *         if have_stop:
19520  *             if stop < 0:
19521  *                 stop += shape             # <<<<<<<<<<<<<<
19522  *                 if stop < 0:
19523  *                     stop = 0
19524  */
19525         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
19526 
19527         /* "View.MemoryView":860
19528  *             if stop < 0:
19529  *                 stop += shape
19530  *                 if stop < 0:             # <<<<<<<<<<<<<<
19531  *                     stop = 0
19532  *             elif stop > shape:
19533  */
19534         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
19535         if (__pyx_t_2) {
19536 
19537           /* "View.MemoryView":861
19538  *                 stop += shape
19539  *                 if stop < 0:
19540  *                     stop = 0             # <<<<<<<<<<<<<<
19541  *             elif stop > shape:
19542  *                 stop = shape
19543  */
19544           __pyx_v_stop = 0;
19545 
19546           /* "View.MemoryView":860
19547  *             if stop < 0:
19548  *                 stop += shape
19549  *                 if stop < 0:             # <<<<<<<<<<<<<<
19550  *                     stop = 0
19551  *             elif stop > shape:
19552  */
19553         }
19554 
19555         /* "View.MemoryView":858
19556  *
19557  *         if have_stop:
19558  *             if stop < 0:             # <<<<<<<<<<<<<<
19559  *                 stop += shape
19560  *                 if stop < 0:
19561  */
19562         goto __pyx_L17;
19563       }
19564 
19565       /* "View.MemoryView":862
19566  *                 if stop < 0:
19567  *                     stop = 0
19568  *             elif stop > shape:             # <<<<<<<<<<<<<<
19569  *                 stop = shape
19570  *         else:
19571  */
19572       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
19573       if (__pyx_t_2) {
19574 
19575         /* "View.MemoryView":863
19576  *                     stop = 0
19577  *             elif stop > shape:
19578  *                 stop = shape             # <<<<<<<<<<<<<<
19579  *         else:
19580  *             if negative_step:
19581  */
19582         __pyx_v_stop = __pyx_v_shape;
19583 
19584         /* "View.MemoryView":862
19585  *                 if stop < 0:
19586  *                     stop = 0
19587  *             elif stop > shape:             # <<<<<<<<<<<<<<
19588  *                 stop = shape
19589  *         else:
19590  */
19591       }
19592       __pyx_L17:;
19593 
19594       /* "View.MemoryView":857
19595  *                 start = 0
19596  *
19597  *         if have_stop:             # <<<<<<<<<<<<<<
19598  *             if stop < 0:
19599  *                 stop += shape
19600  */
19601       goto __pyx_L16;
19602     }
19603 
19604     /* "View.MemoryView":865
19605  *                 stop = shape
19606  *         else:
19607  *             if negative_step:             # <<<<<<<<<<<<<<
19608  *                 stop = -1
19609  *             else:
19610  */
19611     /*else*/ {
19612       __pyx_t_2 = (__pyx_v_negative_step != 0);
19613       if (__pyx_t_2) {
19614 
19615         /* "View.MemoryView":866
19616  *         else:
19617  *             if negative_step:
19618  *                 stop = -1             # <<<<<<<<<<<<<<
19619  *             else:
19620  *                 stop = shape
19621  */
19622         __pyx_v_stop = -1L;
19623 
19624         /* "View.MemoryView":865
19625  *                 stop = shape
19626  *         else:
19627  *             if negative_step:             # <<<<<<<<<<<<<<
19628  *                 stop = -1
19629  *             else:
19630  */
19631         goto __pyx_L19;
19632       }
19633 
19634       /* "View.MemoryView":868
19635  *                 stop = -1
19636  *             else:
19637  *                 stop = shape             # <<<<<<<<<<<<<<
19638  *
19639  *         if not have_step:
19640  */
19641       /*else*/ {
19642         __pyx_v_stop = __pyx_v_shape;
19643       }
19644       __pyx_L19:;
19645     }
19646     __pyx_L16:;
19647 
19648     /* "View.MemoryView":870
19649  *                 stop = shape
19650  *
19651  *         if not have_step:             # <<<<<<<<<<<<<<
19652  *             step = 1
19653  *
19654  */
19655     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
19656     if (__pyx_t_2) {
19657 
19658       /* "View.MemoryView":871
19659  *
19660  *         if not have_step:
19661  *             step = 1             # <<<<<<<<<<<<<<
19662  *
19663  *
19664  */
19665       __pyx_v_step = 1;
19666 
19667       /* "View.MemoryView":870
19668  *                 stop = shape
19669  *
19670  *         if not have_step:             # <<<<<<<<<<<<<<
19671  *             step = 1
19672  *
19673  */
19674     }
19675 
19676     /* "View.MemoryView":875
19677  *
19678  *         with cython.cdivision(True):
19679  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
19680  *
19681  *             if (stop - start) - step * new_shape:
19682  */
19683     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
19684 
19685     /* "View.MemoryView":877
19686  *             new_shape = (stop - start) // step
19687  *
19688  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
19689  *                 new_shape += 1
19690  *
19691  */
19692     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
19693     if (__pyx_t_2) {
19694 
19695       /* "View.MemoryView":878
19696  *
19697  *             if (stop - start) - step * new_shape:
19698  *                 new_shape += 1             # <<<<<<<<<<<<<<
19699  *
19700  *         if new_shape < 0:
19701  */
19702       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
19703 
19704       /* "View.MemoryView":877
19705  *             new_shape = (stop - start) // step
19706  *
19707  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
19708  *                 new_shape += 1
19709  *
19710  */
19711     }
19712 
19713     /* "View.MemoryView":880
19714  *                 new_shape += 1
19715  *
19716  *         if new_shape < 0:             # <<<<<<<<<<<<<<
19717  *             new_shape = 0
19718  *
19719  */
19720     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
19721     if (__pyx_t_2) {
19722 
19723       /* "View.MemoryView":881
19724  *
19725  *         if new_shape < 0:
19726  *             new_shape = 0             # <<<<<<<<<<<<<<
19727  *
19728  *
19729  */
19730       __pyx_v_new_shape = 0;
19731 
19732       /* "View.MemoryView":880
19733  *                 new_shape += 1
19734  *
19735  *         if new_shape < 0:             # <<<<<<<<<<<<<<
19736  *             new_shape = 0
19737  *
19738  */
19739     }
19740 
19741     /* "View.MemoryView":884
19742  *
19743  *
19744  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
19745  *         dst.shape[new_ndim] = new_shape
19746  *         dst.suboffsets[new_ndim] = suboffset
19747  */
19748     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
19749 
19750     /* "View.MemoryView":885
19751  *
19752  *         dst.strides[new_ndim] = stride * step
19753  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
19754  *         dst.suboffsets[new_ndim] = suboffset
19755  *
19756  */
19757     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
19758 
19759     /* "View.MemoryView":886
19760  *         dst.strides[new_ndim] = stride * step
19761  *         dst.shape[new_ndim] = new_shape
19762  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
19763  *
19764  *
19765  */
19766     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
19767   }
19768   __pyx_L3:;
19769 
19770   /* "View.MemoryView":889
19771  *
19772  *
19773  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
19774  *         dst.data += start * stride
19775  *     else:
19776  */
19777   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
19778   if (__pyx_t_2) {
19779 
19780     /* "View.MemoryView":890
19781  *
19782  *     if suboffset_dim[0] < 0:
19783  *         dst.data += start * stride             # <<<<<<<<<<<<<<
19784  *     else:
19785  *         dst.suboffsets[suboffset_dim[0]] += start * stride
19786  */
19787     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
19788 
19789     /* "View.MemoryView":889
19790  *
19791  *
19792  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
19793  *         dst.data += start * stride
19794  *     else:
19795  */
19796     goto __pyx_L23;
19797   }
19798 
19799   /* "View.MemoryView":892
19800  *         dst.data += start * stride
19801  *     else:
19802  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
19803  *
19804  *     if suboffset >= 0:
19805  */
19806   /*else*/ {
19807     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
19808     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
19809   }
19810   __pyx_L23:;
19811 
19812   /* "View.MemoryView":894
19813  *         dst.suboffsets[suboffset_dim[0]] += start * stride
19814  *
19815  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
19816  *         if not is_slice:
19817  *             if new_ndim == 0:
19818  */
19819   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
19820   if (__pyx_t_2) {
19821 
19822     /* "View.MemoryView":895
19823  *
19824  *     if suboffset >= 0:
19825  *         if not is_slice:             # <<<<<<<<<<<<<<
19826  *             if new_ndim == 0:
19827  *                 dst.data = (<char **> dst.data)[0] + suboffset
19828  */
19829     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
19830     if (__pyx_t_2) {
19831 
19832       /* "View.MemoryView":896
19833  *     if suboffset >= 0:
19834  *         if not is_slice:
19835  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
19836  *                 dst.data = (<char **> dst.data)[0] + suboffset
19837  *             else:
19838  */
19839       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
19840       if (__pyx_t_2) {
19841 
19842         /* "View.MemoryView":897
19843  *         if not is_slice:
19844  *             if new_ndim == 0:
19845  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
19846  *             else:
19847  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
19848  */
19849         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
19850 
19851         /* "View.MemoryView":896
19852  *     if suboffset >= 0:
19853  *         if not is_slice:
19854  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
19855  *                 dst.data = (<char **> dst.data)[0] + suboffset
19856  *             else:
19857  */
19858         goto __pyx_L26;
19859       }
19860 
19861       /* "View.MemoryView":899
19862  *                 dst.data = (<char **> dst.data)[0] + suboffset
19863  *             else:
19864  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
19865  *                                      "must be indexed and not sliced", dim)
19866  *         else:
19867  */
19868       /*else*/ {
19869 
19870         /* "View.MemoryView":900
19871  *             else:
19872  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
19873  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
19874  *         else:
19875  *             suboffset_dim[0] = new_ndim
19876  */
19877         __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
19878       }
19879       __pyx_L26:;
19880 
19881       /* "View.MemoryView":895
19882  *
19883  *     if suboffset >= 0:
19884  *         if not is_slice:             # <<<<<<<<<<<<<<
19885  *             if new_ndim == 0:
19886  *                 dst.data = (<char **> dst.data)[0] + suboffset
19887  */
19888       goto __pyx_L25;
19889     }
19890 
19891     /* "View.MemoryView":902
19892  *                                      "must be indexed and not sliced", dim)
19893  *         else:
19894  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
19895  *
19896  *     return 0
19897  */
19898     /*else*/ {
19899       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
19900     }
19901     __pyx_L25:;
19902 
19903     /* "View.MemoryView":894
19904  *         dst.suboffsets[suboffset_dim[0]] += start * stride
19905  *
19906  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
19907  *         if not is_slice:
19908  *             if new_ndim == 0:
19909  */
19910   }
19911 
19912   /* "View.MemoryView":904
19913  *             suboffset_dim[0] = new_ndim
19914  *
19915  *     return 0             # <<<<<<<<<<<<<<
19916  *
19917  *
19918  */
19919   __pyx_r = 0;
19920   goto __pyx_L0;
19921 
19922   /* "View.MemoryView":807
19923  *
19924  * @cname('__pyx_memoryview_slice_memviewslice')
19925  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
19926  *         __Pyx_memviewslice *dst,
19927  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
19928  */
19929 
19930   /* function exit code */
19931   __pyx_L1_error:;
19932   {
19933     #ifdef WITH_THREAD
19934     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19935     #endif
19936     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19937     #ifdef WITH_THREAD
19938     __Pyx_PyGILState_Release(__pyx_gilstate_save);
19939     #endif
19940   }
19941   __pyx_r = -1;
19942   __pyx_L0:;
19943   return __pyx_r;
19944 }
19945 
19946 /* "View.MemoryView":910
19947  *
19948  * @cname('__pyx_pybuffer_index')
19949  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
19950  *                           Py_ssize_t dim) except NULL:
19951  *     cdef Py_ssize_t shape, stride, suboffset = -1
19952  */
19953 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)19954 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
19955   Py_ssize_t __pyx_v_shape;
19956   Py_ssize_t __pyx_v_stride;
19957   Py_ssize_t __pyx_v_suboffset;
19958   Py_ssize_t __pyx_v_itemsize;
19959   char *__pyx_v_resultp;
19960   char *__pyx_r;
19961   __Pyx_RefNannyDeclarations
19962   Py_ssize_t __pyx_t_1;
19963   int __pyx_t_2;
19964   PyObject *__pyx_t_3 = NULL;
19965   PyObject *__pyx_t_4 = NULL;
19966   int __pyx_lineno = 0;
19967   const char *__pyx_filename = NULL;
19968   int __pyx_clineno = 0;
19969   __Pyx_RefNannySetupContext("pybuffer_index", 0);
19970 
19971   /* "View.MemoryView":912
19972  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
19973  *                           Py_ssize_t dim) except NULL:
19974  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
19975  *     cdef Py_ssize_t itemsize = view.itemsize
19976  *     cdef char *resultp
19977  */
19978   __pyx_v_suboffset = -1L;
19979 
19980   /* "View.MemoryView":913
19981  *                           Py_ssize_t dim) except NULL:
19982  *     cdef Py_ssize_t shape, stride, suboffset = -1
19983  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
19984  *     cdef char *resultp
19985  *
19986  */
19987   __pyx_t_1 = __pyx_v_view->itemsize;
19988   __pyx_v_itemsize = __pyx_t_1;
19989 
19990   /* "View.MemoryView":916
19991  *     cdef char *resultp
19992  *
19993  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
19994  *         shape = view.len / itemsize
19995  *         stride = itemsize
19996  */
19997   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
19998   if (__pyx_t_2) {
19999 
20000     /* "View.MemoryView":917
20001  *
20002  *     if view.ndim == 0:
20003  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
20004  *         stride = itemsize
20005  *     else:
20006  */
20007     if (unlikely(__pyx_v_itemsize == 0)) {
20008       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
20009       __PYX_ERR(1, 917, __pyx_L1_error)
20010     }
20011     else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
20012       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
20013       __PYX_ERR(1, 917, __pyx_L1_error)
20014     }
20015     __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
20016 
20017     /* "View.MemoryView":918
20018  *     if view.ndim == 0:
20019  *         shape = view.len / itemsize
20020  *         stride = itemsize             # <<<<<<<<<<<<<<
20021  *     else:
20022  *         shape = view.shape[dim]
20023  */
20024     __pyx_v_stride = __pyx_v_itemsize;
20025 
20026     /* "View.MemoryView":916
20027  *     cdef char *resultp
20028  *
20029  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
20030  *         shape = view.len / itemsize
20031  *         stride = itemsize
20032  */
20033     goto __pyx_L3;
20034   }
20035 
20036   /* "View.MemoryView":920
20037  *         stride = itemsize
20038  *     else:
20039  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
20040  *         stride = view.strides[dim]
20041  *         if view.suboffsets != NULL:
20042  */
20043   /*else*/ {
20044     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
20045 
20046     /* "View.MemoryView":921
20047  *     else:
20048  *         shape = view.shape[dim]
20049  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
20050  *         if view.suboffsets != NULL:
20051  *             suboffset = view.suboffsets[dim]
20052  */
20053     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
20054 
20055     /* "View.MemoryView":922
20056  *         shape = view.shape[dim]
20057  *         stride = view.strides[dim]
20058  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
20059  *             suboffset = view.suboffsets[dim]
20060  *
20061  */
20062     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
20063     if (__pyx_t_2) {
20064 
20065       /* "View.MemoryView":923
20066  *         stride = view.strides[dim]
20067  *         if view.suboffsets != NULL:
20068  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
20069  *
20070  *     if index < 0:
20071  */
20072       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
20073 
20074       /* "View.MemoryView":922
20075  *         shape = view.shape[dim]
20076  *         stride = view.strides[dim]
20077  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
20078  *             suboffset = view.suboffsets[dim]
20079  *
20080  */
20081     }
20082   }
20083   __pyx_L3:;
20084 
20085   /* "View.MemoryView":925
20086  *             suboffset = view.suboffsets[dim]
20087  *
20088  *     if index < 0:             # <<<<<<<<<<<<<<
20089  *         index += view.shape[dim]
20090  *         if index < 0:
20091  */
20092   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20093   if (__pyx_t_2) {
20094 
20095     /* "View.MemoryView":926
20096  *
20097  *     if index < 0:
20098  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
20099  *         if index < 0:
20100  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20101  */
20102     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
20103 
20104     /* "View.MemoryView":927
20105  *     if index < 0:
20106  *         index += view.shape[dim]
20107  *         if index < 0:             # <<<<<<<<<<<<<<
20108  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20109  *
20110  */
20111     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
20112     if (unlikely(__pyx_t_2)) {
20113 
20114       /* "View.MemoryView":928
20115  *         index += view.shape[dim]
20116  *         if index < 0:
20117  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
20118  *
20119  *     if index >= shape:
20120  */
20121       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
20122       __Pyx_GOTREF(__pyx_t_3);
20123       __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
20124       __Pyx_GOTREF(__pyx_t_4);
20125       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20126       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
20127       __Pyx_GOTREF(__pyx_t_3);
20128       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20129       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20130       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20131       __PYX_ERR(1, 928, __pyx_L1_error)
20132 
20133       /* "View.MemoryView":927
20134  *     if index < 0:
20135  *         index += view.shape[dim]
20136  *         if index < 0:             # <<<<<<<<<<<<<<
20137  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20138  *
20139  */
20140     }
20141 
20142     /* "View.MemoryView":925
20143  *             suboffset = view.suboffsets[dim]
20144  *
20145  *     if index < 0:             # <<<<<<<<<<<<<<
20146  *         index += view.shape[dim]
20147  *         if index < 0:
20148  */
20149   }
20150 
20151   /* "View.MemoryView":930
20152  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20153  *
20154  *     if index >= shape:             # <<<<<<<<<<<<<<
20155  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20156  *
20157  */
20158   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
20159   if (unlikely(__pyx_t_2)) {
20160 
20161     /* "View.MemoryView":931
20162  *
20163  *     if index >= shape:
20164  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
20165  *
20166  *     resultp = bufp + index * stride
20167  */
20168     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
20169     __Pyx_GOTREF(__pyx_t_3);
20170     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
20171     __Pyx_GOTREF(__pyx_t_4);
20172     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20173     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
20174     __Pyx_GOTREF(__pyx_t_3);
20175     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20176     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20177     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20178     __PYX_ERR(1, 931, __pyx_L1_error)
20179 
20180     /* "View.MemoryView":930
20181  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20182  *
20183  *     if index >= shape:             # <<<<<<<<<<<<<<
20184  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20185  *
20186  */
20187   }
20188 
20189   /* "View.MemoryView":933
20190  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
20191  *
20192  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
20193  *     if suboffset >= 0:
20194  *         resultp = (<char **> resultp)[0] + suboffset
20195  */
20196   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
20197 
20198   /* "View.MemoryView":934
20199  *
20200  *     resultp = bufp + index * stride
20201  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
20202  *         resultp = (<char **> resultp)[0] + suboffset
20203  *
20204  */
20205   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
20206   if (__pyx_t_2) {
20207 
20208     /* "View.MemoryView":935
20209  *     resultp = bufp + index * stride
20210  *     if suboffset >= 0:
20211  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
20212  *
20213  *     return resultp
20214  */
20215     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
20216 
20217     /* "View.MemoryView":934
20218  *
20219  *     resultp = bufp + index * stride
20220  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
20221  *         resultp = (<char **> resultp)[0] + suboffset
20222  *
20223  */
20224   }
20225 
20226   /* "View.MemoryView":937
20227  *         resultp = (<char **> resultp)[0] + suboffset
20228  *
20229  *     return resultp             # <<<<<<<<<<<<<<
20230  *
20231  *
20232  */
20233   __pyx_r = __pyx_v_resultp;
20234   goto __pyx_L0;
20235 
20236   /* "View.MemoryView":910
20237  *
20238  * @cname('__pyx_pybuffer_index')
20239  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
20240  *                           Py_ssize_t dim) except NULL:
20241  *     cdef Py_ssize_t shape, stride, suboffset = -1
20242  */
20243 
20244   /* function exit code */
20245   __pyx_L1_error:;
20246   __Pyx_XDECREF(__pyx_t_3);
20247   __Pyx_XDECREF(__pyx_t_4);
20248   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
20249   __pyx_r = NULL;
20250   __pyx_L0:;
20251   __Pyx_RefNannyFinishContext();
20252   return __pyx_r;
20253 }
20254 
20255 /* "View.MemoryView":943
20256  *
20257  * @cname('__pyx_memslice_transpose')
20258  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
20259  *     cdef int ndim = memslice.memview.view.ndim
20260  *
20261  */
20262 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)20263 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
20264   int __pyx_v_ndim;
20265   Py_ssize_t *__pyx_v_shape;
20266   Py_ssize_t *__pyx_v_strides;
20267   int __pyx_v_i;
20268   int __pyx_v_j;
20269   int __pyx_r;
20270   int __pyx_t_1;
20271   Py_ssize_t *__pyx_t_2;
20272   long __pyx_t_3;
20273   long __pyx_t_4;
20274   Py_ssize_t __pyx_t_5;
20275   Py_ssize_t __pyx_t_6;
20276   int __pyx_t_7;
20277   int __pyx_t_8;
20278   int __pyx_t_9;
20279   int __pyx_lineno = 0;
20280   const char *__pyx_filename = NULL;
20281   int __pyx_clineno = 0;
20282 
20283   /* "View.MemoryView":944
20284  * @cname('__pyx_memslice_transpose')
20285  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
20286  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
20287  *
20288  *     cdef Py_ssize_t *shape = memslice.shape
20289  */
20290   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
20291   __pyx_v_ndim = __pyx_t_1;
20292 
20293   /* "View.MemoryView":946
20294  *     cdef int ndim = memslice.memview.view.ndim
20295  *
20296  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
20297  *     cdef Py_ssize_t *strides = memslice.strides
20298  *
20299  */
20300   __pyx_t_2 = __pyx_v_memslice->shape;
20301   __pyx_v_shape = __pyx_t_2;
20302 
20303   /* "View.MemoryView":947
20304  *
20305  *     cdef Py_ssize_t *shape = memslice.shape
20306  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
20307  *
20308  *
20309  */
20310   __pyx_t_2 = __pyx_v_memslice->strides;
20311   __pyx_v_strides = __pyx_t_2;
20312 
20313   /* "View.MemoryView":951
20314  *
20315  *     cdef int i, j
20316  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
20317  *         j = ndim - 1 - i
20318  *         strides[i], strides[j] = strides[j], strides[i]
20319  */
20320   __pyx_t_3 = (__pyx_v_ndim / 2);
20321   __pyx_t_4 = __pyx_t_3;
20322   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
20323     __pyx_v_i = __pyx_t_1;
20324 
20325     /* "View.MemoryView":952
20326  *     cdef int i, j
20327  *     for i in range(ndim / 2):
20328  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
20329  *         strides[i], strides[j] = strides[j], strides[i]
20330  *         shape[i], shape[j] = shape[j], shape[i]
20331  */
20332     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
20333 
20334     /* "View.MemoryView":953
20335  *     for i in range(ndim / 2):
20336  *         j = ndim - 1 - i
20337  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
20338  *         shape[i], shape[j] = shape[j], shape[i]
20339  *
20340  */
20341     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
20342     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
20343     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
20344     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
20345 
20346     /* "View.MemoryView":954
20347  *         j = ndim - 1 - i
20348  *         strides[i], strides[j] = strides[j], strides[i]
20349  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
20350  *
20351  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
20352  */
20353     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
20354     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
20355     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
20356     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
20357 
20358     /* "View.MemoryView":956
20359  *         shape[i], shape[j] = shape[j], shape[i]
20360  *
20361  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
20362  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
20363  *
20364  */
20365     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
20366     if (!__pyx_t_8) {
20367     } else {
20368       __pyx_t_7 = __pyx_t_8;
20369       goto __pyx_L6_bool_binop_done;
20370     }
20371     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
20372     __pyx_t_7 = __pyx_t_8;
20373     __pyx_L6_bool_binop_done:;
20374     if (__pyx_t_7) {
20375 
20376       /* "View.MemoryView":957
20377  *
20378  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
20379  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
20380  *
20381  *     return 1
20382  */
20383       __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
20384 
20385       /* "View.MemoryView":956
20386  *         shape[i], shape[j] = shape[j], shape[i]
20387  *
20388  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
20389  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
20390  *
20391  */
20392     }
20393   }
20394 
20395   /* "View.MemoryView":959
20396  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
20397  *
20398  *     return 1             # <<<<<<<<<<<<<<
20399  *
20400  *
20401  */
20402   __pyx_r = 1;
20403   goto __pyx_L0;
20404 
20405   /* "View.MemoryView":943
20406  *
20407  * @cname('__pyx_memslice_transpose')
20408  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
20409  *     cdef int ndim = memslice.memview.view.ndim
20410  *
20411  */
20412 
20413   /* function exit code */
20414   __pyx_L1_error:;
20415   {
20416     #ifdef WITH_THREAD
20417     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20418     #endif
20419     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20420     #ifdef WITH_THREAD
20421     __Pyx_PyGILState_Release(__pyx_gilstate_save);
20422     #endif
20423   }
20424   __pyx_r = 0;
20425   __pyx_L0:;
20426   return __pyx_r;
20427 }
20428 
20429 /* "View.MemoryView":976
20430  *     cdef int (*to_dtype_func)(char *, object) except 0
20431  *
20432  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
20433  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
20434  *
20435  */
20436 
20437 /* Python wrapper */
20438 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)20439 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
20440   __Pyx_RefNannyDeclarations
20441   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
20442   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
20443 
20444   /* function exit code */
20445   __Pyx_RefNannyFinishContext();
20446 }
20447 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)20448 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
20449   __Pyx_RefNannyDeclarations
20450   __Pyx_RefNannySetupContext("__dealloc__", 0);
20451 
20452   /* "View.MemoryView":977
20453  *
20454  *     def __dealloc__(self):
20455  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
20456  *
20457  *     cdef convert_item_to_object(self, char *itemp):
20458  */
20459   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
20460 
20461   /* "View.MemoryView":976
20462  *     cdef int (*to_dtype_func)(char *, object) except 0
20463  *
20464  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
20465  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
20466  *
20467  */
20468 
20469   /* function exit code */
20470   __Pyx_RefNannyFinishContext();
20471 }
20472 
20473 /* "View.MemoryView":979
20474  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
20475  *
20476  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
20477  *         if self.to_object_func != NULL:
20478  *             return self.to_object_func(itemp)
20479  */
20480 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)20481 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
20482   PyObject *__pyx_r = NULL;
20483   __Pyx_RefNannyDeclarations
20484   int __pyx_t_1;
20485   PyObject *__pyx_t_2 = NULL;
20486   int __pyx_lineno = 0;
20487   const char *__pyx_filename = NULL;
20488   int __pyx_clineno = 0;
20489   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
20490 
20491   /* "View.MemoryView":980
20492  *
20493  *     cdef convert_item_to_object(self, char *itemp):
20494  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
20495  *             return self.to_object_func(itemp)
20496  *         else:
20497  */
20498   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
20499   if (__pyx_t_1) {
20500 
20501     /* "View.MemoryView":981
20502  *     cdef convert_item_to_object(self, char *itemp):
20503  *         if self.to_object_func != NULL:
20504  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
20505  *         else:
20506  *             return memoryview.convert_item_to_object(self, itemp)
20507  */
20508     __Pyx_XDECREF(__pyx_r);
20509     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
20510     __Pyx_GOTREF(__pyx_t_2);
20511     __pyx_r = __pyx_t_2;
20512     __pyx_t_2 = 0;
20513     goto __pyx_L0;
20514 
20515     /* "View.MemoryView":980
20516  *
20517  *     cdef convert_item_to_object(self, char *itemp):
20518  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
20519  *             return self.to_object_func(itemp)
20520  *         else:
20521  */
20522   }
20523 
20524   /* "View.MemoryView":983
20525  *             return self.to_object_func(itemp)
20526  *         else:
20527  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
20528  *
20529  *     cdef assign_item_from_object(self, char *itemp, object value):
20530  */
20531   /*else*/ {
20532     __Pyx_XDECREF(__pyx_r);
20533     __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
20534     __Pyx_GOTREF(__pyx_t_2);
20535     __pyx_r = __pyx_t_2;
20536     __pyx_t_2 = 0;
20537     goto __pyx_L0;
20538   }
20539 
20540   /* "View.MemoryView":979
20541  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
20542  *
20543  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
20544  *         if self.to_object_func != NULL:
20545  *             return self.to_object_func(itemp)
20546  */
20547 
20548   /* function exit code */
20549   __pyx_L1_error:;
20550   __Pyx_XDECREF(__pyx_t_2);
20551   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
20552   __pyx_r = 0;
20553   __pyx_L0:;
20554   __Pyx_XGIVEREF(__pyx_r);
20555   __Pyx_RefNannyFinishContext();
20556   return __pyx_r;
20557 }
20558 
20559 /* "View.MemoryView":985
20560  *             return memoryview.convert_item_to_object(self, itemp)
20561  *
20562  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
20563  *         if self.to_dtype_func != NULL:
20564  *             self.to_dtype_func(itemp, value)
20565  */
20566 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)20567 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
20568   PyObject *__pyx_r = NULL;
20569   __Pyx_RefNannyDeclarations
20570   int __pyx_t_1;
20571   int __pyx_t_2;
20572   PyObject *__pyx_t_3 = NULL;
20573   int __pyx_lineno = 0;
20574   const char *__pyx_filename = NULL;
20575   int __pyx_clineno = 0;
20576   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
20577 
20578   /* "View.MemoryView":986
20579  *
20580  *     cdef assign_item_from_object(self, char *itemp, object value):
20581  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
20582  *             self.to_dtype_func(itemp, value)
20583  *         else:
20584  */
20585   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
20586   if (__pyx_t_1) {
20587 
20588     /* "View.MemoryView":987
20589  *     cdef assign_item_from_object(self, char *itemp, object value):
20590  *         if self.to_dtype_func != NULL:
20591  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
20592  *         else:
20593  *             memoryview.assign_item_from_object(self, itemp, value)
20594  */
20595     __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
20596 
20597     /* "View.MemoryView":986
20598  *
20599  *     cdef assign_item_from_object(self, char *itemp, object value):
20600  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
20601  *             self.to_dtype_func(itemp, value)
20602  *         else:
20603  */
20604     goto __pyx_L3;
20605   }
20606 
20607   /* "View.MemoryView":989
20608  *             self.to_dtype_func(itemp, value)
20609  *         else:
20610  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
20611  *
20612  *     @property
20613  */
20614   /*else*/ {
20615     __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
20616     __Pyx_GOTREF(__pyx_t_3);
20617     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20618   }
20619   __pyx_L3:;
20620 
20621   /* "View.MemoryView":985
20622  *             return memoryview.convert_item_to_object(self, itemp)
20623  *
20624  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
20625  *         if self.to_dtype_func != NULL:
20626  *             self.to_dtype_func(itemp, value)
20627  */
20628 
20629   /* function exit code */
20630   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20631   goto __pyx_L0;
20632   __pyx_L1_error:;
20633   __Pyx_XDECREF(__pyx_t_3);
20634   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
20635   __pyx_r = 0;
20636   __pyx_L0:;
20637   __Pyx_XGIVEREF(__pyx_r);
20638   __Pyx_RefNannyFinishContext();
20639   return __pyx_r;
20640 }
20641 
20642 /* "View.MemoryView":992
20643  *
20644  *     @property
20645  *     def base(self):             # <<<<<<<<<<<<<<
20646  *         return self.from_object
20647  *
20648  */
20649 
20650 /* Python wrapper */
20651 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject * __pyx_v_self)20652 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
20653   PyObject *__pyx_r = 0;
20654   __Pyx_RefNannyDeclarations
20655   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
20656   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
20657 
20658   /* function exit code */
20659   __Pyx_RefNannyFinishContext();
20660   return __pyx_r;
20661 }
20662 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)20663 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
20664   PyObject *__pyx_r = NULL;
20665   __Pyx_RefNannyDeclarations
20666   __Pyx_RefNannySetupContext("__get__", 0);
20667 
20668   /* "View.MemoryView":993
20669  *     @property
20670  *     def base(self):
20671  *         return self.from_object             # <<<<<<<<<<<<<<
20672  *
20673  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
20674  */
20675   __Pyx_XDECREF(__pyx_r);
20676   __Pyx_INCREF(__pyx_v_self->from_object);
20677   __pyx_r = __pyx_v_self->from_object;
20678   goto __pyx_L0;
20679 
20680   /* "View.MemoryView":992
20681  *
20682  *     @property
20683  *     def base(self):             # <<<<<<<<<<<<<<
20684  *         return self.from_object
20685  *
20686  */
20687 
20688   /* function exit code */
20689   __pyx_L0:;
20690   __Pyx_XGIVEREF(__pyx_r);
20691   __Pyx_RefNannyFinishContext();
20692   return __pyx_r;
20693 }
20694 
20695 /* "(tree fragment)":1
20696  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
20697  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20698  * def __setstate_cython__(self, __pyx_state):
20699  */
20700 
20701 /* Python wrapper */
20702 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)20703 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
20704   PyObject *__pyx_r = 0;
20705   __Pyx_RefNannyDeclarations
20706   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
20707   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
20708 
20709   /* function exit code */
20710   __Pyx_RefNannyFinishContext();
20711   return __pyx_r;
20712 }
20713 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)20714 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
20715   PyObject *__pyx_r = NULL;
20716   __Pyx_RefNannyDeclarations
20717   PyObject *__pyx_t_1 = NULL;
20718   int __pyx_lineno = 0;
20719   const char *__pyx_filename = NULL;
20720   int __pyx_clineno = 0;
20721   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
20722 
20723   /* "(tree fragment)":2
20724  * def __reduce_cython__(self):
20725  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20726  * def __setstate_cython__(self, __pyx_state):
20727  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20728  */
20729   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
20730   __Pyx_GOTREF(__pyx_t_1);
20731   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20732   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20733   __PYX_ERR(1, 2, __pyx_L1_error)
20734 
20735   /* "(tree fragment)":1
20736  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
20737  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20738  * def __setstate_cython__(self, __pyx_state):
20739  */
20740 
20741   /* function exit code */
20742   __pyx_L1_error:;
20743   __Pyx_XDECREF(__pyx_t_1);
20744   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20745   __pyx_r = NULL;
20746   __Pyx_XGIVEREF(__pyx_r);
20747   __Pyx_RefNannyFinishContext();
20748   return __pyx_r;
20749 }
20750 
20751 /* "(tree fragment)":3
20752  * def __reduce_cython__(self):
20753  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20754  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
20755  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20756  */
20757 
20758 /* Python wrapper */
20759 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)20760 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
20761   PyObject *__pyx_r = 0;
20762   __Pyx_RefNannyDeclarations
20763   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
20764   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
20765 
20766   /* function exit code */
20767   __Pyx_RefNannyFinishContext();
20768   return __pyx_r;
20769 }
20770 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)20771 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
20772   PyObject *__pyx_r = NULL;
20773   __Pyx_RefNannyDeclarations
20774   PyObject *__pyx_t_1 = NULL;
20775   int __pyx_lineno = 0;
20776   const char *__pyx_filename = NULL;
20777   int __pyx_clineno = 0;
20778   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
20779 
20780   /* "(tree fragment)":4
20781  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20782  * def __setstate_cython__(self, __pyx_state):
20783  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20784  */
20785   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20786   __Pyx_GOTREF(__pyx_t_1);
20787   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20788   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20789   __PYX_ERR(1, 4, __pyx_L1_error)
20790 
20791   /* "(tree fragment)":3
20792  * def __reduce_cython__(self):
20793  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20794  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
20795  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20796  */
20797 
20798   /* function exit code */
20799   __pyx_L1_error:;
20800   __Pyx_XDECREF(__pyx_t_1);
20801   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20802   __pyx_r = NULL;
20803   __Pyx_XGIVEREF(__pyx_r);
20804   __Pyx_RefNannyFinishContext();
20805   return __pyx_r;
20806 }
20807 
20808 /* "View.MemoryView":999
20809  *
20810  * @cname('__pyx_memoryview_fromslice')
20811  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
20812  *                           int ndim,
20813  *                           object (*to_object_func)(char *),
20814  */
20815 
__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,int __pyx_v_ndim,PyObject * (* __pyx_v_to_object_func)(char *),int (* __pyx_v_to_dtype_func)(char *,PyObject *),int __pyx_v_dtype_is_object)20816 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
20817   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
20818   Py_ssize_t __pyx_v_suboffset;
20819   PyObject *__pyx_v_length = NULL;
20820   PyObject *__pyx_r = NULL;
20821   __Pyx_RefNannyDeclarations
20822   int __pyx_t_1;
20823   PyObject *__pyx_t_2 = NULL;
20824   PyObject *__pyx_t_3 = NULL;
20825   __Pyx_TypeInfo *__pyx_t_4;
20826   Py_buffer __pyx_t_5;
20827   Py_ssize_t *__pyx_t_6;
20828   Py_ssize_t *__pyx_t_7;
20829   Py_ssize_t *__pyx_t_8;
20830   Py_ssize_t __pyx_t_9;
20831   int __pyx_lineno = 0;
20832   const char *__pyx_filename = NULL;
20833   int __pyx_clineno = 0;
20834   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
20835 
20836   /* "View.MemoryView":1007
20837  *     cdef _memoryviewslice result
20838  *
20839  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
20840  *         return None
20841  *
20842  */
20843   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
20844   if (__pyx_t_1) {
20845 
20846     /* "View.MemoryView":1008
20847  *
20848  *     if <PyObject *> memviewslice.memview == Py_None:
20849  *         return None             # <<<<<<<<<<<<<<
20850  *
20851  *
20852  */
20853     __Pyx_XDECREF(__pyx_r);
20854     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20855     goto __pyx_L0;
20856 
20857     /* "View.MemoryView":1007
20858  *     cdef _memoryviewslice result
20859  *
20860  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
20861  *         return None
20862  *
20863  */
20864   }
20865 
20866   /* "View.MemoryView":1013
20867  *
20868  *
20869  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
20870  *
20871  *     result.from_slice = memviewslice
20872  */
20873   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
20874   __Pyx_GOTREF(__pyx_t_2);
20875   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
20876   __Pyx_GOTREF(__pyx_t_3);
20877   __Pyx_INCREF(Py_None);
20878   __Pyx_GIVEREF(Py_None);
20879   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
20880   __Pyx_INCREF(__pyx_int_0);
20881   __Pyx_GIVEREF(__pyx_int_0);
20882   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
20883   __Pyx_GIVEREF(__pyx_t_2);
20884   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
20885   __pyx_t_2 = 0;
20886   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
20887   __Pyx_GOTREF(__pyx_t_2);
20888   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20889   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
20890   __pyx_t_2 = 0;
20891 
20892   /* "View.MemoryView":1015
20893  *     result = _memoryviewslice(None, 0, dtype_is_object)
20894  *
20895  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
20896  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
20897  *
20898  */
20899   __pyx_v_result->from_slice = __pyx_v_memviewslice;
20900 
20901   /* "View.MemoryView":1016
20902  *
20903  *     result.from_slice = memviewslice
20904  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
20905  *
20906  *     result.from_object = (<memoryview> memviewslice.memview).base
20907  */
20908   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
20909 
20910   /* "View.MemoryView":1018
20911  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
20912  *
20913  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
20914  *     result.typeinfo = memviewslice.memview.typeinfo
20915  *
20916  */
20917   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
20918   __Pyx_GOTREF(__pyx_t_2);
20919   __Pyx_GIVEREF(__pyx_t_2);
20920   __Pyx_GOTREF(__pyx_v_result->from_object);
20921   __Pyx_DECREF(__pyx_v_result->from_object);
20922   __pyx_v_result->from_object = __pyx_t_2;
20923   __pyx_t_2 = 0;
20924 
20925   /* "View.MemoryView":1019
20926  *
20927  *     result.from_object = (<memoryview> memviewslice.memview).base
20928  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
20929  *
20930  *     result.view = memviewslice.memview.view
20931  */
20932   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
20933   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
20934 
20935   /* "View.MemoryView":1021
20936  *     result.typeinfo = memviewslice.memview.typeinfo
20937  *
20938  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
20939  *     result.view.buf = <void *> memviewslice.data
20940  *     result.view.ndim = ndim
20941  */
20942   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
20943   __pyx_v_result->__pyx_base.view = __pyx_t_5;
20944 
20945   /* "View.MemoryView":1022
20946  *
20947  *     result.view = memviewslice.memview.view
20948  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
20949  *     result.view.ndim = ndim
20950  *     (<__pyx_buffer *> &result.view).obj = Py_None
20951  */
20952   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
20953 
20954   /* "View.MemoryView":1023
20955  *     result.view = memviewslice.memview.view
20956  *     result.view.buf = <void *> memviewslice.data
20957  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
20958  *     (<__pyx_buffer *> &result.view).obj = Py_None
20959  *     Py_INCREF(Py_None)
20960  */
20961   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
20962 
20963   /* "View.MemoryView":1024
20964  *     result.view.buf = <void *> memviewslice.data
20965  *     result.view.ndim = ndim
20966  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
20967  *     Py_INCREF(Py_None)
20968  *
20969  */
20970   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
20971 
20972   /* "View.MemoryView":1025
20973  *     result.view.ndim = ndim
20974  *     (<__pyx_buffer *> &result.view).obj = Py_None
20975  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
20976  *
20977  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
20978  */
20979   Py_INCREF(Py_None);
20980 
20981   /* "View.MemoryView":1027
20982  *     Py_INCREF(Py_None)
20983  *
20984  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
20985  *         result.flags = PyBUF_RECORDS
20986  *     else:
20987  */
20988   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
20989   if (__pyx_t_1) {
20990 
20991     /* "View.MemoryView":1028
20992  *
20993  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
20994  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
20995  *     else:
20996  *         result.flags = PyBUF_RECORDS_RO
20997  */
20998     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
20999 
21000     /* "View.MemoryView":1027
21001  *     Py_INCREF(Py_None)
21002  *
21003  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
21004  *         result.flags = PyBUF_RECORDS
21005  *     else:
21006  */
21007     goto __pyx_L4;
21008   }
21009 
21010   /* "View.MemoryView":1030
21011  *         result.flags = PyBUF_RECORDS
21012  *     else:
21013  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
21014  *
21015  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
21016  */
21017   /*else*/ {
21018     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
21019   }
21020   __pyx_L4:;
21021 
21022   /* "View.MemoryView":1032
21023  *         result.flags = PyBUF_RECORDS_RO
21024  *
21025  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
21026  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
21027  *
21028  */
21029   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
21030 
21031   /* "View.MemoryView":1033
21032  *
21033  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
21034  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
21035  *
21036  *
21037  */
21038   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
21039 
21040   /* "View.MemoryView":1036
21041  *
21042  *
21043  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
21044  *     for suboffset in result.from_slice.suboffsets[:ndim]:
21045  *         if suboffset >= 0:
21046  */
21047   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
21048 
21049   /* "View.MemoryView":1037
21050  *
21051  *     result.view.suboffsets = NULL
21052  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
21053  *         if suboffset >= 0:
21054  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21055  */
21056   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
21057   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
21058     __pyx_t_6 = __pyx_t_8;
21059     __pyx_v_suboffset = (__pyx_t_6[0]);
21060 
21061     /* "View.MemoryView":1038
21062  *     result.view.suboffsets = NULL
21063  *     for suboffset in result.from_slice.suboffsets[:ndim]:
21064  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
21065  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21066  *             break
21067  */
21068     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
21069     if (__pyx_t_1) {
21070 
21071       /* "View.MemoryView":1039
21072  *     for suboffset in result.from_slice.suboffsets[:ndim]:
21073  *         if suboffset >= 0:
21074  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
21075  *             break
21076  *
21077  */
21078       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
21079 
21080       /* "View.MemoryView":1040
21081  *         if suboffset >= 0:
21082  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21083  *             break             # <<<<<<<<<<<<<<
21084  *
21085  *     result.view.len = result.view.itemsize
21086  */
21087       goto __pyx_L6_break;
21088 
21089       /* "View.MemoryView":1038
21090  *     result.view.suboffsets = NULL
21091  *     for suboffset in result.from_slice.suboffsets[:ndim]:
21092  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
21093  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
21094  *             break
21095  */
21096     }
21097   }
21098   __pyx_L6_break:;
21099 
21100   /* "View.MemoryView":1042
21101  *             break
21102  *
21103  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
21104  *     for length in result.view.shape[:ndim]:
21105  *         result.view.len *= length
21106  */
21107   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
21108   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
21109 
21110   /* "View.MemoryView":1043
21111  *
21112  *     result.view.len = result.view.itemsize
21113  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
21114  *         result.view.len *= length
21115  *
21116  */
21117   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
21118   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
21119     __pyx_t_6 = __pyx_t_8;
21120     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
21121     __Pyx_GOTREF(__pyx_t_2);
21122     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
21123     __pyx_t_2 = 0;
21124 
21125     /* "View.MemoryView":1044
21126  *     result.view.len = result.view.itemsize
21127  *     for length in result.view.shape[:ndim]:
21128  *         result.view.len *= length             # <<<<<<<<<<<<<<
21129  *
21130  *     result.to_object_func = to_object_func
21131  */
21132     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
21133     __Pyx_GOTREF(__pyx_t_2);
21134     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
21135     __Pyx_GOTREF(__pyx_t_3);
21136     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21137     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
21138     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21139     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
21140   }
21141 
21142   /* "View.MemoryView":1046
21143  *         result.view.len *= length
21144  *
21145  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
21146  *     result.to_dtype_func = to_dtype_func
21147  *
21148  */
21149   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
21150 
21151   /* "View.MemoryView":1047
21152  *
21153  *     result.to_object_func = to_object_func
21154  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
21155  *
21156  *     return result
21157  */
21158   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
21159 
21160   /* "View.MemoryView":1049
21161  *     result.to_dtype_func = to_dtype_func
21162  *
21163  *     return result             # <<<<<<<<<<<<<<
21164  *
21165  * @cname('__pyx_memoryview_get_slice_from_memoryview')
21166  */
21167   __Pyx_XDECREF(__pyx_r);
21168   __Pyx_INCREF(((PyObject *)__pyx_v_result));
21169   __pyx_r = ((PyObject *)__pyx_v_result);
21170   goto __pyx_L0;
21171 
21172   /* "View.MemoryView":999
21173  *
21174  * @cname('__pyx_memoryview_fromslice')
21175  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
21176  *                           int ndim,
21177  *                           object (*to_object_func)(char *),
21178  */
21179 
21180   /* function exit code */
21181   __pyx_L1_error:;
21182   __Pyx_XDECREF(__pyx_t_2);
21183   __Pyx_XDECREF(__pyx_t_3);
21184   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21185   __pyx_r = 0;
21186   __pyx_L0:;
21187   __Pyx_XDECREF((PyObject *)__pyx_v_result);
21188   __Pyx_XDECREF(__pyx_v_length);
21189   __Pyx_XGIVEREF(__pyx_r);
21190   __Pyx_RefNannyFinishContext();
21191   return __pyx_r;
21192 }
21193 
21194 /* "View.MemoryView":1052
21195  *
21196  * @cname('__pyx_memoryview_get_slice_from_memoryview')
21197  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
21198  *                                                    __Pyx_memviewslice *mslice) except NULL:
21199  *     cdef _memoryviewslice obj
21200  */
21201 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)21202 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
21203   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
21204   __Pyx_memviewslice *__pyx_r;
21205   __Pyx_RefNannyDeclarations
21206   int __pyx_t_1;
21207   int __pyx_t_2;
21208   PyObject *__pyx_t_3 = NULL;
21209   int __pyx_lineno = 0;
21210   const char *__pyx_filename = NULL;
21211   int __pyx_clineno = 0;
21212   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
21213 
21214   /* "View.MemoryView":1055
21215  *                                                    __Pyx_memviewslice *mslice) except NULL:
21216  *     cdef _memoryviewslice obj
21217  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
21218  *         obj = memview
21219  *         return &obj.from_slice
21220  */
21221   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
21222   __pyx_t_2 = (__pyx_t_1 != 0);
21223   if (__pyx_t_2) {
21224 
21225     /* "View.MemoryView":1056
21226  *     cdef _memoryviewslice obj
21227  *     if isinstance(memview, _memoryviewslice):
21228  *         obj = memview             # <<<<<<<<<<<<<<
21229  *         return &obj.from_slice
21230  *     else:
21231  */
21232     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
21233     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
21234     __Pyx_INCREF(__pyx_t_3);
21235     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
21236     __pyx_t_3 = 0;
21237 
21238     /* "View.MemoryView":1057
21239  *     if isinstance(memview, _memoryviewslice):
21240  *         obj = memview
21241  *         return &obj.from_slice             # <<<<<<<<<<<<<<
21242  *     else:
21243  *         slice_copy(memview, mslice)
21244  */
21245     __pyx_r = (&__pyx_v_obj->from_slice);
21246     goto __pyx_L0;
21247 
21248     /* "View.MemoryView":1055
21249  *                                                    __Pyx_memviewslice *mslice) except NULL:
21250  *     cdef _memoryviewslice obj
21251  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
21252  *         obj = memview
21253  *         return &obj.from_slice
21254  */
21255   }
21256 
21257   /* "View.MemoryView":1059
21258  *         return &obj.from_slice
21259  *     else:
21260  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
21261  *         return mslice
21262  *
21263  */
21264   /*else*/ {
21265     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
21266 
21267     /* "View.MemoryView":1060
21268  *     else:
21269  *         slice_copy(memview, mslice)
21270  *         return mslice             # <<<<<<<<<<<<<<
21271  *
21272  * @cname('__pyx_memoryview_slice_copy')
21273  */
21274     __pyx_r = __pyx_v_mslice;
21275     goto __pyx_L0;
21276   }
21277 
21278   /* "View.MemoryView":1052
21279  *
21280  * @cname('__pyx_memoryview_get_slice_from_memoryview')
21281  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
21282  *                                                    __Pyx_memviewslice *mslice) except NULL:
21283  *     cdef _memoryviewslice obj
21284  */
21285 
21286   /* function exit code */
21287   __pyx_L1_error:;
21288   __Pyx_XDECREF(__pyx_t_3);
21289   __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
21290   __pyx_r = NULL;
21291   __pyx_L0:;
21292   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
21293   __Pyx_RefNannyFinishContext();
21294   return __pyx_r;
21295 }
21296 
21297 /* "View.MemoryView":1063
21298  *
21299  * @cname('__pyx_memoryview_slice_copy')
21300  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
21301  *     cdef int dim
21302  *     cdef (Py_ssize_t*) shape, strides, suboffsets
21303  */
21304 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)21305 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
21306   int __pyx_v_dim;
21307   Py_ssize_t *__pyx_v_shape;
21308   Py_ssize_t *__pyx_v_strides;
21309   Py_ssize_t *__pyx_v_suboffsets;
21310   __Pyx_RefNannyDeclarations
21311   Py_ssize_t *__pyx_t_1;
21312   int __pyx_t_2;
21313   int __pyx_t_3;
21314   int __pyx_t_4;
21315   Py_ssize_t __pyx_t_5;
21316   __Pyx_RefNannySetupContext("slice_copy", 0);
21317 
21318   /* "View.MemoryView":1067
21319  *     cdef (Py_ssize_t*) shape, strides, suboffsets
21320  *
21321  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
21322  *     strides = memview.view.strides
21323  *     suboffsets = memview.view.suboffsets
21324  */
21325   __pyx_t_1 = __pyx_v_memview->view.shape;
21326   __pyx_v_shape = __pyx_t_1;
21327 
21328   /* "View.MemoryView":1068
21329  *
21330  *     shape = memview.view.shape
21331  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
21332  *     suboffsets = memview.view.suboffsets
21333  *
21334  */
21335   __pyx_t_1 = __pyx_v_memview->view.strides;
21336   __pyx_v_strides = __pyx_t_1;
21337 
21338   /* "View.MemoryView":1069
21339  *     shape = memview.view.shape
21340  *     strides = memview.view.strides
21341  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
21342  *
21343  *     dst.memview = <__pyx_memoryview *> memview
21344  */
21345   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
21346   __pyx_v_suboffsets = __pyx_t_1;
21347 
21348   /* "View.MemoryView":1071
21349  *     suboffsets = memview.view.suboffsets
21350  *
21351  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
21352  *     dst.data = <char *> memview.view.buf
21353  *
21354  */
21355   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
21356 
21357   /* "View.MemoryView":1072
21358  *
21359  *     dst.memview = <__pyx_memoryview *> memview
21360  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
21361  *
21362  *     for dim in range(memview.view.ndim):
21363  */
21364   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
21365 
21366   /* "View.MemoryView":1074
21367  *     dst.data = <char *> memview.view.buf
21368  *
21369  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
21370  *         dst.shape[dim] = shape[dim]
21371  *         dst.strides[dim] = strides[dim]
21372  */
21373   __pyx_t_2 = __pyx_v_memview->view.ndim;
21374   __pyx_t_3 = __pyx_t_2;
21375   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21376     __pyx_v_dim = __pyx_t_4;
21377 
21378     /* "View.MemoryView":1075
21379  *
21380  *     for dim in range(memview.view.ndim):
21381  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
21382  *         dst.strides[dim] = strides[dim]
21383  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
21384  */
21385     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
21386 
21387     /* "View.MemoryView":1076
21388  *     for dim in range(memview.view.ndim):
21389  *         dst.shape[dim] = shape[dim]
21390  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
21391  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
21392  *
21393  */
21394     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
21395 
21396     /* "View.MemoryView":1077
21397  *         dst.shape[dim] = shape[dim]
21398  *         dst.strides[dim] = strides[dim]
21399  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
21400  *
21401  * @cname('__pyx_memoryview_copy_object')
21402  */
21403     if ((__pyx_v_suboffsets != 0)) {
21404       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
21405     } else {
21406       __pyx_t_5 = -1L;
21407     }
21408     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
21409   }
21410 
21411   /* "View.MemoryView":1063
21412  *
21413  * @cname('__pyx_memoryview_slice_copy')
21414  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
21415  *     cdef int dim
21416  *     cdef (Py_ssize_t*) shape, strides, suboffsets
21417  */
21418 
21419   /* function exit code */
21420   __Pyx_RefNannyFinishContext();
21421 }
21422 
21423 /* "View.MemoryView":1080
21424  *
21425  * @cname('__pyx_memoryview_copy_object')
21426  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
21427  *     "Create a new memoryview object"
21428  *     cdef __Pyx_memviewslice memviewslice
21429  */
21430 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)21431 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
21432   __Pyx_memviewslice __pyx_v_memviewslice;
21433   PyObject *__pyx_r = NULL;
21434   __Pyx_RefNannyDeclarations
21435   PyObject *__pyx_t_1 = NULL;
21436   int __pyx_lineno = 0;
21437   const char *__pyx_filename = NULL;
21438   int __pyx_clineno = 0;
21439   __Pyx_RefNannySetupContext("memoryview_copy", 0);
21440 
21441   /* "View.MemoryView":1083
21442  *     "Create a new memoryview object"
21443  *     cdef __Pyx_memviewslice memviewslice
21444  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
21445  *     return memoryview_copy_from_slice(memview, &memviewslice)
21446  *
21447  */
21448   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
21449 
21450   /* "View.MemoryView":1084
21451  *     cdef __Pyx_memviewslice memviewslice
21452  *     slice_copy(memview, &memviewslice)
21453  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
21454  *
21455  * @cname('__pyx_memoryview_copy_object_from_slice')
21456  */
21457   __Pyx_XDECREF(__pyx_r);
21458   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
21459   __Pyx_GOTREF(__pyx_t_1);
21460   __pyx_r = __pyx_t_1;
21461   __pyx_t_1 = 0;
21462   goto __pyx_L0;
21463 
21464   /* "View.MemoryView":1080
21465  *
21466  * @cname('__pyx_memoryview_copy_object')
21467  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
21468  *     "Create a new memoryview object"
21469  *     cdef __Pyx_memviewslice memviewslice
21470  */
21471 
21472   /* function exit code */
21473   __pyx_L1_error:;
21474   __Pyx_XDECREF(__pyx_t_1);
21475   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
21476   __pyx_r = 0;
21477   __pyx_L0:;
21478   __Pyx_XGIVEREF(__pyx_r);
21479   __Pyx_RefNannyFinishContext();
21480   return __pyx_r;
21481 }
21482 
21483 /* "View.MemoryView":1087
21484  *
21485  * @cname('__pyx_memoryview_copy_object_from_slice')
21486  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
21487  *     """
21488  *     Create a new memoryview object from a given memoryview object and slice.
21489  */
21490 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)21491 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
21492   PyObject *(*__pyx_v_to_object_func)(char *);
21493   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
21494   PyObject *__pyx_r = NULL;
21495   __Pyx_RefNannyDeclarations
21496   int __pyx_t_1;
21497   int __pyx_t_2;
21498   PyObject *(*__pyx_t_3)(char *);
21499   int (*__pyx_t_4)(char *, PyObject *);
21500   PyObject *__pyx_t_5 = NULL;
21501   int __pyx_lineno = 0;
21502   const char *__pyx_filename = NULL;
21503   int __pyx_clineno = 0;
21504   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
21505 
21506   /* "View.MemoryView":1094
21507  *     cdef int (*to_dtype_func)(char *, object) except 0
21508  *
21509  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
21510  *         to_object_func = (<_memoryviewslice> memview).to_object_func
21511  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
21512  */
21513   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
21514   __pyx_t_2 = (__pyx_t_1 != 0);
21515   if (__pyx_t_2) {
21516 
21517     /* "View.MemoryView":1095
21518  *
21519  *     if isinstance(memview, _memoryviewslice):
21520  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
21521  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
21522  *     else:
21523  */
21524     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
21525     __pyx_v_to_object_func = __pyx_t_3;
21526 
21527     /* "View.MemoryView":1096
21528  *     if isinstance(memview, _memoryviewslice):
21529  *         to_object_func = (<_memoryviewslice> memview).to_object_func
21530  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
21531  *     else:
21532  *         to_object_func = NULL
21533  */
21534     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
21535     __pyx_v_to_dtype_func = __pyx_t_4;
21536 
21537     /* "View.MemoryView":1094
21538  *     cdef int (*to_dtype_func)(char *, object) except 0
21539  *
21540  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
21541  *         to_object_func = (<_memoryviewslice> memview).to_object_func
21542  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
21543  */
21544     goto __pyx_L3;
21545   }
21546 
21547   /* "View.MemoryView":1098
21548  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
21549  *     else:
21550  *         to_object_func = NULL             # <<<<<<<<<<<<<<
21551  *         to_dtype_func = NULL
21552  *
21553  */
21554   /*else*/ {
21555     __pyx_v_to_object_func = NULL;
21556 
21557     /* "View.MemoryView":1099
21558  *     else:
21559  *         to_object_func = NULL
21560  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
21561  *
21562  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
21563  */
21564     __pyx_v_to_dtype_func = NULL;
21565   }
21566   __pyx_L3:;
21567 
21568   /* "View.MemoryView":1101
21569  *         to_dtype_func = NULL
21570  *
21571  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
21572  *                                 to_object_func, to_dtype_func,
21573  *                                 memview.dtype_is_object)
21574  */
21575   __Pyx_XDECREF(__pyx_r);
21576 
21577   /* "View.MemoryView":1103
21578  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
21579  *                                 to_object_func, to_dtype_func,
21580  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
21581  *
21582  *
21583  */
21584   __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
21585   __Pyx_GOTREF(__pyx_t_5);
21586   __pyx_r = __pyx_t_5;
21587   __pyx_t_5 = 0;
21588   goto __pyx_L0;
21589 
21590   /* "View.MemoryView":1087
21591  *
21592  * @cname('__pyx_memoryview_copy_object_from_slice')
21593  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
21594  *     """
21595  *     Create a new memoryview object from a given memoryview object and slice.
21596  */
21597 
21598   /* function exit code */
21599   __pyx_L1_error:;
21600   __Pyx_XDECREF(__pyx_t_5);
21601   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21602   __pyx_r = 0;
21603   __pyx_L0:;
21604   __Pyx_XGIVEREF(__pyx_r);
21605   __Pyx_RefNannyFinishContext();
21606   return __pyx_r;
21607 }
21608 
21609 /* "View.MemoryView":1109
21610  *
21611  *
21612  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
21613  *     if arg < 0:
21614  *         return -arg
21615  */
21616 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)21617 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
21618   Py_ssize_t __pyx_r;
21619   int __pyx_t_1;
21620 
21621   /* "View.MemoryView":1110
21622  *
21623  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
21624  *     if arg < 0:             # <<<<<<<<<<<<<<
21625  *         return -arg
21626  *     else:
21627  */
21628   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
21629   if (__pyx_t_1) {
21630 
21631     /* "View.MemoryView":1111
21632  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
21633  *     if arg < 0:
21634  *         return -arg             # <<<<<<<<<<<<<<
21635  *     else:
21636  *         return arg
21637  */
21638     __pyx_r = (-__pyx_v_arg);
21639     goto __pyx_L0;
21640 
21641     /* "View.MemoryView":1110
21642  *
21643  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
21644  *     if arg < 0:             # <<<<<<<<<<<<<<
21645  *         return -arg
21646  *     else:
21647  */
21648   }
21649 
21650   /* "View.MemoryView":1113
21651  *         return -arg
21652  *     else:
21653  *         return arg             # <<<<<<<<<<<<<<
21654  *
21655  * @cname('__pyx_get_best_slice_order')
21656  */
21657   /*else*/ {
21658     __pyx_r = __pyx_v_arg;
21659     goto __pyx_L0;
21660   }
21661 
21662   /* "View.MemoryView":1109
21663  *
21664  *
21665  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
21666  *     if arg < 0:
21667  *         return -arg
21668  */
21669 
21670   /* function exit code */
21671   __pyx_L0:;
21672   return __pyx_r;
21673 }
21674 
21675 /* "View.MemoryView":1116
21676  *
21677  * @cname('__pyx_get_best_slice_order')
21678  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
21679  *     """
21680  *     Figure out the best memory access order for a given slice.
21681  */
21682 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)21683 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
21684   int __pyx_v_i;
21685   Py_ssize_t __pyx_v_c_stride;
21686   Py_ssize_t __pyx_v_f_stride;
21687   char __pyx_r;
21688   int __pyx_t_1;
21689   int __pyx_t_2;
21690   int __pyx_t_3;
21691   int __pyx_t_4;
21692 
21693   /* "View.MemoryView":1121
21694  *     """
21695  *     cdef int i
21696  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
21697  *     cdef Py_ssize_t f_stride = 0
21698  *
21699  */
21700   __pyx_v_c_stride = 0;
21701 
21702   /* "View.MemoryView":1122
21703  *     cdef int i
21704  *     cdef Py_ssize_t c_stride = 0
21705  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
21706  *
21707  *     for i in range(ndim - 1, -1, -1):
21708  */
21709   __pyx_v_f_stride = 0;
21710 
21711   /* "View.MemoryView":1124
21712  *     cdef Py_ssize_t f_stride = 0
21713  *
21714  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
21715  *         if mslice.shape[i] > 1:
21716  *             c_stride = mslice.strides[i]
21717  */
21718   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21719     __pyx_v_i = __pyx_t_1;
21720 
21721     /* "View.MemoryView":1125
21722  *
21723  *     for i in range(ndim - 1, -1, -1):
21724  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
21725  *             c_stride = mslice.strides[i]
21726  *             break
21727  */
21728     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
21729     if (__pyx_t_2) {
21730 
21731       /* "View.MemoryView":1126
21732  *     for i in range(ndim - 1, -1, -1):
21733  *         if mslice.shape[i] > 1:
21734  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
21735  *             break
21736  *
21737  */
21738       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
21739 
21740       /* "View.MemoryView":1127
21741  *         if mslice.shape[i] > 1:
21742  *             c_stride = mslice.strides[i]
21743  *             break             # <<<<<<<<<<<<<<
21744  *
21745  *     for i in range(ndim):
21746  */
21747       goto __pyx_L4_break;
21748 
21749       /* "View.MemoryView":1125
21750  *
21751  *     for i in range(ndim - 1, -1, -1):
21752  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
21753  *             c_stride = mslice.strides[i]
21754  *             break
21755  */
21756     }
21757   }
21758   __pyx_L4_break:;
21759 
21760   /* "View.MemoryView":1129
21761  *             break
21762  *
21763  *     for i in range(ndim):             # <<<<<<<<<<<<<<
21764  *         if mslice.shape[i] > 1:
21765  *             f_stride = mslice.strides[i]
21766  */
21767   __pyx_t_1 = __pyx_v_ndim;
21768   __pyx_t_3 = __pyx_t_1;
21769   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21770     __pyx_v_i = __pyx_t_4;
21771 
21772     /* "View.MemoryView":1130
21773  *
21774  *     for i in range(ndim):
21775  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
21776  *             f_stride = mslice.strides[i]
21777  *             break
21778  */
21779     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
21780     if (__pyx_t_2) {
21781 
21782       /* "View.MemoryView":1131
21783  *     for i in range(ndim):
21784  *         if mslice.shape[i] > 1:
21785  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
21786  *             break
21787  *
21788  */
21789       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
21790 
21791       /* "View.MemoryView":1132
21792  *         if mslice.shape[i] > 1:
21793  *             f_stride = mslice.strides[i]
21794  *             break             # <<<<<<<<<<<<<<
21795  *
21796  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
21797  */
21798       goto __pyx_L7_break;
21799 
21800       /* "View.MemoryView":1130
21801  *
21802  *     for i in range(ndim):
21803  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
21804  *             f_stride = mslice.strides[i]
21805  *             break
21806  */
21807     }
21808   }
21809   __pyx_L7_break:;
21810 
21811   /* "View.MemoryView":1134
21812  *             break
21813  *
21814  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
21815  *         return 'C'
21816  *     else:
21817  */
21818   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
21819   if (__pyx_t_2) {
21820 
21821     /* "View.MemoryView":1135
21822  *
21823  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
21824  *         return 'C'             # <<<<<<<<<<<<<<
21825  *     else:
21826  *         return 'F'
21827  */
21828     __pyx_r = 'C';
21829     goto __pyx_L0;
21830 
21831     /* "View.MemoryView":1134
21832  *             break
21833  *
21834  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
21835  *         return 'C'
21836  *     else:
21837  */
21838   }
21839 
21840   /* "View.MemoryView":1137
21841  *         return 'C'
21842  *     else:
21843  *         return 'F'             # <<<<<<<<<<<<<<
21844  *
21845  * @cython.cdivision(True)
21846  */
21847   /*else*/ {
21848     __pyx_r = 'F';
21849     goto __pyx_L0;
21850   }
21851 
21852   /* "View.MemoryView":1116
21853  *
21854  * @cname('__pyx_get_best_slice_order')
21855  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
21856  *     """
21857  *     Figure out the best memory access order for a given slice.
21858  */
21859 
21860   /* function exit code */
21861   __pyx_L0:;
21862   return __pyx_r;
21863 }
21864 
21865 /* "View.MemoryView":1140
21866  *
21867  * @cython.cdivision(True)
21868  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
21869  *                                    char *dst_data, Py_ssize_t *dst_strides,
21870  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
21871  */
21872 
_copy_strided_to_strided(char * __pyx_v_src_data,Py_ssize_t * __pyx_v_src_strides,char * __pyx_v_dst_data,Py_ssize_t * __pyx_v_dst_strides,Py_ssize_t * __pyx_v_src_shape,Py_ssize_t * __pyx_v_dst_shape,int __pyx_v_ndim,size_t __pyx_v_itemsize)21873 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
21874   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21875   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
21876   Py_ssize_t __pyx_v_dst_extent;
21877   Py_ssize_t __pyx_v_src_stride;
21878   Py_ssize_t __pyx_v_dst_stride;
21879   int __pyx_t_1;
21880   int __pyx_t_2;
21881   int __pyx_t_3;
21882   Py_ssize_t __pyx_t_4;
21883   Py_ssize_t __pyx_t_5;
21884   Py_ssize_t __pyx_t_6;
21885 
21886   /* "View.MemoryView":1147
21887  *
21888  *     cdef Py_ssize_t i
21889  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
21890  *     cdef Py_ssize_t dst_extent = dst_shape[0]
21891  *     cdef Py_ssize_t src_stride = src_strides[0]
21892  */
21893   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
21894 
21895   /* "View.MemoryView":1148
21896  *     cdef Py_ssize_t i
21897  *     cdef Py_ssize_t src_extent = src_shape[0]
21898  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
21899  *     cdef Py_ssize_t src_stride = src_strides[0]
21900  *     cdef Py_ssize_t dst_stride = dst_strides[0]
21901  */
21902   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
21903 
21904   /* "View.MemoryView":1149
21905  *     cdef Py_ssize_t src_extent = src_shape[0]
21906  *     cdef Py_ssize_t dst_extent = dst_shape[0]
21907  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
21908  *     cdef Py_ssize_t dst_stride = dst_strides[0]
21909  *
21910  */
21911   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
21912 
21913   /* "View.MemoryView":1150
21914  *     cdef Py_ssize_t dst_extent = dst_shape[0]
21915  *     cdef Py_ssize_t src_stride = src_strides[0]
21916  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
21917  *
21918  *     if ndim == 1:
21919  */
21920   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
21921 
21922   /* "View.MemoryView":1152
21923  *     cdef Py_ssize_t dst_stride = dst_strides[0]
21924  *
21925  *     if ndim == 1:             # <<<<<<<<<<<<<<
21926  *        if (src_stride > 0 and dst_stride > 0 and
21927  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
21928  */
21929   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21930   if (__pyx_t_1) {
21931 
21932     /* "View.MemoryView":1153
21933  *
21934  *     if ndim == 1:
21935  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
21936  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
21937  *            memcpy(dst_data, src_data, itemsize * dst_extent)
21938  */
21939     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
21940     if (__pyx_t_2) {
21941     } else {
21942       __pyx_t_1 = __pyx_t_2;
21943       goto __pyx_L5_bool_binop_done;
21944     }
21945     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
21946     if (__pyx_t_2) {
21947     } else {
21948       __pyx_t_1 = __pyx_t_2;
21949       goto __pyx_L5_bool_binop_done;
21950     }
21951 
21952     /* "View.MemoryView":1154
21953  *     if ndim == 1:
21954  *        if (src_stride > 0 and dst_stride > 0 and
21955  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
21956  *            memcpy(dst_data, src_data, itemsize * dst_extent)
21957  *        else:
21958  */
21959     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
21960     if (__pyx_t_2) {
21961       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
21962     }
21963     __pyx_t_3 = (__pyx_t_2 != 0);
21964     __pyx_t_1 = __pyx_t_3;
21965     __pyx_L5_bool_binop_done:;
21966 
21967     /* "View.MemoryView":1153
21968  *
21969  *     if ndim == 1:
21970  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
21971  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
21972  *            memcpy(dst_data, src_data, itemsize * dst_extent)
21973  */
21974     if (__pyx_t_1) {
21975 
21976       /* "View.MemoryView":1155
21977  *        if (src_stride > 0 and dst_stride > 0 and
21978  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
21979  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
21980  *        else:
21981  *            for i in range(dst_extent):
21982  */
21983       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
21984 
21985       /* "View.MemoryView":1153
21986  *
21987  *     if ndim == 1:
21988  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
21989  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
21990  *            memcpy(dst_data, src_data, itemsize * dst_extent)
21991  */
21992       goto __pyx_L4;
21993     }
21994 
21995     /* "View.MemoryView":1157
21996  *            memcpy(dst_data, src_data, itemsize * dst_extent)
21997  *        else:
21998  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
21999  *                memcpy(dst_data, src_data, itemsize)
22000  *                src_data += src_stride
22001  */
22002     /*else*/ {
22003       __pyx_t_4 = __pyx_v_dst_extent;
22004       __pyx_t_5 = __pyx_t_4;
22005       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22006         __pyx_v_i = __pyx_t_6;
22007 
22008         /* "View.MemoryView":1158
22009  *        else:
22010  *            for i in range(dst_extent):
22011  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
22012  *                src_data += src_stride
22013  *                dst_data += dst_stride
22014  */
22015         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
22016 
22017         /* "View.MemoryView":1159
22018  *            for i in range(dst_extent):
22019  *                memcpy(dst_data, src_data, itemsize)
22020  *                src_data += src_stride             # <<<<<<<<<<<<<<
22021  *                dst_data += dst_stride
22022  *     else:
22023  */
22024         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
22025 
22026         /* "View.MemoryView":1160
22027  *                memcpy(dst_data, src_data, itemsize)
22028  *                src_data += src_stride
22029  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
22030  *     else:
22031  *         for i in range(dst_extent):
22032  */
22033         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
22034       }
22035     }
22036     __pyx_L4:;
22037 
22038     /* "View.MemoryView":1152
22039  *     cdef Py_ssize_t dst_stride = dst_strides[0]
22040  *
22041  *     if ndim == 1:             # <<<<<<<<<<<<<<
22042  *        if (src_stride > 0 and dst_stride > 0 and
22043  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
22044  */
22045     goto __pyx_L3;
22046   }
22047 
22048   /* "View.MemoryView":1162
22049  *                dst_data += dst_stride
22050  *     else:
22051  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
22052  *             _copy_strided_to_strided(src_data, src_strides + 1,
22053  *                                      dst_data, dst_strides + 1,
22054  */
22055   /*else*/ {
22056     __pyx_t_4 = __pyx_v_dst_extent;
22057     __pyx_t_5 = __pyx_t_4;
22058     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22059       __pyx_v_i = __pyx_t_6;
22060 
22061       /* "View.MemoryView":1163
22062  *     else:
22063  *         for i in range(dst_extent):
22064  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
22065  *                                      dst_data, dst_strides + 1,
22066  *                                      src_shape + 1, dst_shape + 1,
22067  */
22068       _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
22069 
22070       /* "View.MemoryView":1167
22071  *                                      src_shape + 1, dst_shape + 1,
22072  *                                      ndim - 1, itemsize)
22073  *             src_data += src_stride             # <<<<<<<<<<<<<<
22074  *             dst_data += dst_stride
22075  *
22076  */
22077       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
22078 
22079       /* "View.MemoryView":1168
22080  *                                      ndim - 1, itemsize)
22081  *             src_data += src_stride
22082  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
22083  *
22084  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
22085  */
22086       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
22087     }
22088   }
22089   __pyx_L3:;
22090 
22091   /* "View.MemoryView":1140
22092  *
22093  * @cython.cdivision(True)
22094  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
22095  *                                    char *dst_data, Py_ssize_t *dst_strides,
22096  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
22097  */
22098 
22099   /* function exit code */
22100 }
22101 
22102 /* "View.MemoryView":1170
22103  *             dst_data += dst_stride
22104  *
22105  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
22106  *                                   __Pyx_memviewslice *dst,
22107  *                                   int ndim, size_t itemsize) nogil:
22108  */
22109 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)22110 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
22111 
22112   /* "View.MemoryView":1173
22113  *                                   __Pyx_memviewslice *dst,
22114  *                                   int ndim, size_t itemsize) nogil:
22115  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
22116  *                              src.shape, dst.shape, ndim, itemsize)
22117  *
22118  */
22119   _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
22120 
22121   /* "View.MemoryView":1170
22122  *             dst_data += dst_stride
22123  *
22124  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
22125  *                                   __Pyx_memviewslice *dst,
22126  *                                   int ndim, size_t itemsize) nogil:
22127  */
22128 
22129   /* function exit code */
22130 }
22131 
22132 /* "View.MemoryView":1177
22133  *
22134  * @cname('__pyx_memoryview_slice_get_size')
22135  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
22136  *     "Return the size of the memory occupied by the slice in number of bytes"
22137  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
22138  */
22139 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)22140 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
22141   Py_ssize_t __pyx_v_shape;
22142   Py_ssize_t __pyx_v_size;
22143   Py_ssize_t __pyx_r;
22144   Py_ssize_t __pyx_t_1;
22145   Py_ssize_t *__pyx_t_2;
22146   Py_ssize_t *__pyx_t_3;
22147   Py_ssize_t *__pyx_t_4;
22148 
22149   /* "View.MemoryView":1179
22150  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
22151  *     "Return the size of the memory occupied by the slice in number of bytes"
22152  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
22153  *
22154  *     for shape in src.shape[:ndim]:
22155  */
22156   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
22157   __pyx_v_size = __pyx_t_1;
22158 
22159   /* "View.MemoryView":1181
22160  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
22161  *
22162  *     for shape in src.shape[:ndim]:             # <<<<<<<<<<<<<<
22163  *         size *= shape
22164  *
22165  */
22166   __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
22167   for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
22168     __pyx_t_2 = __pyx_t_4;
22169     __pyx_v_shape = (__pyx_t_2[0]);
22170 
22171     /* "View.MemoryView":1182
22172  *
22173  *     for shape in src.shape[:ndim]:
22174  *         size *= shape             # <<<<<<<<<<<<<<
22175  *
22176  *     return size
22177  */
22178     __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
22179   }
22180 
22181   /* "View.MemoryView":1184
22182  *         size *= shape
22183  *
22184  *     return size             # <<<<<<<<<<<<<<
22185  *
22186  * @cname('__pyx_fill_contig_strides_array')
22187  */
22188   __pyx_r = __pyx_v_size;
22189   goto __pyx_L0;
22190 
22191   /* "View.MemoryView":1177
22192  *
22193  * @cname('__pyx_memoryview_slice_get_size')
22194  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
22195  *     "Return the size of the memory occupied by the slice in number of bytes"
22196  *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
22197  */
22198 
22199   /* function exit code */
22200   __pyx_L0:;
22201   return __pyx_r;
22202 }
22203 
22204 /* "View.MemoryView":1187
22205  *
22206  * @cname('__pyx_fill_contig_strides_array')
22207  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
22208  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
22209  *                 int ndim, char order) nogil:
22210  */
22211 
__pyx_fill_contig_strides_array(Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,Py_ssize_t __pyx_v_stride,int __pyx_v_ndim,char __pyx_v_order)22212 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
22213   int __pyx_v_idx;
22214   Py_ssize_t __pyx_r;
22215   int __pyx_t_1;
22216   int __pyx_t_2;
22217   int __pyx_t_3;
22218   int __pyx_t_4;
22219 
22220   /* "View.MemoryView":1196
22221  *     cdef int idx
22222  *
22223  *     if order == 'F':             # <<<<<<<<<<<<<<
22224  *         for idx in range(ndim):
22225  *             strides[idx] = stride
22226  */
22227   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
22228   if (__pyx_t_1) {
22229 
22230     /* "View.MemoryView":1197
22231  *
22232  *     if order == 'F':
22233  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
22234  *             strides[idx] = stride
22235  *             stride *= shape[idx]
22236  */
22237     __pyx_t_2 = __pyx_v_ndim;
22238     __pyx_t_3 = __pyx_t_2;
22239     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22240       __pyx_v_idx = __pyx_t_4;
22241 
22242       /* "View.MemoryView":1198
22243  *     if order == 'F':
22244  *         for idx in range(ndim):
22245  *             strides[idx] = stride             # <<<<<<<<<<<<<<
22246  *             stride *= shape[idx]
22247  *     else:
22248  */
22249       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
22250 
22251       /* "View.MemoryView":1199
22252  *         for idx in range(ndim):
22253  *             strides[idx] = stride
22254  *             stride *= shape[idx]             # <<<<<<<<<<<<<<
22255  *     else:
22256  *         for idx in range(ndim - 1, -1, -1):
22257  */
22258       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
22259     }
22260 
22261     /* "View.MemoryView":1196
22262  *     cdef int idx
22263  *
22264  *     if order == 'F':             # <<<<<<<<<<<<<<
22265  *         for idx in range(ndim):
22266  *             strides[idx] = stride
22267  */
22268     goto __pyx_L3;
22269   }
22270 
22271   /* "View.MemoryView":1201
22272  *             stride *= shape[idx]
22273  *     else:
22274  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
22275  *             strides[idx] = stride
22276  *             stride *= shape[idx]
22277  */
22278   /*else*/ {
22279     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
22280       __pyx_v_idx = __pyx_t_2;
22281 
22282       /* "View.MemoryView":1202
22283  *     else:
22284  *         for idx in range(ndim - 1, -1, -1):
22285  *             strides[idx] = stride             # <<<<<<<<<<<<<<
22286  *             stride *= shape[idx]
22287  *
22288  */
22289       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
22290 
22291       /* "View.MemoryView":1203
22292  *         for idx in range(ndim - 1, -1, -1):
22293  *             strides[idx] = stride
22294  *             stride *= shape[idx]             # <<<<<<<<<<<<<<
22295  *
22296  *     return stride
22297  */
22298       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
22299     }
22300   }
22301   __pyx_L3:;
22302 
22303   /* "View.MemoryView":1205
22304  *             stride *= shape[idx]
22305  *
22306  *     return stride             # <<<<<<<<<<<<<<
22307  *
22308  * @cname('__pyx_memoryview_copy_data_to_temp')
22309  */
22310   __pyx_r = __pyx_v_stride;
22311   goto __pyx_L0;
22312 
22313   /* "View.MemoryView":1187
22314  *
22315  * @cname('__pyx_fill_contig_strides_array')
22316  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
22317  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
22318  *                 int ndim, char order) nogil:
22319  */
22320 
22321   /* function exit code */
22322   __pyx_L0:;
22323   return __pyx_r;
22324 }
22325 
22326 /* "View.MemoryView":1208
22327  *
22328  * @cname('__pyx_memoryview_copy_data_to_temp')
22329  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
22330  *                              __Pyx_memviewslice *tmpslice,
22331  *                              char order,
22332  */
22333 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)22334 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
22335   int __pyx_v_i;
22336   void *__pyx_v_result;
22337   size_t __pyx_v_itemsize;
22338   size_t __pyx_v_size;
22339   void *__pyx_r;
22340   Py_ssize_t __pyx_t_1;
22341   int __pyx_t_2;
22342   int __pyx_t_3;
22343   struct __pyx_memoryview_obj *__pyx_t_4;
22344   int __pyx_t_5;
22345   int __pyx_t_6;
22346   int __pyx_lineno = 0;
22347   const char *__pyx_filename = NULL;
22348   int __pyx_clineno = 0;
22349 
22350   /* "View.MemoryView":1219
22351  *     cdef void *result
22352  *
22353  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
22354  *     cdef size_t size = slice_get_size(src, ndim)
22355  *
22356  */
22357   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
22358   __pyx_v_itemsize = __pyx_t_1;
22359 
22360   /* "View.MemoryView":1220
22361  *
22362  *     cdef size_t itemsize = src.memview.view.itemsize
22363  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
22364  *
22365  *     result = malloc(size)
22366  */
22367   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
22368 
22369   /* "View.MemoryView":1222
22370  *     cdef size_t size = slice_get_size(src, ndim)
22371  *
22372  *     result = malloc(size)             # <<<<<<<<<<<<<<
22373  *     if not result:
22374  *         _err(MemoryError, NULL)
22375  */
22376   __pyx_v_result = malloc(__pyx_v_size);
22377 
22378   /* "View.MemoryView":1223
22379  *
22380  *     result = malloc(size)
22381  *     if not result:             # <<<<<<<<<<<<<<
22382  *         _err(MemoryError, NULL)
22383  *
22384  */
22385   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
22386   if (__pyx_t_2) {
22387 
22388     /* "View.MemoryView":1224
22389  *     result = malloc(size)
22390  *     if not result:
22391  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
22392  *
22393  *
22394  */
22395     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
22396 
22397     /* "View.MemoryView":1223
22398  *
22399  *     result = malloc(size)
22400  *     if not result:             # <<<<<<<<<<<<<<
22401  *         _err(MemoryError, NULL)
22402  *
22403  */
22404   }
22405 
22406   /* "View.MemoryView":1227
22407  *
22408  *
22409  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
22410  *     tmpslice.memview = src.memview
22411  *     for i in range(ndim):
22412  */
22413   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
22414 
22415   /* "View.MemoryView":1228
22416  *
22417  *     tmpslice.data = <char *> result
22418  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
22419  *     for i in range(ndim):
22420  *         tmpslice.shape[i] = src.shape[i]
22421  */
22422   __pyx_t_4 = __pyx_v_src->memview;
22423   __pyx_v_tmpslice->memview = __pyx_t_4;
22424 
22425   /* "View.MemoryView":1229
22426  *     tmpslice.data = <char *> result
22427  *     tmpslice.memview = src.memview
22428  *     for i in range(ndim):             # <<<<<<<<<<<<<<
22429  *         tmpslice.shape[i] = src.shape[i]
22430  *         tmpslice.suboffsets[i] = -1
22431  */
22432   __pyx_t_3 = __pyx_v_ndim;
22433   __pyx_t_5 = __pyx_t_3;
22434   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22435     __pyx_v_i = __pyx_t_6;
22436 
22437     /* "View.MemoryView":1230
22438  *     tmpslice.memview = src.memview
22439  *     for i in range(ndim):
22440  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
22441  *         tmpslice.suboffsets[i] = -1
22442  *
22443  */
22444     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
22445 
22446     /* "View.MemoryView":1231
22447  *     for i in range(ndim):
22448  *         tmpslice.shape[i] = src.shape[i]
22449  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
22450  *
22451  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
22452  */
22453     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
22454   }
22455 
22456   /* "View.MemoryView":1233
22457  *         tmpslice.suboffsets[i] = -1
22458  *
22459  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
22460  *                               ndim, order)
22461  *
22462  */
22463   (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
22464 
22465   /* "View.MemoryView":1237
22466  *
22467  *
22468  *     for i in range(ndim):             # <<<<<<<<<<<<<<
22469  *         if tmpslice.shape[i] == 1:
22470  *             tmpslice.strides[i] = 0
22471  */
22472   __pyx_t_3 = __pyx_v_ndim;
22473   __pyx_t_5 = __pyx_t_3;
22474   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
22475     __pyx_v_i = __pyx_t_6;
22476 
22477     /* "View.MemoryView":1238
22478  *
22479  *     for i in range(ndim):
22480  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
22481  *             tmpslice.strides[i] = 0
22482  *
22483  */
22484     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
22485     if (__pyx_t_2) {
22486 
22487       /* "View.MemoryView":1239
22488  *     for i in range(ndim):
22489  *         if tmpslice.shape[i] == 1:
22490  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
22491  *
22492  *     if slice_is_contig(src[0], order, ndim):
22493  */
22494       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
22495 
22496       /* "View.MemoryView":1238
22497  *
22498  *     for i in range(ndim):
22499  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
22500  *             tmpslice.strides[i] = 0
22501  *
22502  */
22503     }
22504   }
22505 
22506   /* "View.MemoryView":1241
22507  *             tmpslice.strides[i] = 0
22508  *
22509  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
22510  *         memcpy(result, src.data, size)
22511  *     else:
22512  */
22513   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
22514   if (__pyx_t_2) {
22515 
22516     /* "View.MemoryView":1242
22517  *
22518  *     if slice_is_contig(src[0], order, ndim):
22519  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
22520  *     else:
22521  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
22522  */
22523     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
22524 
22525     /* "View.MemoryView":1241
22526  *             tmpslice.strides[i] = 0
22527  *
22528  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
22529  *         memcpy(result, src.data, size)
22530  *     else:
22531  */
22532     goto __pyx_L9;
22533   }
22534 
22535   /* "View.MemoryView":1244
22536  *         memcpy(result, src.data, size)
22537  *     else:
22538  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
22539  *
22540  *     return result
22541  */
22542   /*else*/ {
22543     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
22544   }
22545   __pyx_L9:;
22546 
22547   /* "View.MemoryView":1246
22548  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
22549  *
22550  *     return result             # <<<<<<<<<<<<<<
22551  *
22552  *
22553  */
22554   __pyx_r = __pyx_v_result;
22555   goto __pyx_L0;
22556 
22557   /* "View.MemoryView":1208
22558  *
22559  * @cname('__pyx_memoryview_copy_data_to_temp')
22560  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
22561  *                              __Pyx_memviewslice *tmpslice,
22562  *                              char order,
22563  */
22564 
22565   /* function exit code */
22566   __pyx_L1_error:;
22567   {
22568     #ifdef WITH_THREAD
22569     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22570     #endif
22571     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
22572     #ifdef WITH_THREAD
22573     __Pyx_PyGILState_Release(__pyx_gilstate_save);
22574     #endif
22575   }
22576   __pyx_r = NULL;
22577   __pyx_L0:;
22578   return __pyx_r;
22579 }
22580 
22581 /* "View.MemoryView":1251
22582  *
22583  * @cname('__pyx_memoryview_err_extents')
22584  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
22585  *                              Py_ssize_t extent2) except -1 with gil:
22586  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
22587  */
22588 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)22589 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
22590   int __pyx_r;
22591   __Pyx_RefNannyDeclarations
22592   PyObject *__pyx_t_1 = NULL;
22593   PyObject *__pyx_t_2 = NULL;
22594   PyObject *__pyx_t_3 = NULL;
22595   PyObject *__pyx_t_4 = NULL;
22596   int __pyx_lineno = 0;
22597   const char *__pyx_filename = NULL;
22598   int __pyx_clineno = 0;
22599   #ifdef WITH_THREAD
22600   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22601   #endif
22602   __Pyx_RefNannySetupContext("_err_extents", 0);
22603 
22604   /* "View.MemoryView":1254
22605  *                              Py_ssize_t extent2) except -1 with gil:
22606  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
22607  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
22608  *
22609  * @cname('__pyx_memoryview_err_dim')
22610  */
22611   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
22612   __Pyx_GOTREF(__pyx_t_1);
22613   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
22614   __Pyx_GOTREF(__pyx_t_2);
22615   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
22616   __Pyx_GOTREF(__pyx_t_3);
22617   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
22618   __Pyx_GOTREF(__pyx_t_4);
22619   __Pyx_GIVEREF(__pyx_t_1);
22620   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
22621   __Pyx_GIVEREF(__pyx_t_2);
22622   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
22623   __Pyx_GIVEREF(__pyx_t_3);
22624   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
22625   __pyx_t_1 = 0;
22626   __pyx_t_2 = 0;
22627   __pyx_t_3 = 0;
22628 
22629   /* "View.MemoryView":1253
22630  * cdef int _err_extents(int i, Py_ssize_t extent1,
22631  *                              Py_ssize_t extent2) except -1 with gil:
22632  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
22633  *                                                         (i, extent1, extent2))
22634  *
22635  */
22636   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
22637   __Pyx_GOTREF(__pyx_t_3);
22638   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22639   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
22640   __Pyx_GOTREF(__pyx_t_4);
22641   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22642   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22643   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22644   __PYX_ERR(1, 1253, __pyx_L1_error)
22645 
22646   /* "View.MemoryView":1251
22647  *
22648  * @cname('__pyx_memoryview_err_extents')
22649  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
22650  *                              Py_ssize_t extent2) except -1 with gil:
22651  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
22652  */
22653 
22654   /* function exit code */
22655   __pyx_L1_error:;
22656   __Pyx_XDECREF(__pyx_t_1);
22657   __Pyx_XDECREF(__pyx_t_2);
22658   __Pyx_XDECREF(__pyx_t_3);
22659   __Pyx_XDECREF(__pyx_t_4);
22660   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
22661   __pyx_r = -1;
22662   __Pyx_RefNannyFinishContext();
22663   #ifdef WITH_THREAD
22664   __Pyx_PyGILState_Release(__pyx_gilstate_save);
22665   #endif
22666   return __pyx_r;
22667 }
22668 
22669 /* "View.MemoryView":1257
22670  *
22671  * @cname('__pyx_memoryview_err_dim')
22672  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
22673  *     raise error(msg.decode('ascii') % dim)
22674  *
22675  */
22676 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)22677 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
22678   int __pyx_r;
22679   __Pyx_RefNannyDeclarations
22680   PyObject *__pyx_t_1 = NULL;
22681   PyObject *__pyx_t_2 = NULL;
22682   PyObject *__pyx_t_3 = NULL;
22683   PyObject *__pyx_t_4 = NULL;
22684   int __pyx_lineno = 0;
22685   const char *__pyx_filename = NULL;
22686   int __pyx_clineno = 0;
22687   #ifdef WITH_THREAD
22688   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22689   #endif
22690   __Pyx_RefNannySetupContext("_err_dim", 0);
22691   __Pyx_INCREF(__pyx_v_error);
22692 
22693   /* "View.MemoryView":1258
22694  * @cname('__pyx_memoryview_err_dim')
22695  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
22696  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
22697  *
22698  * @cname('__pyx_memoryview_err')
22699  */
22700   __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
22701   __Pyx_GOTREF(__pyx_t_2);
22702   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
22703   __Pyx_GOTREF(__pyx_t_3);
22704   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
22705   __Pyx_GOTREF(__pyx_t_4);
22706   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22707   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22708   __Pyx_INCREF(__pyx_v_error);
22709   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
22710   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
22711     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
22712     if (likely(__pyx_t_2)) {
22713       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22714       __Pyx_INCREF(__pyx_t_2);
22715       __Pyx_INCREF(function);
22716       __Pyx_DECREF_SET(__pyx_t_3, function);
22717     }
22718   }
22719   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
22720   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22721   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22722   if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
22723   __Pyx_GOTREF(__pyx_t_1);
22724   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22725   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22726   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22727   __PYX_ERR(1, 1258, __pyx_L1_error)
22728 
22729   /* "View.MemoryView":1257
22730  *
22731  * @cname('__pyx_memoryview_err_dim')
22732  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
22733  *     raise error(msg.decode('ascii') % dim)
22734  *
22735  */
22736 
22737   /* function exit code */
22738   __pyx_L1_error:;
22739   __Pyx_XDECREF(__pyx_t_1);
22740   __Pyx_XDECREF(__pyx_t_2);
22741   __Pyx_XDECREF(__pyx_t_3);
22742   __Pyx_XDECREF(__pyx_t_4);
22743   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
22744   __pyx_r = -1;
22745   __Pyx_XDECREF(__pyx_v_error);
22746   __Pyx_RefNannyFinishContext();
22747   #ifdef WITH_THREAD
22748   __Pyx_PyGILState_Release(__pyx_gilstate_save);
22749   #endif
22750   return __pyx_r;
22751 }
22752 
22753 /* "View.MemoryView":1261
22754  *
22755  * @cname('__pyx_memoryview_err')
22756  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
22757  *     if msg != NULL:
22758  *         raise error(msg.decode('ascii'))
22759  */
22760 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)22761 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
22762   int __pyx_r;
22763   __Pyx_RefNannyDeclarations
22764   int __pyx_t_1;
22765   PyObject *__pyx_t_2 = NULL;
22766   PyObject *__pyx_t_3 = NULL;
22767   PyObject *__pyx_t_4 = NULL;
22768   PyObject *__pyx_t_5 = NULL;
22769   int __pyx_lineno = 0;
22770   const char *__pyx_filename = NULL;
22771   int __pyx_clineno = 0;
22772   #ifdef WITH_THREAD
22773   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22774   #endif
22775   __Pyx_RefNannySetupContext("_err", 0);
22776   __Pyx_INCREF(__pyx_v_error);
22777 
22778   /* "View.MemoryView":1262
22779  * @cname('__pyx_memoryview_err')
22780  * cdef int _err(object error, char *msg) except -1 with gil:
22781  *     if msg != NULL:             # <<<<<<<<<<<<<<
22782  *         raise error(msg.decode('ascii'))
22783  *     else:
22784  */
22785   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
22786   if (unlikely(__pyx_t_1)) {
22787 
22788     /* "View.MemoryView":1263
22789  * cdef int _err(object error, char *msg) except -1 with gil:
22790  *     if msg != NULL:
22791  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
22792  *     else:
22793  *         raise error
22794  */
22795     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
22796     __Pyx_GOTREF(__pyx_t_3);
22797     __Pyx_INCREF(__pyx_v_error);
22798     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
22799     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
22800       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
22801       if (likely(__pyx_t_5)) {
22802         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
22803         __Pyx_INCREF(__pyx_t_5);
22804         __Pyx_INCREF(function);
22805         __Pyx_DECREF_SET(__pyx_t_4, function);
22806       }
22807     }
22808     __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
22809     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22810     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22811     if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
22812     __Pyx_GOTREF(__pyx_t_2);
22813     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22814     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
22815     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22816     __PYX_ERR(1, 1263, __pyx_L1_error)
22817 
22818     /* "View.MemoryView":1262
22819  * @cname('__pyx_memoryview_err')
22820  * cdef int _err(object error, char *msg) except -1 with gil:
22821  *     if msg != NULL:             # <<<<<<<<<<<<<<
22822  *         raise error(msg.decode('ascii'))
22823  *     else:
22824  */
22825   }
22826 
22827   /* "View.MemoryView":1265
22828  *         raise error(msg.decode('ascii'))
22829  *     else:
22830  *         raise error             # <<<<<<<<<<<<<<
22831  *
22832  * @cname('__pyx_memoryview_copy_contents')
22833  */
22834   /*else*/ {
22835     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
22836     __PYX_ERR(1, 1265, __pyx_L1_error)
22837   }
22838 
22839   /* "View.MemoryView":1261
22840  *
22841  * @cname('__pyx_memoryview_err')
22842  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
22843  *     if msg != NULL:
22844  *         raise error(msg.decode('ascii'))
22845  */
22846 
22847   /* function exit code */
22848   __pyx_L1_error:;
22849   __Pyx_XDECREF(__pyx_t_2);
22850   __Pyx_XDECREF(__pyx_t_3);
22851   __Pyx_XDECREF(__pyx_t_4);
22852   __Pyx_XDECREF(__pyx_t_5);
22853   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
22854   __pyx_r = -1;
22855   __Pyx_XDECREF(__pyx_v_error);
22856   __Pyx_RefNannyFinishContext();
22857   #ifdef WITH_THREAD
22858   __Pyx_PyGILState_Release(__pyx_gilstate_save);
22859   #endif
22860   return __pyx_r;
22861 }
22862 
22863 /* "View.MemoryView":1268
22864  *
22865  * @cname('__pyx_memoryview_copy_contents')
22866  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
22867  *                                   __Pyx_memviewslice dst,
22868  *                                   int src_ndim, int dst_ndim,
22869  */
22870 
__pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src,__Pyx_memviewslice __pyx_v_dst,int __pyx_v_src_ndim,int __pyx_v_dst_ndim,int __pyx_v_dtype_is_object)22871 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
22872   void *__pyx_v_tmpdata;
22873   size_t __pyx_v_itemsize;
22874   int __pyx_v_i;
22875   char __pyx_v_order;
22876   int __pyx_v_broadcasting;
22877   int __pyx_v_direct_copy;
22878   __Pyx_memviewslice __pyx_v_tmp;
22879   int __pyx_v_ndim;
22880   int __pyx_r;
22881   Py_ssize_t __pyx_t_1;
22882   int __pyx_t_2;
22883   int __pyx_t_3;
22884   int __pyx_t_4;
22885   int __pyx_t_5;
22886   int __pyx_t_6;
22887   void *__pyx_t_7;
22888   int __pyx_t_8;
22889   int __pyx_lineno = 0;
22890   const char *__pyx_filename = NULL;
22891   int __pyx_clineno = 0;
22892 
22893   /* "View.MemoryView":1276
22894  *     Check for overlapping memory and verify the shapes.
22895  *     """
22896  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
22897  *     cdef size_t itemsize = src.memview.view.itemsize
22898  *     cdef int i
22899  */
22900   __pyx_v_tmpdata = NULL;
22901 
22902   /* "View.MemoryView":1277
22903  *     """
22904  *     cdef void *tmpdata = NULL
22905  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
22906  *     cdef int i
22907  *     cdef char order = get_best_order(&src, src_ndim)
22908  */
22909   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
22910   __pyx_v_itemsize = __pyx_t_1;
22911 
22912   /* "View.MemoryView":1279
22913  *     cdef size_t itemsize = src.memview.view.itemsize
22914  *     cdef int i
22915  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
22916  *     cdef bint broadcasting = False
22917  *     cdef bint direct_copy = False
22918  */
22919   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
22920 
22921   /* "View.MemoryView":1280
22922  *     cdef int i
22923  *     cdef char order = get_best_order(&src, src_ndim)
22924  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
22925  *     cdef bint direct_copy = False
22926  *     cdef __Pyx_memviewslice tmp
22927  */
22928   __pyx_v_broadcasting = 0;
22929 
22930   /* "View.MemoryView":1281
22931  *     cdef char order = get_best_order(&src, src_ndim)
22932  *     cdef bint broadcasting = False
22933  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
22934  *     cdef __Pyx_memviewslice tmp
22935  *
22936  */
22937   __pyx_v_direct_copy = 0;
22938 
22939   /* "View.MemoryView":1284
22940  *     cdef __Pyx_memviewslice tmp
22941  *
22942  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
22943  *         broadcast_leading(&src, src_ndim, dst_ndim)
22944  *     elif dst_ndim < src_ndim:
22945  */
22946   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
22947   if (__pyx_t_2) {
22948 
22949     /* "View.MemoryView":1285
22950  *
22951  *     if src_ndim < dst_ndim:
22952  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
22953  *     elif dst_ndim < src_ndim:
22954  *         broadcast_leading(&dst, dst_ndim, src_ndim)
22955  */
22956     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
22957 
22958     /* "View.MemoryView":1284
22959  *     cdef __Pyx_memviewslice tmp
22960  *
22961  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
22962  *         broadcast_leading(&src, src_ndim, dst_ndim)
22963  *     elif dst_ndim < src_ndim:
22964  */
22965     goto __pyx_L3;
22966   }
22967 
22968   /* "View.MemoryView":1286
22969  *     if src_ndim < dst_ndim:
22970  *         broadcast_leading(&src, src_ndim, dst_ndim)
22971  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
22972  *         broadcast_leading(&dst, dst_ndim, src_ndim)
22973  *
22974  */
22975   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
22976   if (__pyx_t_2) {
22977 
22978     /* "View.MemoryView":1287
22979  *         broadcast_leading(&src, src_ndim, dst_ndim)
22980  *     elif dst_ndim < src_ndim:
22981  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
22982  *
22983  *     cdef int ndim = max(src_ndim, dst_ndim)
22984  */
22985     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
22986 
22987     /* "View.MemoryView":1286
22988  *     if src_ndim < dst_ndim:
22989  *         broadcast_leading(&src, src_ndim, dst_ndim)
22990  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
22991  *         broadcast_leading(&dst, dst_ndim, src_ndim)
22992  *
22993  */
22994   }
22995   __pyx_L3:;
22996 
22997   /* "View.MemoryView":1289
22998  *         broadcast_leading(&dst, dst_ndim, src_ndim)
22999  *
23000  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
23001  *
23002  *     for i in range(ndim):
23003  */
23004   __pyx_t_3 = __pyx_v_dst_ndim;
23005   __pyx_t_4 = __pyx_v_src_ndim;
23006   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
23007     __pyx_t_5 = __pyx_t_3;
23008   } else {
23009     __pyx_t_5 = __pyx_t_4;
23010   }
23011   __pyx_v_ndim = __pyx_t_5;
23012 
23013   /* "View.MemoryView":1291
23014  *     cdef int ndim = max(src_ndim, dst_ndim)
23015  *
23016  *     for i in range(ndim):             # <<<<<<<<<<<<<<
23017  *         if src.shape[i] != dst.shape[i]:
23018  *             if src.shape[i] == 1:
23019  */
23020   __pyx_t_5 = __pyx_v_ndim;
23021   __pyx_t_3 = __pyx_t_5;
23022   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23023     __pyx_v_i = __pyx_t_4;
23024 
23025     /* "View.MemoryView":1292
23026  *
23027  *     for i in range(ndim):
23028  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
23029  *             if src.shape[i] == 1:
23030  *                 broadcasting = True
23031  */
23032     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
23033     if (__pyx_t_2) {
23034 
23035       /* "View.MemoryView":1293
23036  *     for i in range(ndim):
23037  *         if src.shape[i] != dst.shape[i]:
23038  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
23039  *                 broadcasting = True
23040  *                 src.strides[i] = 0
23041  */
23042       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
23043       if (__pyx_t_2) {
23044 
23045         /* "View.MemoryView":1294
23046  *         if src.shape[i] != dst.shape[i]:
23047  *             if src.shape[i] == 1:
23048  *                 broadcasting = True             # <<<<<<<<<<<<<<
23049  *                 src.strides[i] = 0
23050  *             else:
23051  */
23052         __pyx_v_broadcasting = 1;
23053 
23054         /* "View.MemoryView":1295
23055  *             if src.shape[i] == 1:
23056  *                 broadcasting = True
23057  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
23058  *             else:
23059  *                 _err_extents(i, dst.shape[i], src.shape[i])
23060  */
23061         (__pyx_v_src.strides[__pyx_v_i]) = 0;
23062 
23063         /* "View.MemoryView":1293
23064  *     for i in range(ndim):
23065  *         if src.shape[i] != dst.shape[i]:
23066  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
23067  *                 broadcasting = True
23068  *                 src.strides[i] = 0
23069  */
23070         goto __pyx_L7;
23071       }
23072 
23073       /* "View.MemoryView":1297
23074  *                 src.strides[i] = 0
23075  *             else:
23076  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
23077  *
23078  *         if src.suboffsets[i] >= 0:
23079  */
23080       /*else*/ {
23081         __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
23082       }
23083       __pyx_L7:;
23084 
23085       /* "View.MemoryView":1292
23086  *
23087  *     for i in range(ndim):
23088  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
23089  *             if src.shape[i] == 1:
23090  *                 broadcasting = True
23091  */
23092     }
23093 
23094     /* "View.MemoryView":1299
23095  *                 _err_extents(i, dst.shape[i], src.shape[i])
23096  *
23097  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
23098  *             _err_dim(ValueError, "Dimension %d is not direct", i)
23099  *
23100  */
23101     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
23102     if (__pyx_t_2) {
23103 
23104       /* "View.MemoryView":1300
23105  *
23106  *         if src.suboffsets[i] >= 0:
23107  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
23108  *
23109  *     if slices_overlap(&src, &dst, ndim, itemsize):
23110  */
23111       __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
23112 
23113       /* "View.MemoryView":1299
23114  *                 _err_extents(i, dst.shape[i], src.shape[i])
23115  *
23116  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
23117  *             _err_dim(ValueError, "Dimension %d is not direct", i)
23118  *
23119  */
23120     }
23121   }
23122 
23123   /* "View.MemoryView":1302
23124  *             _err_dim(ValueError, "Dimension %d is not direct", i)
23125  *
23126  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
23127  *
23128  *         if not slice_is_contig(src, order, ndim):
23129  */
23130   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
23131   if (__pyx_t_2) {
23132 
23133     /* "View.MemoryView":1304
23134  *     if slices_overlap(&src, &dst, ndim, itemsize):
23135  *
23136  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
23137  *             order = get_best_order(&dst, ndim)
23138  *
23139  */
23140     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
23141     if (__pyx_t_2) {
23142 
23143       /* "View.MemoryView":1305
23144  *
23145  *         if not slice_is_contig(src, order, ndim):
23146  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
23147  *
23148  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
23149  */
23150       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
23151 
23152       /* "View.MemoryView":1304
23153  *     if slices_overlap(&src, &dst, ndim, itemsize):
23154  *
23155  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
23156  *             order = get_best_order(&dst, ndim)
23157  *
23158  */
23159     }
23160 
23161     /* "View.MemoryView":1307
23162  *             order = get_best_order(&dst, ndim)
23163  *
23164  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
23165  *         src = tmp
23166  *
23167  */
23168     __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
23169     __pyx_v_tmpdata = __pyx_t_7;
23170 
23171     /* "View.MemoryView":1308
23172  *
23173  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
23174  *         src = tmp             # <<<<<<<<<<<<<<
23175  *
23176  *     if not broadcasting:
23177  */
23178     __pyx_v_src = __pyx_v_tmp;
23179 
23180     /* "View.MemoryView":1302
23181  *             _err_dim(ValueError, "Dimension %d is not direct", i)
23182  *
23183  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
23184  *
23185  *         if not slice_is_contig(src, order, ndim):
23186  */
23187   }
23188 
23189   /* "View.MemoryView":1310
23190  *         src = tmp
23191  *
23192  *     if not broadcasting:             # <<<<<<<<<<<<<<
23193  *
23194  *
23195  */
23196   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
23197   if (__pyx_t_2) {
23198 
23199     /* "View.MemoryView":1313
23200  *
23201  *
23202  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
23203  *             direct_copy = slice_is_contig(dst, 'C', ndim)
23204  *         elif slice_is_contig(src, 'F', ndim):
23205  */
23206     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
23207     if (__pyx_t_2) {
23208 
23209       /* "View.MemoryView":1314
23210  *
23211  *         if slice_is_contig(src, 'C', ndim):
23212  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
23213  *         elif slice_is_contig(src, 'F', ndim):
23214  *             direct_copy = slice_is_contig(dst, 'F', ndim)
23215  */
23216       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
23217 
23218       /* "View.MemoryView":1313
23219  *
23220  *
23221  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
23222  *             direct_copy = slice_is_contig(dst, 'C', ndim)
23223  *         elif slice_is_contig(src, 'F', ndim):
23224  */
23225       goto __pyx_L12;
23226     }
23227 
23228     /* "View.MemoryView":1315
23229  *         if slice_is_contig(src, 'C', ndim):
23230  *             direct_copy = slice_is_contig(dst, 'C', ndim)
23231  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
23232  *             direct_copy = slice_is_contig(dst, 'F', ndim)
23233  *
23234  */
23235     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
23236     if (__pyx_t_2) {
23237 
23238       /* "View.MemoryView":1316
23239  *             direct_copy = slice_is_contig(dst, 'C', ndim)
23240  *         elif slice_is_contig(src, 'F', ndim):
23241  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
23242  *
23243  *         if direct_copy:
23244  */
23245       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
23246 
23247       /* "View.MemoryView":1315
23248  *         if slice_is_contig(src, 'C', ndim):
23249  *             direct_copy = slice_is_contig(dst, 'C', ndim)
23250  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
23251  *             direct_copy = slice_is_contig(dst, 'F', ndim)
23252  *
23253  */
23254     }
23255     __pyx_L12:;
23256 
23257     /* "View.MemoryView":1318
23258  *             direct_copy = slice_is_contig(dst, 'F', ndim)
23259  *
23260  *         if direct_copy:             # <<<<<<<<<<<<<<
23261  *
23262  *             refcount_copying(&dst, dtype_is_object, ndim, False)
23263  */
23264     __pyx_t_2 = (__pyx_v_direct_copy != 0);
23265     if (__pyx_t_2) {
23266 
23267       /* "View.MemoryView":1320
23268  *         if direct_copy:
23269  *
23270  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
23271  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
23272  *             refcount_copying(&dst, dtype_is_object, ndim, True)
23273  */
23274       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
23275 
23276       /* "View.MemoryView":1321
23277  *
23278  *             refcount_copying(&dst, dtype_is_object, ndim, False)
23279  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
23280  *             refcount_copying(&dst, dtype_is_object, ndim, True)
23281  *             free(tmpdata)
23282  */
23283       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
23284 
23285       /* "View.MemoryView":1322
23286  *             refcount_copying(&dst, dtype_is_object, ndim, False)
23287  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
23288  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
23289  *             free(tmpdata)
23290  *             return 0
23291  */
23292       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
23293 
23294       /* "View.MemoryView":1323
23295  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
23296  *             refcount_copying(&dst, dtype_is_object, ndim, True)
23297  *             free(tmpdata)             # <<<<<<<<<<<<<<
23298  *             return 0
23299  *
23300  */
23301       free(__pyx_v_tmpdata);
23302 
23303       /* "View.MemoryView":1324
23304  *             refcount_copying(&dst, dtype_is_object, ndim, True)
23305  *             free(tmpdata)
23306  *             return 0             # <<<<<<<<<<<<<<
23307  *
23308  *     if order == 'F' == get_best_order(&dst, ndim):
23309  */
23310       __pyx_r = 0;
23311       goto __pyx_L0;
23312 
23313       /* "View.MemoryView":1318
23314  *             direct_copy = slice_is_contig(dst, 'F', ndim)
23315  *
23316  *         if direct_copy:             # <<<<<<<<<<<<<<
23317  *
23318  *             refcount_copying(&dst, dtype_is_object, ndim, False)
23319  */
23320     }
23321 
23322     /* "View.MemoryView":1310
23323  *         src = tmp
23324  *
23325  *     if not broadcasting:             # <<<<<<<<<<<<<<
23326  *
23327  *
23328  */
23329   }
23330 
23331   /* "View.MemoryView":1326
23332  *             return 0
23333  *
23334  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
23335  *
23336  *
23337  */
23338   __pyx_t_2 = (__pyx_v_order == 'F');
23339   if (__pyx_t_2) {
23340     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
23341   }
23342   __pyx_t_8 = (__pyx_t_2 != 0);
23343   if (__pyx_t_8) {
23344 
23345     /* "View.MemoryView":1329
23346  *
23347  *
23348  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
23349  *         transpose_memslice(&dst)
23350  *
23351  */
23352     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
23353 
23354     /* "View.MemoryView":1330
23355  *
23356  *         transpose_memslice(&src)
23357  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
23358  *
23359  *     refcount_copying(&dst, dtype_is_object, ndim, False)
23360  */
23361     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
23362 
23363     /* "View.MemoryView":1326
23364  *             return 0
23365  *
23366  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
23367  *
23368  *
23369  */
23370   }
23371 
23372   /* "View.MemoryView":1332
23373  *         transpose_memslice(&dst)
23374  *
23375  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
23376  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
23377  *     refcount_copying(&dst, dtype_is_object, ndim, True)
23378  */
23379   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
23380 
23381   /* "View.MemoryView":1333
23382  *
23383  *     refcount_copying(&dst, dtype_is_object, ndim, False)
23384  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
23385  *     refcount_copying(&dst, dtype_is_object, ndim, True)
23386  *
23387  */
23388   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
23389 
23390   /* "View.MemoryView":1334
23391  *     refcount_copying(&dst, dtype_is_object, ndim, False)
23392  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
23393  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
23394  *
23395  *     free(tmpdata)
23396  */
23397   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
23398 
23399   /* "View.MemoryView":1336
23400  *     refcount_copying(&dst, dtype_is_object, ndim, True)
23401  *
23402  *     free(tmpdata)             # <<<<<<<<<<<<<<
23403  *     return 0
23404  *
23405  */
23406   free(__pyx_v_tmpdata);
23407 
23408   /* "View.MemoryView":1337
23409  *
23410  *     free(tmpdata)
23411  *     return 0             # <<<<<<<<<<<<<<
23412  *
23413  * @cname('__pyx_memoryview_broadcast_leading')
23414  */
23415   __pyx_r = 0;
23416   goto __pyx_L0;
23417 
23418   /* "View.MemoryView":1268
23419  *
23420  * @cname('__pyx_memoryview_copy_contents')
23421  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
23422  *                                   __Pyx_memviewslice dst,
23423  *                                   int src_ndim, int dst_ndim,
23424  */
23425 
23426   /* function exit code */
23427   __pyx_L1_error:;
23428   {
23429     #ifdef WITH_THREAD
23430     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23431     #endif
23432     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
23433     #ifdef WITH_THREAD
23434     __Pyx_PyGILState_Release(__pyx_gilstate_save);
23435     #endif
23436   }
23437   __pyx_r = -1;
23438   __pyx_L0:;
23439   return __pyx_r;
23440 }
23441 
23442 /* "View.MemoryView":1340
23443  *
23444  * @cname('__pyx_memoryview_broadcast_leading')
23445  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
23446  *                             int ndim,
23447  *                             int ndim_other) nogil:
23448  */
23449 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)23450 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
23451   int __pyx_v_i;
23452   int __pyx_v_offset;
23453   int __pyx_t_1;
23454   int __pyx_t_2;
23455   int __pyx_t_3;
23456 
23457   /* "View.MemoryView":1344
23458  *                             int ndim_other) nogil:
23459  *     cdef int i
23460  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
23461  *
23462  *     for i in range(ndim - 1, -1, -1):
23463  */
23464   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
23465 
23466   /* "View.MemoryView":1346
23467  *     cdef int offset = ndim_other - ndim
23468  *
23469  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
23470  *         mslice.shape[i + offset] = mslice.shape[i]
23471  *         mslice.strides[i + offset] = mslice.strides[i]
23472  */
23473   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
23474     __pyx_v_i = __pyx_t_1;
23475 
23476     /* "View.MemoryView":1347
23477  *
23478  *     for i in range(ndim - 1, -1, -1):
23479  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
23480  *         mslice.strides[i + offset] = mslice.strides[i]
23481  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
23482  */
23483     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
23484 
23485     /* "View.MemoryView":1348
23486  *     for i in range(ndim - 1, -1, -1):
23487  *         mslice.shape[i + offset] = mslice.shape[i]
23488  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
23489  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
23490  *
23491  */
23492     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
23493 
23494     /* "View.MemoryView":1349
23495  *         mslice.shape[i + offset] = mslice.shape[i]
23496  *         mslice.strides[i + offset] = mslice.strides[i]
23497  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
23498  *
23499  *     for i in range(offset):
23500  */
23501     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
23502   }
23503 
23504   /* "View.MemoryView":1351
23505  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
23506  *
23507  *     for i in range(offset):             # <<<<<<<<<<<<<<
23508  *         mslice.shape[i] = 1
23509  *         mslice.strides[i] = mslice.strides[0]
23510  */
23511   __pyx_t_1 = __pyx_v_offset;
23512   __pyx_t_2 = __pyx_t_1;
23513   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23514     __pyx_v_i = __pyx_t_3;
23515 
23516     /* "View.MemoryView":1352
23517  *
23518  *     for i in range(offset):
23519  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
23520  *         mslice.strides[i] = mslice.strides[0]
23521  *         mslice.suboffsets[i] = -1
23522  */
23523     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
23524 
23525     /* "View.MemoryView":1353
23526  *     for i in range(offset):
23527  *         mslice.shape[i] = 1
23528  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
23529  *         mslice.suboffsets[i] = -1
23530  *
23531  */
23532     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
23533 
23534     /* "View.MemoryView":1354
23535  *         mslice.shape[i] = 1
23536  *         mslice.strides[i] = mslice.strides[0]
23537  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
23538  *
23539  *
23540  */
23541     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
23542   }
23543 
23544   /* "View.MemoryView":1340
23545  *
23546  * @cname('__pyx_memoryview_broadcast_leading')
23547  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
23548  *                             int ndim,
23549  *                             int ndim_other) nogil:
23550  */
23551 
23552   /* function exit code */
23553 }
23554 
23555 /* "View.MemoryView":1362
23556  *
23557  * @cname('__pyx_memoryview_refcount_copying')
23558  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
23559  *                            int ndim, bint inc) nogil:
23560  *
23561  */
23562 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)23563 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
23564   int __pyx_t_1;
23565 
23566   /* "View.MemoryView":1366
23567  *
23568  *
23569  *     if dtype_is_object:             # <<<<<<<<<<<<<<
23570  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
23571  *                                            dst.strides, ndim, inc)
23572  */
23573   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
23574   if (__pyx_t_1) {
23575 
23576     /* "View.MemoryView":1367
23577  *
23578  *     if dtype_is_object:
23579  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
23580  *                                            dst.strides, ndim, inc)
23581  *
23582  */
23583     __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
23584 
23585     /* "View.MemoryView":1366
23586  *
23587  *
23588  *     if dtype_is_object:             # <<<<<<<<<<<<<<
23589  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
23590  *                                            dst.strides, ndim, inc)
23591  */
23592   }
23593 
23594   /* "View.MemoryView":1362
23595  *
23596  * @cname('__pyx_memoryview_refcount_copying')
23597  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
23598  *                            int ndim, bint inc) nogil:
23599  *
23600  */
23601 
23602   /* function exit code */
23603 }
23604 
23605 /* "View.MemoryView":1371
23606  *
23607  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
23608  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
23609  *                                              Py_ssize_t *strides, int ndim,
23610  *                                              bint inc) with gil:
23611  */
23612 
__pyx_memoryview_refcount_objects_in_slice_with_gil(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,int __pyx_v_inc)23613 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
23614   __Pyx_RefNannyDeclarations
23615   #ifdef WITH_THREAD
23616   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23617   #endif
23618   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
23619 
23620   /* "View.MemoryView":1374
23621  *                                              Py_ssize_t *strides, int ndim,
23622  *                                              bint inc) with gil:
23623  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
23624  *
23625  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23626  */
23627   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
23628 
23629   /* "View.MemoryView":1371
23630  *
23631  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
23632  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
23633  *                                              Py_ssize_t *strides, int ndim,
23634  *                                              bint inc) with gil:
23635  */
23636 
23637   /* function exit code */
23638   __Pyx_RefNannyFinishContext();
23639   #ifdef WITH_THREAD
23640   __Pyx_PyGILState_Release(__pyx_gilstate_save);
23641   #endif
23642 }
23643 
23644 /* "View.MemoryView":1377
23645  *
23646  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23647  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
23648  *                                     Py_ssize_t *strides, int ndim, bint inc):
23649  *     cdef Py_ssize_t i
23650  */
23651 
__pyx_memoryview_refcount_objects_in_slice(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,int __pyx_v_inc)23652 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
23653   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
23654   __Pyx_RefNannyDeclarations
23655   Py_ssize_t __pyx_t_1;
23656   Py_ssize_t __pyx_t_2;
23657   Py_ssize_t __pyx_t_3;
23658   int __pyx_t_4;
23659   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
23660 
23661   /* "View.MemoryView":1381
23662  *     cdef Py_ssize_t i
23663  *
23664  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
23665  *         if ndim == 1:
23666  *             if inc:
23667  */
23668   __pyx_t_1 = (__pyx_v_shape[0]);
23669   __pyx_t_2 = __pyx_t_1;
23670   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23671     __pyx_v_i = __pyx_t_3;
23672 
23673     /* "View.MemoryView":1382
23674  *
23675  *     for i in range(shape[0]):
23676  *         if ndim == 1:             # <<<<<<<<<<<<<<
23677  *             if inc:
23678  *                 Py_INCREF((<PyObject **> data)[0])
23679  */
23680     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
23681     if (__pyx_t_4) {
23682 
23683       /* "View.MemoryView":1383
23684  *     for i in range(shape[0]):
23685  *         if ndim == 1:
23686  *             if inc:             # <<<<<<<<<<<<<<
23687  *                 Py_INCREF((<PyObject **> data)[0])
23688  *             else:
23689  */
23690       __pyx_t_4 = (__pyx_v_inc != 0);
23691       if (__pyx_t_4) {
23692 
23693         /* "View.MemoryView":1384
23694  *         if ndim == 1:
23695  *             if inc:
23696  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
23697  *             else:
23698  *                 Py_DECREF((<PyObject **> data)[0])
23699  */
23700         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
23701 
23702         /* "View.MemoryView":1383
23703  *     for i in range(shape[0]):
23704  *         if ndim == 1:
23705  *             if inc:             # <<<<<<<<<<<<<<
23706  *                 Py_INCREF((<PyObject **> data)[0])
23707  *             else:
23708  */
23709         goto __pyx_L6;
23710       }
23711 
23712       /* "View.MemoryView":1386
23713  *                 Py_INCREF((<PyObject **> data)[0])
23714  *             else:
23715  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
23716  *         else:
23717  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
23718  */
23719       /*else*/ {
23720         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
23721       }
23722       __pyx_L6:;
23723 
23724       /* "View.MemoryView":1382
23725  *
23726  *     for i in range(shape[0]):
23727  *         if ndim == 1:             # <<<<<<<<<<<<<<
23728  *             if inc:
23729  *                 Py_INCREF((<PyObject **> data)[0])
23730  */
23731       goto __pyx_L5;
23732     }
23733 
23734     /* "View.MemoryView":1388
23735  *                 Py_DECREF((<PyObject **> data)[0])
23736  *         else:
23737  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
23738  *                                       ndim - 1, inc)
23739  *
23740  */
23741     /*else*/ {
23742 
23743       /* "View.MemoryView":1389
23744  *         else:
23745  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
23746  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
23747  *
23748  *         data += strides[0]
23749  */
23750       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
23751     }
23752     __pyx_L5:;
23753 
23754     /* "View.MemoryView":1391
23755  *                                       ndim - 1, inc)
23756  *
23757  *         data += strides[0]             # <<<<<<<<<<<<<<
23758  *
23759  *
23760  */
23761     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
23762   }
23763 
23764   /* "View.MemoryView":1377
23765  *
23766  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23767  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
23768  *                                     Py_ssize_t *strides, int ndim, bint inc):
23769  *     cdef Py_ssize_t i
23770  */
23771 
23772   /* function exit code */
23773   __Pyx_RefNannyFinishContext();
23774 }
23775 
23776 /* "View.MemoryView":1397
23777  *
23778  * @cname('__pyx_memoryview_slice_assign_scalar')
23779  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
23780  *                               size_t itemsize, void *item,
23781  *                               bint dtype_is_object) nogil:
23782  */
23783 
__pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize,void * __pyx_v_item,int __pyx_v_dtype_is_object)23784 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
23785 
23786   /* "View.MemoryView":1400
23787  *                               size_t itemsize, void *item,
23788  *                               bint dtype_is_object) nogil:
23789  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
23790  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
23791  *                          itemsize, item)
23792  */
23793   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
23794 
23795   /* "View.MemoryView":1401
23796  *                               bint dtype_is_object) nogil:
23797  *     refcount_copying(dst, dtype_is_object, ndim, False)
23798  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
23799  *                          itemsize, item)
23800  *     refcount_copying(dst, dtype_is_object, ndim, True)
23801  */
23802   __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
23803 
23804   /* "View.MemoryView":1403
23805  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
23806  *                          itemsize, item)
23807  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
23808  *
23809  *
23810  */
23811   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
23812 
23813   /* "View.MemoryView":1397
23814  *
23815  * @cname('__pyx_memoryview_slice_assign_scalar')
23816  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
23817  *                               size_t itemsize, void *item,
23818  *                               bint dtype_is_object) nogil:
23819  */
23820 
23821   /* function exit code */
23822 }
23823 
23824 /* "View.MemoryView":1407
23825  *
23826  * @cname('__pyx_memoryview__slice_assign_scalar')
23827  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
23828  *                               Py_ssize_t *strides, int ndim,
23829  *                               size_t itemsize, void *item) nogil:
23830  */
23831 
__pyx_memoryview__slice_assign_scalar(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,size_t __pyx_v_itemsize,void * __pyx_v_item)23832 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
23833   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
23834   Py_ssize_t __pyx_v_stride;
23835   Py_ssize_t __pyx_v_extent;
23836   int __pyx_t_1;
23837   Py_ssize_t __pyx_t_2;
23838   Py_ssize_t __pyx_t_3;
23839   Py_ssize_t __pyx_t_4;
23840 
23841   /* "View.MemoryView":1411
23842  *                               size_t itemsize, void *item) nogil:
23843  *     cdef Py_ssize_t i
23844  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
23845  *     cdef Py_ssize_t extent = shape[0]
23846  *
23847  */
23848   __pyx_v_stride = (__pyx_v_strides[0]);
23849 
23850   /* "View.MemoryView":1412
23851  *     cdef Py_ssize_t i
23852  *     cdef Py_ssize_t stride = strides[0]
23853  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
23854  *
23855  *     if ndim == 1:
23856  */
23857   __pyx_v_extent = (__pyx_v_shape[0]);
23858 
23859   /* "View.MemoryView":1414
23860  *     cdef Py_ssize_t extent = shape[0]
23861  *
23862  *     if ndim == 1:             # <<<<<<<<<<<<<<
23863  *         for i in range(extent):
23864  *             memcpy(data, item, itemsize)
23865  */
23866   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
23867   if (__pyx_t_1) {
23868 
23869     /* "View.MemoryView":1415
23870  *
23871  *     if ndim == 1:
23872  *         for i in range(extent):             # <<<<<<<<<<<<<<
23873  *             memcpy(data, item, itemsize)
23874  *             data += stride
23875  */
23876     __pyx_t_2 = __pyx_v_extent;
23877     __pyx_t_3 = __pyx_t_2;
23878     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23879       __pyx_v_i = __pyx_t_4;
23880 
23881       /* "View.MemoryView":1416
23882  *     if ndim == 1:
23883  *         for i in range(extent):
23884  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
23885  *             data += stride
23886  *     else:
23887  */
23888       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
23889 
23890       /* "View.MemoryView":1417
23891  *         for i in range(extent):
23892  *             memcpy(data, item, itemsize)
23893  *             data += stride             # <<<<<<<<<<<<<<
23894  *     else:
23895  *         for i in range(extent):
23896  */
23897       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
23898     }
23899 
23900     /* "View.MemoryView":1414
23901  *     cdef Py_ssize_t extent = shape[0]
23902  *
23903  *     if ndim == 1:             # <<<<<<<<<<<<<<
23904  *         for i in range(extent):
23905  *             memcpy(data, item, itemsize)
23906  */
23907     goto __pyx_L3;
23908   }
23909 
23910   /* "View.MemoryView":1419
23911  *             data += stride
23912  *     else:
23913  *         for i in range(extent):             # <<<<<<<<<<<<<<
23914  *             _slice_assign_scalar(data, shape + 1, strides + 1,
23915  *                                 ndim - 1, itemsize, item)
23916  */
23917   /*else*/ {
23918     __pyx_t_2 = __pyx_v_extent;
23919     __pyx_t_3 = __pyx_t_2;
23920     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23921       __pyx_v_i = __pyx_t_4;
23922 
23923       /* "View.MemoryView":1420
23924  *     else:
23925  *         for i in range(extent):
23926  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
23927  *                                 ndim - 1, itemsize, item)
23928  *             data += stride
23929  */
23930       __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
23931 
23932       /* "View.MemoryView":1422
23933  *             _slice_assign_scalar(data, shape + 1, strides + 1,
23934  *                                 ndim - 1, itemsize, item)
23935  *             data += stride             # <<<<<<<<<<<<<<
23936  *
23937  *
23938  */
23939       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
23940     }
23941   }
23942   __pyx_L3:;
23943 
23944   /* "View.MemoryView":1407
23945  *
23946  * @cname('__pyx_memoryview__slice_assign_scalar')
23947  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
23948  *                               Py_ssize_t *strides, int ndim,
23949  *                               size_t itemsize, void *item) nogil:
23950  */
23951 
23952   /* function exit code */
23953 }
23954 
23955 /* "(tree fragment)":1
23956  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
23957  *     cdef object __pyx_PickleError
23958  *     cdef object __pyx_result
23959  */
23960 
23961 /* Python wrapper */
23962 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23963 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)23964 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23965   PyObject *__pyx_v___pyx_type = 0;
23966   long __pyx_v___pyx_checksum;
23967   PyObject *__pyx_v___pyx_state = 0;
23968   int __pyx_lineno = 0;
23969   const char *__pyx_filename = NULL;
23970   int __pyx_clineno = 0;
23971   PyObject *__pyx_r = 0;
23972   __Pyx_RefNannyDeclarations
23973   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
23974   {
23975     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
23976     PyObject* values[3] = {0,0,0};
23977     if (unlikely(__pyx_kwds)) {
23978       Py_ssize_t kw_args;
23979       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23980       switch (pos_args) {
23981         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23982         CYTHON_FALLTHROUGH;
23983         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23984         CYTHON_FALLTHROUGH;
23985         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23986         CYTHON_FALLTHROUGH;
23987         case  0: break;
23988         default: goto __pyx_L5_argtuple_error;
23989       }
23990       kw_args = PyDict_Size(__pyx_kwds);
23991       switch (pos_args) {
23992         case  0:
23993         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
23994         else goto __pyx_L5_argtuple_error;
23995         CYTHON_FALLTHROUGH;
23996         case  1:
23997         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
23998         else {
23999           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
24000         }
24001         CYTHON_FALLTHROUGH;
24002         case  2:
24003         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
24004         else {
24005           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
24006         }
24007       }
24008       if (unlikely(kw_args > 0)) {
24009         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
24010       }
24011     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
24012       goto __pyx_L5_argtuple_error;
24013     } else {
24014       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24015       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24016       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
24017     }
24018     __pyx_v___pyx_type = values[0];
24019     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
24020     __pyx_v___pyx_state = values[2];
24021   }
24022   goto __pyx_L4_argument_unpacking_done;
24023   __pyx_L5_argtuple_error:;
24024   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
24025   __pyx_L3_error:;
24026   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
24027   __Pyx_RefNannyFinishContext();
24028   return NULL;
24029   __pyx_L4_argument_unpacking_done:;
24030   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
24031 
24032   /* function exit code */
24033   __Pyx_RefNannyFinishContext();
24034   return __pyx_r;
24035 }
24036 
__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)24037 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
24038   PyObject *__pyx_v___pyx_PickleError = 0;
24039   PyObject *__pyx_v___pyx_result = 0;
24040   PyObject *__pyx_r = NULL;
24041   __Pyx_RefNannyDeclarations
24042   int __pyx_t_1;
24043   PyObject *__pyx_t_2 = NULL;
24044   PyObject *__pyx_t_3 = NULL;
24045   PyObject *__pyx_t_4 = NULL;
24046   PyObject *__pyx_t_5 = NULL;
24047   int __pyx_t_6;
24048   int __pyx_lineno = 0;
24049   const char *__pyx_filename = NULL;
24050   int __pyx_clineno = 0;
24051   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
24052 
24053   /* "(tree fragment)":4
24054  *     cdef object __pyx_PickleError
24055  *     cdef object __pyx_result
24056  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
24057  *         from pickle import PickleError as __pyx_PickleError
24058  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
24059  */
24060   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
24061   if (__pyx_t_1) {
24062 
24063     /* "(tree fragment)":5
24064  *     cdef object __pyx_result
24065  *     if __pyx_checksum != 0xb068931:
24066  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
24067  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
24068  *     __pyx_result = Enum.__new__(__pyx_type)
24069  */
24070     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
24071     __Pyx_GOTREF(__pyx_t_2);
24072     __Pyx_INCREF(__pyx_n_s_PickleError);
24073     __Pyx_GIVEREF(__pyx_n_s_PickleError);
24074     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
24075     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
24076     __Pyx_GOTREF(__pyx_t_3);
24077     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24078     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
24079     __Pyx_GOTREF(__pyx_t_2);
24080     __Pyx_INCREF(__pyx_t_2);
24081     __pyx_v___pyx_PickleError = __pyx_t_2;
24082     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24083     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24084 
24085     /* "(tree fragment)":6
24086  *     if __pyx_checksum != 0xb068931:
24087  *         from pickle import PickleError as __pyx_PickleError
24088  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
24089  *     __pyx_result = Enum.__new__(__pyx_type)
24090  *     if __pyx_state is not None:
24091  */
24092     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
24093     __Pyx_GOTREF(__pyx_t_2);
24094     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
24095     __Pyx_GOTREF(__pyx_t_4);
24096     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24097     __Pyx_INCREF(__pyx_v___pyx_PickleError);
24098     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
24099     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
24100       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
24101       if (likely(__pyx_t_5)) {
24102         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24103         __Pyx_INCREF(__pyx_t_5);
24104         __Pyx_INCREF(function);
24105         __Pyx_DECREF_SET(__pyx_t_2, function);
24106       }
24107     }
24108     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
24109     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24110     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24111     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
24112     __Pyx_GOTREF(__pyx_t_3);
24113     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24114     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
24115     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24116     __PYX_ERR(1, 6, __pyx_L1_error)
24117 
24118     /* "(tree fragment)":4
24119  *     cdef object __pyx_PickleError
24120  *     cdef object __pyx_result
24121  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
24122  *         from pickle import PickleError as __pyx_PickleError
24123  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
24124  */
24125   }
24126 
24127   /* "(tree fragment)":7
24128  *         from pickle import PickleError as __pyx_PickleError
24129  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
24130  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
24131  *     if __pyx_state is not None:
24132  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24133  */
24134   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
24135   __Pyx_GOTREF(__pyx_t_2);
24136   __pyx_t_4 = NULL;
24137   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
24138     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
24139     if (likely(__pyx_t_4)) {
24140       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
24141       __Pyx_INCREF(__pyx_t_4);
24142       __Pyx_INCREF(function);
24143       __Pyx_DECREF_SET(__pyx_t_2, function);
24144     }
24145   }
24146   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
24147   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24148   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
24149   __Pyx_GOTREF(__pyx_t_3);
24150   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24151   __pyx_v___pyx_result = __pyx_t_3;
24152   __pyx_t_3 = 0;
24153 
24154   /* "(tree fragment)":8
24155  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
24156  *     __pyx_result = Enum.__new__(__pyx_type)
24157  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
24158  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24159  *     return __pyx_result
24160  */
24161   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
24162   __pyx_t_6 = (__pyx_t_1 != 0);
24163   if (__pyx_t_6) {
24164 
24165     /* "(tree fragment)":9
24166  *     __pyx_result = Enum.__new__(__pyx_type)
24167  *     if __pyx_state is not None:
24168  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
24169  *     return __pyx_result
24170  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
24171  */
24172     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
24173     __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
24174     __Pyx_GOTREF(__pyx_t_3);
24175     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24176 
24177     /* "(tree fragment)":8
24178  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
24179  *     __pyx_result = Enum.__new__(__pyx_type)
24180  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
24181  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24182  *     return __pyx_result
24183  */
24184   }
24185 
24186   /* "(tree fragment)":10
24187  *     if __pyx_state is not None:
24188  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24189  *     return __pyx_result             # <<<<<<<<<<<<<<
24190  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
24191  *     __pyx_result.name = __pyx_state[0]
24192  */
24193   __Pyx_XDECREF(__pyx_r);
24194   __Pyx_INCREF(__pyx_v___pyx_result);
24195   __pyx_r = __pyx_v___pyx_result;
24196   goto __pyx_L0;
24197 
24198   /* "(tree fragment)":1
24199  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
24200  *     cdef object __pyx_PickleError
24201  *     cdef object __pyx_result
24202  */
24203 
24204   /* function exit code */
24205   __pyx_L1_error:;
24206   __Pyx_XDECREF(__pyx_t_2);
24207   __Pyx_XDECREF(__pyx_t_3);
24208   __Pyx_XDECREF(__pyx_t_4);
24209   __Pyx_XDECREF(__pyx_t_5);
24210   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
24211   __pyx_r = NULL;
24212   __pyx_L0:;
24213   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
24214   __Pyx_XDECREF(__pyx_v___pyx_result);
24215   __Pyx_XGIVEREF(__pyx_r);
24216   __Pyx_RefNannyFinishContext();
24217   return __pyx_r;
24218 }
24219 
24220 /* "(tree fragment)":11
24221  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24222  *     return __pyx_result
24223  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
24224  *     __pyx_result.name = __pyx_state[0]
24225  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24226  */
24227 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)24228 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
24229   PyObject *__pyx_r = NULL;
24230   __Pyx_RefNannyDeclarations
24231   PyObject *__pyx_t_1 = NULL;
24232   int __pyx_t_2;
24233   Py_ssize_t __pyx_t_3;
24234   int __pyx_t_4;
24235   int __pyx_t_5;
24236   PyObject *__pyx_t_6 = NULL;
24237   PyObject *__pyx_t_7 = NULL;
24238   PyObject *__pyx_t_8 = NULL;
24239   int __pyx_lineno = 0;
24240   const char *__pyx_filename = NULL;
24241   int __pyx_clineno = 0;
24242   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
24243 
24244   /* "(tree fragment)":12
24245  *     return __pyx_result
24246  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
24247  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
24248  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24249  *         __pyx_result.__dict__.update(__pyx_state[1])
24250  */
24251   if (unlikely(__pyx_v___pyx_state == Py_None)) {
24252     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24253     __PYX_ERR(1, 12, __pyx_L1_error)
24254   }
24255   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
24256   __Pyx_GOTREF(__pyx_t_1);
24257   __Pyx_GIVEREF(__pyx_t_1);
24258   __Pyx_GOTREF(__pyx_v___pyx_result->name);
24259   __Pyx_DECREF(__pyx_v___pyx_result->name);
24260   __pyx_v___pyx_result->name = __pyx_t_1;
24261   __pyx_t_1 = 0;
24262 
24263   /* "(tree fragment)":13
24264  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
24265  *     __pyx_result.name = __pyx_state[0]
24266  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
24267  *         __pyx_result.__dict__.update(__pyx_state[1])
24268  */
24269   if (unlikely(__pyx_v___pyx_state == Py_None)) {
24270     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
24271     __PYX_ERR(1, 13, __pyx_L1_error)
24272   }
24273   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
24274   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
24275   if (__pyx_t_4) {
24276   } else {
24277     __pyx_t_2 = __pyx_t_4;
24278     goto __pyx_L4_bool_binop_done;
24279   }
24280   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
24281   __pyx_t_5 = (__pyx_t_4 != 0);
24282   __pyx_t_2 = __pyx_t_5;
24283   __pyx_L4_bool_binop_done:;
24284   if (__pyx_t_2) {
24285 
24286     /* "(tree fragment)":14
24287  *     __pyx_result.name = __pyx_state[0]
24288  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24289  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
24290  */
24291     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
24292     __Pyx_GOTREF(__pyx_t_6);
24293     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
24294     __Pyx_GOTREF(__pyx_t_7);
24295     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24296     if (unlikely(__pyx_v___pyx_state == Py_None)) {
24297       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24298       __PYX_ERR(1, 14, __pyx_L1_error)
24299     }
24300     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
24301     __Pyx_GOTREF(__pyx_t_6);
24302     __pyx_t_8 = NULL;
24303     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
24304       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
24305       if (likely(__pyx_t_8)) {
24306         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
24307         __Pyx_INCREF(__pyx_t_8);
24308         __Pyx_INCREF(function);
24309         __Pyx_DECREF_SET(__pyx_t_7, function);
24310       }
24311     }
24312     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
24313     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
24314     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24315     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
24316     __Pyx_GOTREF(__pyx_t_1);
24317     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24318     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24319 
24320     /* "(tree fragment)":13
24321  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
24322  *     __pyx_result.name = __pyx_state[0]
24323  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
24324  *         __pyx_result.__dict__.update(__pyx_state[1])
24325  */
24326   }
24327 
24328   /* "(tree fragment)":11
24329  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24330  *     return __pyx_result
24331  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
24332  *     __pyx_result.name = __pyx_state[0]
24333  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24334  */
24335 
24336   /* function exit code */
24337   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24338   goto __pyx_L0;
24339   __pyx_L1_error:;
24340   __Pyx_XDECREF(__pyx_t_1);
24341   __Pyx_XDECREF(__pyx_t_6);
24342   __Pyx_XDECREF(__pyx_t_7);
24343   __Pyx_XDECREF(__pyx_t_8);
24344   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
24345   __pyx_r = 0;
24346   __pyx_L0:;
24347   __Pyx_XGIVEREF(__pyx_r);
24348   __Pyx_RefNannyFinishContext();
24349   return __pyx_r;
24350 }
24351 
__pyx_tp_new_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)24352 static PyObject *__pyx_tp_new_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
24353   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *p;
24354   PyObject *o;
24355   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
24356     o = (*t->tp_alloc)(t, 0);
24357   } else {
24358     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
24359   }
24360   if (unlikely(!o)) return 0;
24361   p = ((struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)o);
24362   p->_xi.data = NULL;
24363   p->_xi.memview = NULL;
24364   p->_p.data = NULL;
24365   p->_p.memview = NULL;
24366   p->_y.data = NULL;
24367   p->_y.memview = NULL;
24368   p->_l.data = NULL;
24369   p->_l.memview = NULL;
24370   p->_b.data = NULL;
24371   p->_b.memview = NULL;
24372   p->_s.data = NULL;
24373   p->_s.memview = NULL;
24374   p->_bounds.data = NULL;
24375   p->_bounds.memview = NULL;
24376   return o;
24377 }
24378 
__pyx_tp_dealloc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs(PyObject * o)24379 static void __pyx_tp_dealloc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs(PyObject *o) {
24380   struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *p = (struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs *)o;
24381   #if CYTHON_USE_TP_FINALIZE
24382   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
24383     if (PyObject_CallFinalizerFromDealloc(o)) return;
24384   }
24385   #endif
24386   __PYX_XDEC_MEMVIEW(&p->_xi, 1);
24387   __PYX_XDEC_MEMVIEW(&p->_p, 1);
24388   __PYX_XDEC_MEMVIEW(&p->_y, 1);
24389   __PYX_XDEC_MEMVIEW(&p->_l, 1);
24390   __PYX_XDEC_MEMVIEW(&p->_b, 1);
24391   __PYX_XDEC_MEMVIEW(&p->_s, 1);
24392   __PYX_XDEC_MEMVIEW(&p->_bounds, 1);
24393   (*Py_TYPE(o)->tp_free)(o);
24394 }
24395 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_xi(PyObject * o,CYTHON_UNUSED void * x)24396 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_xi(PyObject *o, CYTHON_UNUSED void *x) {
24397   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_1__get__(o);
24398 }
24399 
__pyx_setprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_xi(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)24400 static int __pyx_setprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_xi(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
24401   if (v) {
24402     return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_2xi_3__set__(o, v);
24403   }
24404   else {
24405     PyErr_SetString(PyExc_NotImplementedError, "__del__");
24406     return -1;
24407   }
24408 }
24409 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_p(PyObject * o,CYTHON_UNUSED void * x)24410 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_p(PyObject *o, CYTHON_UNUSED void *x) {
24411   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1p_1__get__(o);
24412 }
24413 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_bounds(PyObject * o,CYTHON_UNUSED void * x)24414 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_bounds(PyObject *o, CYTHON_UNUSED void *x) {
24415   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_6bounds_1__get__(o);
24416 }
24417 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_y(PyObject * o,CYTHON_UNUSED void * x)24418 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_y(PyObject *o, CYTHON_UNUSED void *x) {
24419   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1y_1__get__(o);
24420 }
24421 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_lvl(PyObject * o,CYTHON_UNUSED void * x)24422 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_lvl(PyObject *o, CYTHON_UNUSED void *x) {
24423   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3lvl_1__get__(o);
24424 }
24425 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_b(PyObject * o,CYTHON_UNUSED void * x)24426 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_b(PyObject *o, CYTHON_UNUSED void *x) {
24427   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1b_1__get__(o);
24428 }
24429 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_s(PyObject * o,CYTHON_UNUSED void * x)24430 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_s(PyObject *o, CYTHON_UNUSED void *x) {
24431   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1s_1__get__(o);
24432 }
24433 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_m(PyObject * o,CYTHON_UNUSED void * x)24434 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_m(PyObject *o, CYTHON_UNUSED void *x) {
24435   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1m_1__get__(o);
24436 }
24437 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_n(PyObject * o,CYTHON_UNUSED void * x)24438 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_n(PyObject *o, CYTHON_UNUSED void *x) {
24439   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1n_1__get__(o);
24440 }
24441 
__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_transform(PyObject * o,CYTHON_UNUSED void * x)24442 static PyObject *__pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_transform(PyObject *o, CYTHON_UNUSED void *x) {
24443   return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_1__get__(o);
24444 }
24445 
__pyx_setprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_transform(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)24446 static int __pyx_setprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_transform(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
24447   if (v) {
24448     return __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_9transform_3__set__(o, v);
24449   }
24450   else {
24451     PyErr_SetString(PyExc_NotImplementedError, "__del__");
24452     return -1;
24453   }
24454 }
24455 
24456 static PyMethodDef __pyx_methods_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs[] = {
24457   {"__reduce_cython__", (PyCFunction)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_3__reduce_cython__, METH_NOARGS, 0},
24458   {"__setstate_cython__", (PyCFunction)__pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_5__setstate_cython__, METH_O, 0},
24459   {0, 0, 0, 0}
24460 };
24461 
24462 static struct PyGetSetDef __pyx_getsets_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs[] = {
24463   {(char *)"xi", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_xi, __pyx_setprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_xi, (char *)0, 0},
24464   {(char *)"p", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_p, 0, (char *)0, 0},
24465   {(char *)"bounds", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_bounds, 0, (char *)0, 0},
24466   {(char *)"y", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_y, 0, (char *)0, 0},
24467   {(char *)"lvl", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_lvl, 0, (char *)0, 0},
24468   {(char *)"b", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_b, 0, (char *)0, 0},
24469   {(char *)"s", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_s, 0, (char *)0, 0},
24470   {(char *)"m", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_m, 0, (char *)0, 0},
24471   {(char *)"n", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_n, 0, (char *)0, 0},
24472   {(char *)"transform", __pyx_getprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_transform, __pyx_setprop_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_transform, (char *)0, 0},
24473   {0, 0, 0, 0, 0}
24474 };
24475 
24476 static PyTypeObject __pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs = {
24477   PyVarObject_HEAD_INIT(0, 0)
24478   "statsmodels.tsa.holtwinters._exponential_smoothers.HoltWintersArgs", /*tp_name*/
24479   sizeof(struct __pyx_obj_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs), /*tp_basicsize*/
24480   0, /*tp_itemsize*/
24481   __pyx_tp_dealloc_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, /*tp_dealloc*/
24482   #if PY_VERSION_HEX < 0x030800b4
24483   0, /*tp_print*/
24484   #endif
24485   #if PY_VERSION_HEX >= 0x030800b4
24486   0, /*tp_vectorcall_offset*/
24487   #endif
24488   0, /*tp_getattr*/
24489   0, /*tp_setattr*/
24490   #if PY_MAJOR_VERSION < 3
24491   0, /*tp_compare*/
24492   #endif
24493   #if PY_MAJOR_VERSION >= 3
24494   0, /*tp_as_async*/
24495   #endif
24496   0, /*tp_repr*/
24497   0, /*tp_as_number*/
24498   0, /*tp_as_sequence*/
24499   0, /*tp_as_mapping*/
24500   0, /*tp_hash*/
24501   0, /*tp_call*/
24502   0, /*tp_str*/
24503   0, /*tp_getattro*/
24504   0, /*tp_setattro*/
24505   0, /*tp_as_buffer*/
24506   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
24507   0, /*tp_doc*/
24508   0, /*tp_traverse*/
24509   0, /*tp_clear*/
24510   0, /*tp_richcompare*/
24511   0, /*tp_weaklistoffset*/
24512   0, /*tp_iter*/
24513   0, /*tp_iternext*/
24514   __pyx_methods_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, /*tp_methods*/
24515   0, /*tp_members*/
24516   __pyx_getsets_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, /*tp_getset*/
24517   0, /*tp_base*/
24518   0, /*tp_dict*/
24519   0, /*tp_descr_get*/
24520   0, /*tp_descr_set*/
24521   0, /*tp_dictoffset*/
24522   __pyx_pw_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15HoltWintersArgs_1__init__, /*tp_init*/
24523   0, /*tp_alloc*/
24524   __pyx_tp_new_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs, /*tp_new*/
24525   0, /*tp_free*/
24526   0, /*tp_is_gc*/
24527   0, /*tp_bases*/
24528   0, /*tp_mro*/
24529   0, /*tp_cache*/
24530   0, /*tp_subclasses*/
24531   0, /*tp_weaklist*/
24532   0, /*tp_del*/
24533   0, /*tp_version_tag*/
24534   #if PY_VERSION_HEX >= 0x030400a1
24535   0, /*tp_finalize*/
24536   #endif
24537   #if PY_VERSION_HEX >= 0x030800b1
24538   0, /*tp_vectorcall*/
24539   #endif
24540   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24541   0, /*tp_print*/
24542   #endif
24543 };
24544 static struct __pyx_vtabstruct_array __pyx_vtable_array;
24545 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)24546 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
24547   struct __pyx_array_obj *p;
24548   PyObject *o;
24549   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
24550     o = (*t->tp_alloc)(t, 0);
24551   } else {
24552     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
24553   }
24554   if (unlikely(!o)) return 0;
24555   p = ((struct __pyx_array_obj *)o);
24556   p->__pyx_vtab = __pyx_vtabptr_array;
24557   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
24558   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
24559   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
24560   return o;
24561   bad:
24562   Py_DECREF(o); o = 0;
24563   return NULL;
24564 }
24565 
__pyx_tp_dealloc_array(PyObject * o)24566 static void __pyx_tp_dealloc_array(PyObject *o) {
24567   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
24568   #if CYTHON_USE_TP_FINALIZE
24569   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
24570     if (PyObject_CallFinalizerFromDealloc(o)) return;
24571   }
24572   #endif
24573   {
24574     PyObject *etype, *eval, *etb;
24575     PyErr_Fetch(&etype, &eval, &etb);
24576     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
24577     __pyx_array___dealloc__(o);
24578     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
24579     PyErr_Restore(etype, eval, etb);
24580   }
24581   Py_CLEAR(p->mode);
24582   Py_CLEAR(p->_format);
24583   (*Py_TYPE(o)->tp_free)(o);
24584 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)24585 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
24586   PyObject *r;
24587   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
24588   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
24589   Py_DECREF(x);
24590   return r;
24591 }
24592 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)24593 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
24594   if (v) {
24595     return __pyx_array___setitem__(o, i, v);
24596   }
24597   else {
24598     PyErr_Format(PyExc_NotImplementedError,
24599       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
24600     return -1;
24601   }
24602 }
24603 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)24604 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
24605   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
24606   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24607     PyErr_Clear();
24608     v = __pyx_array___getattr__(o, n);
24609   }
24610   return v;
24611 }
24612 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)24613 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
24614   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
24615 }
24616 
24617 static PyMethodDef __pyx_methods_array[] = {
24618   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
24619   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
24620   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
24621   {0, 0, 0, 0}
24622 };
24623 
24624 static struct PyGetSetDef __pyx_getsets_array[] = {
24625   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
24626   {0, 0, 0, 0, 0}
24627 };
24628 
24629 static PySequenceMethods __pyx_tp_as_sequence_array = {
24630   __pyx_array___len__, /*sq_length*/
24631   0, /*sq_concat*/
24632   0, /*sq_repeat*/
24633   __pyx_sq_item_array, /*sq_item*/
24634   0, /*sq_slice*/
24635   0, /*sq_ass_item*/
24636   0, /*sq_ass_slice*/
24637   0, /*sq_contains*/
24638   0, /*sq_inplace_concat*/
24639   0, /*sq_inplace_repeat*/
24640 };
24641 
24642 static PyMappingMethods __pyx_tp_as_mapping_array = {
24643   __pyx_array___len__, /*mp_length*/
24644   __pyx_array___getitem__, /*mp_subscript*/
24645   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
24646 };
24647 
24648 static PyBufferProcs __pyx_tp_as_buffer_array = {
24649   #if PY_MAJOR_VERSION < 3
24650   0, /*bf_getreadbuffer*/
24651   #endif
24652   #if PY_MAJOR_VERSION < 3
24653   0, /*bf_getwritebuffer*/
24654   #endif
24655   #if PY_MAJOR_VERSION < 3
24656   0, /*bf_getsegcount*/
24657   #endif
24658   #if PY_MAJOR_VERSION < 3
24659   0, /*bf_getcharbuffer*/
24660   #endif
24661   __pyx_array_getbuffer, /*bf_getbuffer*/
24662   0, /*bf_releasebuffer*/
24663 };
24664 
24665 static PyTypeObject __pyx_type___pyx_array = {
24666   PyVarObject_HEAD_INIT(0, 0)
24667   "statsmodels.tsa.holtwinters._exponential_smoothers.array", /*tp_name*/
24668   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
24669   0, /*tp_itemsize*/
24670   __pyx_tp_dealloc_array, /*tp_dealloc*/
24671   #if PY_VERSION_HEX < 0x030800b4
24672   0, /*tp_print*/
24673   #endif
24674   #if PY_VERSION_HEX >= 0x030800b4
24675   0, /*tp_vectorcall_offset*/
24676   #endif
24677   0, /*tp_getattr*/
24678   0, /*tp_setattr*/
24679   #if PY_MAJOR_VERSION < 3
24680   0, /*tp_compare*/
24681   #endif
24682   #if PY_MAJOR_VERSION >= 3
24683   0, /*tp_as_async*/
24684   #endif
24685   0, /*tp_repr*/
24686   0, /*tp_as_number*/
24687   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
24688   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
24689   0, /*tp_hash*/
24690   0, /*tp_call*/
24691   0, /*tp_str*/
24692   __pyx_tp_getattro_array, /*tp_getattro*/
24693   0, /*tp_setattro*/
24694   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
24695   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
24696   0, /*tp_doc*/
24697   0, /*tp_traverse*/
24698   0, /*tp_clear*/
24699   0, /*tp_richcompare*/
24700   0, /*tp_weaklistoffset*/
24701   0, /*tp_iter*/
24702   0, /*tp_iternext*/
24703   __pyx_methods_array, /*tp_methods*/
24704   0, /*tp_members*/
24705   __pyx_getsets_array, /*tp_getset*/
24706   0, /*tp_base*/
24707   0, /*tp_dict*/
24708   0, /*tp_descr_get*/
24709   0, /*tp_descr_set*/
24710   0, /*tp_dictoffset*/
24711   0, /*tp_init*/
24712   0, /*tp_alloc*/
24713   __pyx_tp_new_array, /*tp_new*/
24714   0, /*tp_free*/
24715   0, /*tp_is_gc*/
24716   0, /*tp_bases*/
24717   0, /*tp_mro*/
24718   0, /*tp_cache*/
24719   0, /*tp_subclasses*/
24720   0, /*tp_weaklist*/
24721   0, /*tp_del*/
24722   0, /*tp_version_tag*/
24723   #if PY_VERSION_HEX >= 0x030400a1
24724   0, /*tp_finalize*/
24725   #endif
24726   #if PY_VERSION_HEX >= 0x030800b1
24727   0, /*tp_vectorcall*/
24728   #endif
24729   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24730   0, /*tp_print*/
24731   #endif
24732 };
24733 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)24734 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
24735   struct __pyx_MemviewEnum_obj *p;
24736   PyObject *o;
24737   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
24738     o = (*t->tp_alloc)(t, 0);
24739   } else {
24740     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
24741   }
24742   if (unlikely(!o)) return 0;
24743   p = ((struct __pyx_MemviewEnum_obj *)o);
24744   p->name = Py_None; Py_INCREF(Py_None);
24745   return o;
24746 }
24747 
__pyx_tp_dealloc_Enum(PyObject * o)24748 static void __pyx_tp_dealloc_Enum(PyObject *o) {
24749   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
24750   #if CYTHON_USE_TP_FINALIZE
24751   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
24752     if (PyObject_CallFinalizerFromDealloc(o)) return;
24753   }
24754   #endif
24755   PyObject_GC_UnTrack(o);
24756   Py_CLEAR(p->name);
24757   (*Py_TYPE(o)->tp_free)(o);
24758 }
24759 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)24760 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
24761   int e;
24762   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
24763   if (p->name) {
24764     e = (*v)(p->name, a); if (e) return e;
24765   }
24766   return 0;
24767 }
24768 
__pyx_tp_clear_Enum(PyObject * o)24769 static int __pyx_tp_clear_Enum(PyObject *o) {
24770   PyObject* tmp;
24771   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
24772   tmp = ((PyObject*)p->name);
24773   p->name = Py_None; Py_INCREF(Py_None);
24774   Py_XDECREF(tmp);
24775   return 0;
24776 }
24777 
24778 static PyMethodDef __pyx_methods_Enum[] = {
24779   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
24780   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
24781   {0, 0, 0, 0}
24782 };
24783 
24784 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
24785   PyVarObject_HEAD_INIT(0, 0)
24786   "statsmodels.tsa.holtwinters._exponential_smoothers.Enum", /*tp_name*/
24787   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
24788   0, /*tp_itemsize*/
24789   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
24790   #if PY_VERSION_HEX < 0x030800b4
24791   0, /*tp_print*/
24792   #endif
24793   #if PY_VERSION_HEX >= 0x030800b4
24794   0, /*tp_vectorcall_offset*/
24795   #endif
24796   0, /*tp_getattr*/
24797   0, /*tp_setattr*/
24798   #if PY_MAJOR_VERSION < 3
24799   0, /*tp_compare*/
24800   #endif
24801   #if PY_MAJOR_VERSION >= 3
24802   0, /*tp_as_async*/
24803   #endif
24804   __pyx_MemviewEnum___repr__, /*tp_repr*/
24805   0, /*tp_as_number*/
24806   0, /*tp_as_sequence*/
24807   0, /*tp_as_mapping*/
24808   0, /*tp_hash*/
24809   0, /*tp_call*/
24810   0, /*tp_str*/
24811   0, /*tp_getattro*/
24812   0, /*tp_setattro*/
24813   0, /*tp_as_buffer*/
24814   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
24815   0, /*tp_doc*/
24816   __pyx_tp_traverse_Enum, /*tp_traverse*/
24817   __pyx_tp_clear_Enum, /*tp_clear*/
24818   0, /*tp_richcompare*/
24819   0, /*tp_weaklistoffset*/
24820   0, /*tp_iter*/
24821   0, /*tp_iternext*/
24822   __pyx_methods_Enum, /*tp_methods*/
24823   0, /*tp_members*/
24824   0, /*tp_getset*/
24825   0, /*tp_base*/
24826   0, /*tp_dict*/
24827   0, /*tp_descr_get*/
24828   0, /*tp_descr_set*/
24829   0, /*tp_dictoffset*/
24830   __pyx_MemviewEnum___init__, /*tp_init*/
24831   0, /*tp_alloc*/
24832   __pyx_tp_new_Enum, /*tp_new*/
24833   0, /*tp_free*/
24834   0, /*tp_is_gc*/
24835   0, /*tp_bases*/
24836   0, /*tp_mro*/
24837   0, /*tp_cache*/
24838   0, /*tp_subclasses*/
24839   0, /*tp_weaklist*/
24840   0, /*tp_del*/
24841   0, /*tp_version_tag*/
24842   #if PY_VERSION_HEX >= 0x030400a1
24843   0, /*tp_finalize*/
24844   #endif
24845   #if PY_VERSION_HEX >= 0x030800b1
24846   0, /*tp_vectorcall*/
24847   #endif
24848   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24849   0, /*tp_print*/
24850   #endif
24851 };
24852 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
24853 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)24854 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
24855   struct __pyx_memoryview_obj *p;
24856   PyObject *o;
24857   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
24858     o = (*t->tp_alloc)(t, 0);
24859   } else {
24860     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
24861   }
24862   if (unlikely(!o)) return 0;
24863   p = ((struct __pyx_memoryview_obj *)o);
24864   p->__pyx_vtab = __pyx_vtabptr_memoryview;
24865   p->obj = Py_None; Py_INCREF(Py_None);
24866   p->_size = Py_None; Py_INCREF(Py_None);
24867   p->_array_interface = Py_None; Py_INCREF(Py_None);
24868   p->view.obj = NULL;
24869   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
24870   return o;
24871   bad:
24872   Py_DECREF(o); o = 0;
24873   return NULL;
24874 }
24875 
__pyx_tp_dealloc_memoryview(PyObject * o)24876 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
24877   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
24878   #if CYTHON_USE_TP_FINALIZE
24879   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
24880     if (PyObject_CallFinalizerFromDealloc(o)) return;
24881   }
24882   #endif
24883   PyObject_GC_UnTrack(o);
24884   {
24885     PyObject *etype, *eval, *etb;
24886     PyErr_Fetch(&etype, &eval, &etb);
24887     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
24888     __pyx_memoryview___dealloc__(o);
24889     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
24890     PyErr_Restore(etype, eval, etb);
24891   }
24892   Py_CLEAR(p->obj);
24893   Py_CLEAR(p->_size);
24894   Py_CLEAR(p->_array_interface);
24895   (*Py_TYPE(o)->tp_free)(o);
24896 }
24897 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)24898 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
24899   int e;
24900   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
24901   if (p->obj) {
24902     e = (*v)(p->obj, a); if (e) return e;
24903   }
24904   if (p->_size) {
24905     e = (*v)(p->_size, a); if (e) return e;
24906   }
24907   if (p->_array_interface) {
24908     e = (*v)(p->_array_interface, a); if (e) return e;
24909   }
24910   if (p->view.obj) {
24911     e = (*v)(p->view.obj, a); if (e) return e;
24912   }
24913   return 0;
24914 }
24915 
__pyx_tp_clear_memoryview(PyObject * o)24916 static int __pyx_tp_clear_memoryview(PyObject *o) {
24917   PyObject* tmp;
24918   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
24919   tmp = ((PyObject*)p->obj);
24920   p->obj = Py_None; Py_INCREF(Py_None);
24921   Py_XDECREF(tmp);
24922   tmp = ((PyObject*)p->_size);
24923   p->_size = Py_None; Py_INCREF(Py_None);
24924   Py_XDECREF(tmp);
24925   tmp = ((PyObject*)p->_array_interface);
24926   p->_array_interface = Py_None; Py_INCREF(Py_None);
24927   Py_XDECREF(tmp);
24928   Py_CLEAR(p->view.obj);
24929   return 0;
24930 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)24931 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
24932   PyObject *r;
24933   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
24934   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
24935   Py_DECREF(x);
24936   return r;
24937 }
24938 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)24939 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
24940   if (v) {
24941     return __pyx_memoryview___setitem__(o, i, v);
24942   }
24943   else {
24944     PyErr_Format(PyExc_NotImplementedError,
24945       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
24946     return -1;
24947   }
24948 }
24949 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)24950 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
24951   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
24952 }
24953 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)24954 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
24955   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
24956 }
24957 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)24958 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
24959   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
24960 }
24961 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)24962 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
24963   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
24964 }
24965 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)24966 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
24967   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
24968 }
24969 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)24970 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
24971   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
24972 }
24973 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)24974 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
24975   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
24976 }
24977 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)24978 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
24979   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
24980 }
24981 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)24982 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
24983   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
24984 }
24985 
24986 static PyMethodDef __pyx_methods_memoryview[] = {
24987   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
24988   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
24989   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
24990   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
24991   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
24992   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
24993   {0, 0, 0, 0}
24994 };
24995 
24996 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
24997   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
24998   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
24999   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
25000   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
25001   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
25002   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
25003   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
25004   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
25005   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
25006   {0, 0, 0, 0, 0}
25007 };
25008 
25009 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
25010   __pyx_memoryview___len__, /*sq_length*/
25011   0, /*sq_concat*/
25012   0, /*sq_repeat*/
25013   __pyx_sq_item_memoryview, /*sq_item*/
25014   0, /*sq_slice*/
25015   0, /*sq_ass_item*/
25016   0, /*sq_ass_slice*/
25017   0, /*sq_contains*/
25018   0, /*sq_inplace_concat*/
25019   0, /*sq_inplace_repeat*/
25020 };
25021 
25022 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
25023   __pyx_memoryview___len__, /*mp_length*/
25024   __pyx_memoryview___getitem__, /*mp_subscript*/
25025   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
25026 };
25027 
25028 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
25029   #if PY_MAJOR_VERSION < 3
25030   0, /*bf_getreadbuffer*/
25031   #endif
25032   #if PY_MAJOR_VERSION < 3
25033   0, /*bf_getwritebuffer*/
25034   #endif
25035   #if PY_MAJOR_VERSION < 3
25036   0, /*bf_getsegcount*/
25037   #endif
25038   #if PY_MAJOR_VERSION < 3
25039   0, /*bf_getcharbuffer*/
25040   #endif
25041   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
25042   0, /*bf_releasebuffer*/
25043 };
25044 
25045 static PyTypeObject __pyx_type___pyx_memoryview = {
25046   PyVarObject_HEAD_INIT(0, 0)
25047   "statsmodels.tsa.holtwinters._exponential_smoothers.memoryview", /*tp_name*/
25048   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
25049   0, /*tp_itemsize*/
25050   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
25051   #if PY_VERSION_HEX < 0x030800b4
25052   0, /*tp_print*/
25053   #endif
25054   #if PY_VERSION_HEX >= 0x030800b4
25055   0, /*tp_vectorcall_offset*/
25056   #endif
25057   0, /*tp_getattr*/
25058   0, /*tp_setattr*/
25059   #if PY_MAJOR_VERSION < 3
25060   0, /*tp_compare*/
25061   #endif
25062   #if PY_MAJOR_VERSION >= 3
25063   0, /*tp_as_async*/
25064   #endif
25065   __pyx_memoryview___repr__, /*tp_repr*/
25066   0, /*tp_as_number*/
25067   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
25068   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
25069   0, /*tp_hash*/
25070   0, /*tp_call*/
25071   __pyx_memoryview___str__, /*tp_str*/
25072   0, /*tp_getattro*/
25073   0, /*tp_setattro*/
25074   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
25075   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25076   0, /*tp_doc*/
25077   __pyx_tp_traverse_memoryview, /*tp_traverse*/
25078   __pyx_tp_clear_memoryview, /*tp_clear*/
25079   0, /*tp_richcompare*/
25080   0, /*tp_weaklistoffset*/
25081   0, /*tp_iter*/
25082   0, /*tp_iternext*/
25083   __pyx_methods_memoryview, /*tp_methods*/
25084   0, /*tp_members*/
25085   __pyx_getsets_memoryview, /*tp_getset*/
25086   0, /*tp_base*/
25087   0, /*tp_dict*/
25088   0, /*tp_descr_get*/
25089   0, /*tp_descr_set*/
25090   0, /*tp_dictoffset*/
25091   0, /*tp_init*/
25092   0, /*tp_alloc*/
25093   __pyx_tp_new_memoryview, /*tp_new*/
25094   0, /*tp_free*/
25095   0, /*tp_is_gc*/
25096   0, /*tp_bases*/
25097   0, /*tp_mro*/
25098   0, /*tp_cache*/
25099   0, /*tp_subclasses*/
25100   0, /*tp_weaklist*/
25101   0, /*tp_del*/
25102   0, /*tp_version_tag*/
25103   #if PY_VERSION_HEX >= 0x030400a1
25104   0, /*tp_finalize*/
25105   #endif
25106   #if PY_VERSION_HEX >= 0x030800b1
25107   0, /*tp_vectorcall*/
25108   #endif
25109   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25110   0, /*tp_print*/
25111   #endif
25112 };
25113 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
25114 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)25115 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
25116   struct __pyx_memoryviewslice_obj *p;
25117   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
25118   if (unlikely(!o)) return 0;
25119   p = ((struct __pyx_memoryviewslice_obj *)o);
25120   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
25121   p->from_object = Py_None; Py_INCREF(Py_None);
25122   p->from_slice.memview = NULL;
25123   return o;
25124 }
25125 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)25126 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
25127   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
25128   #if CYTHON_USE_TP_FINALIZE
25129   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
25130     if (PyObject_CallFinalizerFromDealloc(o)) return;
25131   }
25132   #endif
25133   PyObject_GC_UnTrack(o);
25134   {
25135     PyObject *etype, *eval, *etb;
25136     PyErr_Fetch(&etype, &eval, &etb);
25137     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
25138     __pyx_memoryviewslice___dealloc__(o);
25139     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
25140     PyErr_Restore(etype, eval, etb);
25141   }
25142   Py_CLEAR(p->from_object);
25143   PyObject_GC_Track(o);
25144   __pyx_tp_dealloc_memoryview(o);
25145 }
25146 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)25147 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
25148   int e;
25149   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
25150   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
25151   if (p->from_object) {
25152     e = (*v)(p->from_object, a); if (e) return e;
25153   }
25154   return 0;
25155 }
25156 
__pyx_tp_clear__memoryviewslice(PyObject * o)25157 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
25158   PyObject* tmp;
25159   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
25160   __pyx_tp_clear_memoryview(o);
25161   tmp = ((PyObject*)p->from_object);
25162   p->from_object = Py_None; Py_INCREF(Py_None);
25163   Py_XDECREF(tmp);
25164   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
25165   return 0;
25166 }
25167 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)25168 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
25169   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
25170 }
25171 
25172 static PyMethodDef __pyx_methods__memoryviewslice[] = {
25173   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
25174   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
25175   {0, 0, 0, 0}
25176 };
25177 
25178 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
25179   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
25180   {0, 0, 0, 0, 0}
25181 };
25182 
25183 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
25184   PyVarObject_HEAD_INIT(0, 0)
25185   "statsmodels.tsa.holtwinters._exponential_smoothers._memoryviewslice", /*tp_name*/
25186   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
25187   0, /*tp_itemsize*/
25188   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
25189   #if PY_VERSION_HEX < 0x030800b4
25190   0, /*tp_print*/
25191   #endif
25192   #if PY_VERSION_HEX >= 0x030800b4
25193   0, /*tp_vectorcall_offset*/
25194   #endif
25195   0, /*tp_getattr*/
25196   0, /*tp_setattr*/
25197   #if PY_MAJOR_VERSION < 3
25198   0, /*tp_compare*/
25199   #endif
25200   #if PY_MAJOR_VERSION >= 3
25201   0, /*tp_as_async*/
25202   #endif
25203   #if CYTHON_COMPILING_IN_PYPY
25204   __pyx_memoryview___repr__, /*tp_repr*/
25205   #else
25206   0, /*tp_repr*/
25207   #endif
25208   0, /*tp_as_number*/
25209   0, /*tp_as_sequence*/
25210   0, /*tp_as_mapping*/
25211   0, /*tp_hash*/
25212   0, /*tp_call*/
25213   #if CYTHON_COMPILING_IN_PYPY
25214   __pyx_memoryview___str__, /*tp_str*/
25215   #else
25216   0, /*tp_str*/
25217   #endif
25218   0, /*tp_getattro*/
25219   0, /*tp_setattro*/
25220   0, /*tp_as_buffer*/
25221   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25222   "Internal class for passing memoryview slices to Python", /*tp_doc*/
25223   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
25224   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
25225   0, /*tp_richcompare*/
25226   0, /*tp_weaklistoffset*/
25227   0, /*tp_iter*/
25228   0, /*tp_iternext*/
25229   __pyx_methods__memoryviewslice, /*tp_methods*/
25230   0, /*tp_members*/
25231   __pyx_getsets__memoryviewslice, /*tp_getset*/
25232   0, /*tp_base*/
25233   0, /*tp_dict*/
25234   0, /*tp_descr_get*/
25235   0, /*tp_descr_set*/
25236   0, /*tp_dictoffset*/
25237   0, /*tp_init*/
25238   0, /*tp_alloc*/
25239   __pyx_tp_new__memoryviewslice, /*tp_new*/
25240   0, /*tp_free*/
25241   0, /*tp_is_gc*/
25242   0, /*tp_bases*/
25243   0, /*tp_mro*/
25244   0, /*tp_cache*/
25245   0, /*tp_subclasses*/
25246   0, /*tp_weaklist*/
25247   0, /*tp_del*/
25248   0, /*tp_version_tag*/
25249   #if PY_VERSION_HEX >= 0x030400a1
25250   0, /*tp_finalize*/
25251   #endif
25252   #if PY_VERSION_HEX >= 0x030800b1
25253   0, /*tp_vectorcall*/
25254   #endif
25255   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25256   0, /*tp_print*/
25257   #endif
25258 };
25259 
25260 static PyMethodDef __pyx_methods[] = {
25261   {0, 0, 0, 0}
25262 };
25263 
25264 #if PY_MAJOR_VERSION >= 3
25265 #if CYTHON_PEP489_MULTI_PHASE_INIT
25266 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
25267 static int __pyx_pymod_exec__exponential_smoothers(PyObject* module); /*proto*/
25268 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
25269   {Py_mod_create, (void*)__pyx_pymod_create},
25270   {Py_mod_exec, (void*)__pyx_pymod_exec__exponential_smoothers},
25271   {0, NULL}
25272 };
25273 #endif
25274 
25275 static struct PyModuleDef __pyx_moduledef = {
25276     PyModuleDef_HEAD_INIT,
25277     "_exponential_smoothers",
25278     0, /* m_doc */
25279   #if CYTHON_PEP489_MULTI_PHASE_INIT
25280     0, /* m_size */
25281   #else
25282     -1, /* m_size */
25283   #endif
25284     __pyx_methods /* m_methods */,
25285   #if CYTHON_PEP489_MULTI_PHASE_INIT
25286     __pyx_moduledef_slots, /* m_slots */
25287   #else
25288     NULL, /* m_reload */
25289   #endif
25290     NULL, /* m_traverse */
25291     NULL, /* m_clear */
25292     NULL /* m_free */
25293 };
25294 #endif
25295 #ifndef CYTHON_SMALL_CODE
25296 #if defined(__clang__)
25297     #define CYTHON_SMALL_CODE
25298 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
25299     #define CYTHON_SMALL_CODE __attribute__((cold))
25300 #else
25301     #define CYTHON_SMALL_CODE
25302 #endif
25303 #endif
25304 
25305 static __Pyx_StringTabEntry __pyx_string_tab[] = {
25306   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
25307   {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
25308   {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
25309   {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
25310   {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
25311   {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
25312   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
25313   {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
25314   {&__pyx_n_s_HoltWintersArgs, __pyx_k_HoltWintersArgs, sizeof(__pyx_k_HoltWintersArgs), 0, 0, 1, 1},
25315   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
25316   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
25317   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb9, __pyx_k_Incompatible_checksums_s_vs_0xb9, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb9), 0, 0, 1, 0},
25318   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
25319   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
25320   {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
25321   {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
25322   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
25323   {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
25324   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
25325   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
25326   {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
25327   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
25328   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
25329   {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
25330   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
25331   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
25332   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
25333   {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
25334   {&__pyx_n_s_alphac, __pyx_k_alphac, sizeof(__pyx_k_alphac), 0, 0, 1, 1},
25335   {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
25336   {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
25337   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
25338   {&__pyx_n_s_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 0, 1, 1},
25339   {&__pyx_n_s_betac, __pyx_k_betac, sizeof(__pyx_k_betac), 0, 0, 1, 1},
25340   {&__pyx_n_s_bounds, __pyx_k_bounds, sizeof(__pyx_k_bounds), 0, 0, 1, 1},
25341   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
25342   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
25343   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
25344   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
25345   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
25346   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
25347   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
25348   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
25349   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
25350   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
25351   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
25352   {&__pyx_n_s_eps, __pyx_k_eps, sizeof(__pyx_k_eps), 0, 0, 1, 1},
25353   {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
25354   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
25355   {&__pyx_n_s_finfo, __pyx_k_finfo, sizeof(__pyx_k_finfo), 0, 0, 1, 1},
25356   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
25357   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
25358   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
25359   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
25360   {&__pyx_n_s_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 0, 1, 1},
25361   {&__pyx_n_s_gammac, __pyx_k_gammac, sizeof(__pyx_k_gammac), 0, 0, 1, 1},
25362   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
25363   {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
25364   {&__pyx_n_s_holt, __pyx_k_holt, sizeof(__pyx_k_holt), 0, 0, 1, 1},
25365   {&__pyx_n_s_holt_add_dam, __pyx_k_holt_add_dam, sizeof(__pyx_k_holt_add_dam), 0, 0, 1, 1},
25366   {&__pyx_n_s_holt_mul_dam, __pyx_k_holt_mul_dam, sizeof(__pyx_k_holt_mul_dam), 0, 0, 1, 1},
25367   {&__pyx_n_s_holt_win__add, __pyx_k_holt_win__add, sizeof(__pyx_k_holt_win__add), 0, 0, 1, 1},
25368   {&__pyx_n_s_holt_win__mul, __pyx_k_holt_win__mul, sizeof(__pyx_k_holt_win__mul), 0, 0, 1, 1},
25369   {&__pyx_n_s_holt_win_add_add_dam, __pyx_k_holt_win_add_add_dam, sizeof(__pyx_k_holt_win_add_add_dam), 0, 0, 1, 1},
25370   {&__pyx_n_s_holt_win_add_mul_dam, __pyx_k_holt_win_add_mul_dam, sizeof(__pyx_k_holt_win_add_mul_dam), 0, 0, 1, 1},
25371   {&__pyx_n_s_holt_win_mul_add_dam, __pyx_k_holt_win_mul_add_dam, sizeof(__pyx_k_holt_win_mul_add_dam), 0, 0, 1, 1},
25372   {&__pyx_n_s_holt_win_mul_mul_dam, __pyx_k_holt_win_mul_mul_dam, sizeof(__pyx_k_holt_win_mul_mul_dam), 0, 0, 1, 1},
25373   {&__pyx_n_s_hw_args, __pyx_k_hw_args, sizeof(__pyx_k_hw_args), 0, 0, 1, 1},
25374   {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
25375   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
25376   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
25377   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
25378   {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
25379   {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
25380   {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
25381   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
25382   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
25383   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
25384   {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
25385   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
25386   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
25387   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
25388   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
25389   {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
25390   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
25391   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
25392   {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
25393   {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
25394   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
25395   {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
25396   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
25397   {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1},
25398   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
25399   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
25400   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
25401   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
25402   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
25403   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
25404   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
25405   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
25406   {&__pyx_n_s_pyx_unpickle_HoltWintersArgs, __pyx_k_pyx_unpickle_HoltWintersArgs, sizeof(__pyx_k_pyx_unpickle_HoltWintersArgs), 0, 0, 1, 1},
25407   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
25408   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
25409   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
25410   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
25411   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
25412   {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
25413   {&__pyx_n_s_sel, __pyx_k_sel, sizeof(__pyx_k_sel), 0, 0, 1, 1},
25414   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
25415   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
25416   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
25417   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
25418   {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
25419   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
25420   {&__pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_k_statsmodels_tsa_holtwinters__exp, sizeof(__pyx_k_statsmodels_tsa_holtwinters__exp), 0, 0, 1, 0},
25421   {&__pyx_n_s_statsmodels_tsa_holtwinters__exp_2, __pyx_k_statsmodels_tsa_holtwinters__exp_2, sizeof(__pyx_k_statsmodels_tsa_holtwinters__exp_2), 0, 0, 1, 1},
25422   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
25423   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
25424   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
25425   {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
25426   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
25427   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
25428   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
25429   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
25430   {&__pyx_n_s_test_to_restricted, __pyx_k_test_to_restricted, sizeof(__pyx_k_test_to_restricted), 0, 0, 1, 1},
25431   {&__pyx_n_s_transform, __pyx_k_transform, sizeof(__pyx_k_transform), 0, 0, 1, 1},
25432   {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
25433   {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
25434   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
25435   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
25436   {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
25437   {&__pyx_n_s_xi, __pyx_k_xi, sizeof(__pyx_k_xi), 0, 0, 1, 1},
25438   {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
25439   {0, 0, 0, 0, 0, 0, 0}
25440 };
__Pyx_InitCachedBuiltins(void)25441 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
25442   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 143, __pyx_L1_error)
25443   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
25444   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
25445   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
25446   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
25447   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
25448   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
25449   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
25450   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
25451   return 0;
25452   __pyx_L1_error:;
25453   return -1;
25454 }
25455 
__Pyx_InitCachedConstants(void)25456 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
25457   __Pyx_RefNannyDeclarations
25458   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
25459 
25460   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":945
25461  *         __pyx_import_array()
25462  *     except Exception:
25463  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
25464  *
25465  * cdef inline int import_umath() except -1:
25466  */
25467   __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 945, __pyx_L1_error)
25468   __Pyx_GOTREF(__pyx_tuple_);
25469   __Pyx_GIVEREF(__pyx_tuple_);
25470 
25471   /* "../../Anaconda/lib/site-packages/numpy/__init__.pxd":951
25472  *         _import_umath()
25473  *     except Exception:
25474  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
25475  *
25476  * cdef inline int import_ufunc() except -1:
25477  */
25478   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 951, __pyx_L1_error)
25479   __Pyx_GOTREF(__pyx_tuple__2);
25480   __Pyx_GIVEREF(__pyx_tuple__2);
25481 
25482   /* "View.MemoryView":133
25483  *
25484  *         if not self.ndim:
25485  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
25486  *
25487  *         if itemsize <= 0:
25488  */
25489   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 133, __pyx_L1_error)
25490   __Pyx_GOTREF(__pyx_tuple__3);
25491   __Pyx_GIVEREF(__pyx_tuple__3);
25492 
25493   /* "View.MemoryView":136
25494  *
25495  *         if itemsize <= 0:
25496  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
25497  *
25498  *         if not isinstance(format, bytes):
25499  */
25500   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 136, __pyx_L1_error)
25501   __Pyx_GOTREF(__pyx_tuple__4);
25502   __Pyx_GIVEREF(__pyx_tuple__4);
25503 
25504   /* "View.MemoryView":148
25505  *
25506  *         if not self._shape:
25507  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
25508  *
25509  *
25510  */
25511   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 148, __pyx_L1_error)
25512   __Pyx_GOTREF(__pyx_tuple__5);
25513   __Pyx_GIVEREF(__pyx_tuple__5);
25514 
25515   /* "View.MemoryView":176
25516  *             self.data = <char *>malloc(self.len)
25517  *             if not self.data:
25518  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
25519  *
25520  *             if self.dtype_is_object:
25521  */
25522   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 176, __pyx_L1_error)
25523   __Pyx_GOTREF(__pyx_tuple__6);
25524   __Pyx_GIVEREF(__pyx_tuple__6);
25525 
25526   /* "View.MemoryView":192
25527  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
25528  *         if not (flags & bufmode):
25529  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
25530  *         info.buf = self.data
25531  *         info.len = self.len
25532  */
25533   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 192, __pyx_L1_error)
25534   __Pyx_GOTREF(__pyx_tuple__7);
25535   __Pyx_GIVEREF(__pyx_tuple__7);
25536 
25537   /* "(tree fragment)":2
25538  * def __reduce_cython__(self):
25539  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25540  * def __setstate_cython__(self, __pyx_state):
25541  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25542  */
25543   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error)
25544   __Pyx_GOTREF(__pyx_tuple__8);
25545   __Pyx_GIVEREF(__pyx_tuple__8);
25546 
25547   /* "(tree fragment)":4
25548  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25549  * def __setstate_cython__(self, __pyx_state):
25550  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25551  */
25552   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error)
25553   __Pyx_GOTREF(__pyx_tuple__9);
25554   __Pyx_GIVEREF(__pyx_tuple__9);
25555 
25556   /* "View.MemoryView":418
25557  *     def __setitem__(memoryview self, object index, object value):
25558  *         if self.view.readonly:
25559  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
25560  *
25561  *         have_slices, index = _unellipsify(index, self.view.ndim)
25562  */
25563   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 418, __pyx_L1_error)
25564   __Pyx_GOTREF(__pyx_tuple__10);
25565   __Pyx_GIVEREF(__pyx_tuple__10);
25566 
25567   /* "View.MemoryView":495
25568  *             result = struct.unpack(self.view.format, bytesitem)
25569  *         except struct.error:
25570  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
25571  *         else:
25572  *             if len(self.view.format) == 1:
25573  */
25574   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 495, __pyx_L1_error)
25575   __Pyx_GOTREF(__pyx_tuple__11);
25576   __Pyx_GIVEREF(__pyx_tuple__11);
25577 
25578   /* "View.MemoryView":520
25579  *     def __getbuffer__(self, Py_buffer *info, int flags):
25580  *         if flags & PyBUF_WRITABLE and self.view.readonly:
25581  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
25582  *
25583  *         if flags & PyBUF_ND:
25584  */
25585   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 520, __pyx_L1_error)
25586   __Pyx_GOTREF(__pyx_tuple__12);
25587   __Pyx_GIVEREF(__pyx_tuple__12);
25588 
25589   /* "View.MemoryView":570
25590  *         if self.view.strides == NULL:
25591  *
25592  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
25593  *
25594  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
25595  */
25596   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 570, __pyx_L1_error)
25597   __Pyx_GOTREF(__pyx_tuple__13);
25598   __Pyx_GIVEREF(__pyx_tuple__13);
25599 
25600   /* "View.MemoryView":577
25601  *     def suboffsets(self):
25602  *         if self.view.suboffsets == NULL:
25603  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
25604  *
25605  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
25606  */
25607   __pyx_tuple__14 = PyTuple_New(1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 577, __pyx_L1_error)
25608   __Pyx_GOTREF(__pyx_tuple__14);
25609   __Pyx_INCREF(__pyx_int_neg_1);
25610   __Pyx_GIVEREF(__pyx_int_neg_1);
25611   PyTuple_SET_ITEM(__pyx_tuple__14, 0, __pyx_int_neg_1);
25612   __Pyx_GIVEREF(__pyx_tuple__14);
25613 
25614   /* "(tree fragment)":2
25615  * def __reduce_cython__(self):
25616  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25617  * def __setstate_cython__(self, __pyx_state):
25618  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25619  */
25620   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
25621   __Pyx_GOTREF(__pyx_tuple__15);
25622   __Pyx_GIVEREF(__pyx_tuple__15);
25623 
25624   /* "(tree fragment)":4
25625  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25626  * def __setstate_cython__(self, __pyx_state):
25627  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25628  */
25629   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 4, __pyx_L1_error)
25630   __Pyx_GOTREF(__pyx_tuple__16);
25631   __Pyx_GIVEREF(__pyx_tuple__16);
25632 
25633   /* "View.MemoryView":682
25634  *         if item is Ellipsis:
25635  *             if not seen_ellipsis:
25636  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
25637  *                 seen_ellipsis = True
25638  *             else:
25639  */
25640   __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(1, 682, __pyx_L1_error)
25641   __Pyx_GOTREF(__pyx_slice__17);
25642   __Pyx_GIVEREF(__pyx_slice__17);
25643 
25644   /* "View.MemoryView":703
25645  *     for suboffset in suboffsets[:ndim]:
25646  *         if suboffset >= 0:
25647  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
25648  *
25649  *
25650  */
25651   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 703, __pyx_L1_error)
25652   __Pyx_GOTREF(__pyx_tuple__18);
25653   __Pyx_GIVEREF(__pyx_tuple__18);
25654 
25655   /* "(tree fragment)":2
25656  * def __reduce_cython__(self):
25657  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25658  * def __setstate_cython__(self, __pyx_state):
25659  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25660  */
25661   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
25662   __Pyx_GOTREF(__pyx_tuple__19);
25663   __Pyx_GIVEREF(__pyx_tuple__19);
25664 
25665   /* "(tree fragment)":4
25666  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25667  * def __setstate_cython__(self, __pyx_state):
25668  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25669  */
25670   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error)
25671   __Pyx_GOTREF(__pyx_tuple__20);
25672   __Pyx_GIVEREF(__pyx_tuple__20);
25673 
25674   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":127
25675  *     return a, b, g
25676  *
25677  * def _test_to_restricted(p, sel, bounds):             # <<<<<<<<<<<<<<
25678  *     """Testing harness"""
25679  *     return to_restricted(p, sel, bounds)
25680  */
25681   __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_p, __pyx_n_s_sel, __pyx_n_s_bounds); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 127, __pyx_L1_error)
25682   __Pyx_GOTREF(__pyx_tuple__21);
25683   __Pyx_GIVEREF(__pyx_tuple__21);
25684   __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 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_statsmodels_tsa_holtwinters__exp, __pyx_n_s_test_to_restricted, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 127, __pyx_L1_error)
25685 
25686   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":163
25687  *
25688  * # noinspection PyProtectedMember
25689  * def holt__(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25690  *     """
25691  *     Compute the sum of squared residuals for Simple Exponential Smoothing
25692  */
25693   __pyx_tuple__23 = PyTuple_Pack(11, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_phi, __pyx_n_s_betac, __pyx_n_s_alphac, __pyx_n_s_err, __pyx_n_s_l, __pyx_n_s_y, __pyx_n_s_i); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 163, __pyx_L1_error)
25694   __Pyx_GOTREF(__pyx_tuple__23);
25695   __Pyx_GIVEREF(__pyx_tuple__23);
25696   __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 163, __pyx_L1_error)
25697 
25698   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":188
25699  *
25700  * # noinspection PyProtectedMember
25701  * def holt_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25702  *     """
25703  *     Multiplicative and Multiplicative Damped
25704  */
25705   __pyx_tuple__25 = PyTuple_Pack(12, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_phi, __pyx_n_s_betac, __pyx_n_s_alphac, __pyx_n_s_err, __pyx_n_s_l, __pyx_n_s_b, __pyx_n_s_y, __pyx_n_s_i); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 188, __pyx_L1_error)
25706   __Pyx_GOTREF(__pyx_tuple__25);
25707   __Pyx_GIVEREF(__pyx_tuple__25);
25708   __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt_mul_dam, 188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 188, __pyx_L1_error)
25709 
25710   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":211
25711  *
25712  * # noinspection PyProtectedMember
25713  * def holt_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25714  *     """
25715  *     Additive and Additive Damped
25716  */
25717   __pyx_tuple__27 = PyTuple_Pack(12, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_phi, __pyx_n_s_betac, __pyx_n_s_alphac, __pyx_n_s_err, __pyx_n_s_l, __pyx_n_s_b, __pyx_n_s_y, __pyx_n_s_i); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 211, __pyx_L1_error)
25718   __Pyx_GOTREF(__pyx_tuple__27);
25719   __Pyx_GIVEREF(__pyx_tuple__27);
25720   __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt_add_dam, 211, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 211, __pyx_L1_error)
25721 
25722   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":272
25723  *
25724  * # noinspection PyProtectedMember
25725  * def holt_win_add_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25726  *     """
25727  *     Additive and Additive Damped with Additive Seasonal
25728  */
25729   __pyx_tuple__29 = PyTuple_Pack(16, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_gamma, __pyx_n_s_phi, __pyx_n_s_alphac, __pyx_n_s_betac, __pyx_n_s_gammac, __pyx_n_s_err, __pyx_n_s_l, __pyx_n_s_s, __pyx_n_s_b, __pyx_n_s_y, __pyx_n_s_i, __pyx_n_s_m); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 272, __pyx_L1_error)
25730   __Pyx_GOTREF(__pyx_tuple__29);
25731   __Pyx_GIVEREF(__pyx_tuple__29);
25732   __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt_win_add_add_dam, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 272, __pyx_L1_error)
25733 
25734   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":301
25735  *
25736  * # noinspection PyProtectedMember
25737  * def holt_win__add(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25738  *     """
25739  *     Additive Seasonal
25740  */
25741   __pyx_tuple__31 = PyTuple_Pack(15, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_gamma, __pyx_n_s_phi, __pyx_n_s_alphac, __pyx_n_s_betac, __pyx_n_s_gammac, __pyx_n_s_err, __pyx_n_s_y, __pyx_n_s_l, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_m); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 301, __pyx_L1_error)
25742   __Pyx_GOTREF(__pyx_tuple__31);
25743   __Pyx_GIVEREF(__pyx_tuple__31);
25744   __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt_win__add, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 301, __pyx_L1_error)
25745 
25746   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":327
25747  *
25748  * # noinspection PyProtectedMember
25749  * def holt_win__mul(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25750  *     """
25751  *     Multiplicative Seasonal
25752  */
25753   __pyx_tuple__33 = PyTuple_Pack(15, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_gamma, __pyx_n_s_phi, __pyx_n_s_alphac, __pyx_n_s_betac, __pyx_n_s_gammac, __pyx_n_s_err, __pyx_n_s_y, __pyx_n_s_l, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_m); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 327, __pyx_L1_error)
25754   __Pyx_GOTREF(__pyx_tuple__33);
25755   __Pyx_GIVEREF(__pyx_tuple__33);
25756   __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 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_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt_win__mul, 327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 327, __pyx_L1_error)
25757 
25758   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":352
25759  *
25760  * # noinspection PyProtectedMember
25761  * def holt_win_mul_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25762  *     """
25763  *     Multiplicative and Multiplicative Damped with Multiplicative Seasonal
25764  */
25765   __pyx_tuple__35 = PyTuple_Pack(16, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_gamma, __pyx_n_s_phi, __pyx_n_s_alphac, __pyx_n_s_betac, __pyx_n_s_gammac, __pyx_n_s_err, __pyx_n_s_y, __pyx_n_s_l, __pyx_n_s_b, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_m); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 352, __pyx_L1_error)
25766   __Pyx_GOTREF(__pyx_tuple__35);
25767   __Pyx_GIVEREF(__pyx_tuple__35);
25768   __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt_win_mul_mul_dam, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 352, __pyx_L1_error)
25769 
25770   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":383
25771  *
25772  * # noinspection PyProtectedMember
25773  * def holt_win_add_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25774  *     """
25775  *     Additive and Additive Damped with Multiplicative Seasonal
25776  */
25777   __pyx_tuple__37 = PyTuple_Pack(16, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_gamma, __pyx_n_s_phi, __pyx_n_s_alphac, __pyx_n_s_betac, __pyx_n_s_gammac, __pyx_n_s_err, __pyx_n_s_l, __pyx_n_s_s, __pyx_n_s_b, __pyx_n_s_y, __pyx_n_s_i, __pyx_n_s_m); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 383, __pyx_L1_error)
25778   __Pyx_GOTREF(__pyx_tuple__37);
25779   __Pyx_GIVEREF(__pyx_tuple__37);
25780   __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt_win_add_mul_dam, 383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 383, __pyx_L1_error)
25781 
25782   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":414
25783  *
25784  * # noinspection PyProtectedMember
25785  * def holt_win_mul_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
25786  *     """
25787  *     Multiplicative and Multiplicative Damped with Additive Seasonal
25788  */
25789   __pyx_tuple__39 = PyTuple_Pack(16, __pyx_n_s_x, __pyx_n_s_hw_args, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_gamma, __pyx_n_s_phi, __pyx_n_s_alphac, __pyx_n_s_betac, __pyx_n_s_gammac, __pyx_n_s_err, __pyx_n_s_l, __pyx_n_s_s, __pyx_n_s_b, __pyx_n_s_y, __pyx_n_s_i, __pyx_n_s_m); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 414, __pyx_L1_error)
25790   __Pyx_GOTREF(__pyx_tuple__39);
25791   __Pyx_GIVEREF(__pyx_tuple__39);
25792   __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_statsmodels_tsa_holtwinters__exp, __pyx_n_s_holt_win_mul_add_dam, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 414, __pyx_L1_error)
25793 
25794   /* "(tree fragment)":1
25795  * def __pyx_unpickle_HoltWintersArgs(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
25796  *     cdef object __pyx_PickleError
25797  *     cdef object __pyx_result
25798  */
25799   __pyx_tuple__41 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 1, __pyx_L1_error)
25800   __Pyx_GOTREF(__pyx_tuple__41);
25801   __Pyx_GIVEREF(__pyx_tuple__41);
25802   __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_HoltWintersArgs, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(1, 1, __pyx_L1_error)
25803 
25804   /* "View.MemoryView":286
25805  *         return self.name
25806  *
25807  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
25808  * cdef strided = Enum("<strided and direct>") # default
25809  * cdef indirect = Enum("<strided and indirect>")
25810  */
25811   __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 286, __pyx_L1_error)
25812   __Pyx_GOTREF(__pyx_tuple__43);
25813   __Pyx_GIVEREF(__pyx_tuple__43);
25814 
25815   /* "View.MemoryView":287
25816  *
25817  * cdef generic = Enum("<strided and direct or indirect>")
25818  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
25819  * cdef indirect = Enum("<strided and indirect>")
25820  *
25821  */
25822   __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 287, __pyx_L1_error)
25823   __Pyx_GOTREF(__pyx_tuple__44);
25824   __Pyx_GIVEREF(__pyx_tuple__44);
25825 
25826   /* "View.MemoryView":288
25827  * cdef generic = Enum("<strided and direct or indirect>")
25828  * cdef strided = Enum("<strided and direct>") # default
25829  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
25830  *
25831  *
25832  */
25833   __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 288, __pyx_L1_error)
25834   __Pyx_GOTREF(__pyx_tuple__45);
25835   __Pyx_GIVEREF(__pyx_tuple__45);
25836 
25837   /* "View.MemoryView":291
25838  *
25839  *
25840  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
25841  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
25842  *
25843  */
25844   __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 291, __pyx_L1_error)
25845   __Pyx_GOTREF(__pyx_tuple__46);
25846   __Pyx_GIVEREF(__pyx_tuple__46);
25847 
25848   /* "View.MemoryView":292
25849  *
25850  * cdef contiguous = Enum("<contiguous and direct>")
25851  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
25852  *
25853  *
25854  */
25855   __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 292, __pyx_L1_error)
25856   __Pyx_GOTREF(__pyx_tuple__47);
25857   __Pyx_GIVEREF(__pyx_tuple__47);
25858 
25859   /* "(tree fragment)":1
25860  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
25861  *     cdef object __pyx_PickleError
25862  *     cdef object __pyx_result
25863  */
25864   __pyx_tuple__48 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 1, __pyx_L1_error)
25865   __Pyx_GOTREF(__pyx_tuple__48);
25866   __Pyx_GIVEREF(__pyx_tuple__48);
25867   __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(1, 1, __pyx_L1_error)
25868   __Pyx_RefNannyFinishContext();
25869   return 0;
25870   __pyx_L1_error:;
25871   __Pyx_RefNannyFinishContext();
25872   return -1;
25873 }
25874 
__Pyx_InitGlobals(void)25875 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
25876   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
25877   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
25878   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25879   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
25880   __pyx_int_194727133 = PyInt_FromLong(194727133L); if (unlikely(!__pyx_int_194727133)) __PYX_ERR(0, 1, __pyx_L1_error)
25881   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25882   return 0;
25883   __pyx_L1_error:;
25884   return -1;
25885 }
25886 
25887 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
25888 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
25889 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
25890 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
25891 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
25892 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
25893 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
25894 
__Pyx_modinit_global_init_code(void)25895 static int __Pyx_modinit_global_init_code(void) {
25896   __Pyx_RefNannyDeclarations
25897   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
25898   /*--- Global init code ---*/
25899   generic = Py_None; Py_INCREF(Py_None);
25900   strided = Py_None; Py_INCREF(Py_None);
25901   indirect = Py_None; Py_INCREF(Py_None);
25902   contiguous = Py_None; Py_INCREF(Py_None);
25903   indirect_contiguous = Py_None; Py_INCREF(Py_None);
25904   __Pyx_RefNannyFinishContext();
25905   return 0;
25906 }
25907 
__Pyx_modinit_variable_export_code(void)25908 static int __Pyx_modinit_variable_export_code(void) {
25909   __Pyx_RefNannyDeclarations
25910   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
25911   /*--- Variable export code ---*/
25912   __Pyx_RefNannyFinishContext();
25913   return 0;
25914 }
25915 
__Pyx_modinit_function_export_code(void)25916 static int __Pyx_modinit_function_export_code(void) {
25917   __Pyx_RefNannyDeclarations
25918   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
25919   /*--- Function export code ---*/
25920   __Pyx_RefNannyFinishContext();
25921   return 0;
25922 }
25923 
__Pyx_modinit_type_init_code(void)25924 static int __Pyx_modinit_type_init_code(void) {
25925   __Pyx_RefNannyDeclarations
25926   int __pyx_lineno = 0;
25927   const char *__pyx_filename = NULL;
25928   int __pyx_clineno = 0;
25929   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
25930   /*--- Type init code ---*/
25931   if (PyType_Ready(&__pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
25932   #if PY_VERSION_HEX < 0x030800B1
25933   __pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs.tp_print = 0;
25934   #endif
25935   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs.tp_dictoffset && __pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs.tp_getattro == PyObject_GenericGetAttr)) {
25936     __pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25937   }
25938   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HoltWintersArgs, (PyObject *)&__pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
25939   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
25940   __pyx_ptype_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs = &__pyx_type_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_HoltWintersArgs;
25941   __pyx_vtabptr_array = &__pyx_vtable_array;
25942   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
25943   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
25944   #if PY_VERSION_HEX < 0x030800B1
25945   __pyx_type___pyx_array.tp_print = 0;
25946   #endif
25947   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
25948   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
25949   __pyx_array_type = &__pyx_type___pyx_array;
25950   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
25951   #if PY_VERSION_HEX < 0x030800B1
25952   __pyx_type___pyx_MemviewEnum.tp_print = 0;
25953   #endif
25954   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
25955     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25956   }
25957   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
25958   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
25959   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
25960   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
25961   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
25962   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
25963   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
25964   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
25965   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
25966   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
25967   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
25968   #if PY_VERSION_HEX < 0x030800B1
25969   __pyx_type___pyx_memoryview.tp_print = 0;
25970   #endif
25971   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
25972     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25973   }
25974   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
25975   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
25976   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
25977   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
25978   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
25979   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
25980   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
25981   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
25982   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
25983   #if PY_VERSION_HEX < 0x030800B1
25984   __pyx_type___pyx_memoryviewslice.tp_print = 0;
25985   #endif
25986   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
25987     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25988   }
25989   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
25990   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
25991   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
25992   __Pyx_RefNannyFinishContext();
25993   return 0;
25994   __pyx_L1_error:;
25995   __Pyx_RefNannyFinishContext();
25996   return -1;
25997 }
25998 
__Pyx_modinit_type_import_code(void)25999 static int __Pyx_modinit_type_import_code(void) {
26000   __Pyx_RefNannyDeclarations
26001   PyObject *__pyx_t_1 = NULL;
26002   int __pyx_lineno = 0;
26003   const char *__pyx_filename = NULL;
26004   int __pyx_clineno = 0;
26005   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
26006   /*--- Type import code ---*/
26007   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
26008   __Pyx_GOTREF(__pyx_t_1);
26009   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
26010   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
26011   sizeof(PyTypeObject),
26012   #else
26013   sizeof(PyHeapTypeObject),
26014   #endif
26015   __Pyx_ImportType_CheckSize_Warn);
26016    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
26017   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26018   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
26019   __Pyx_GOTREF(__pyx_t_1);
26020   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
26021    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
26022   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
26023    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
26024   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
26025    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
26026   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
26027    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
26028   __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26029    if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
26030   __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26031    if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
26032   __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26033    if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
26034   __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26035    if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
26036   __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26037    if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
26038   __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26039    if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
26040   __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26041    if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
26042   __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26043    if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
26044   __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26045    if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
26046   __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
26047    if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
26048   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
26049    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
26050   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26051   __Pyx_RefNannyFinishContext();
26052   return 0;
26053   __pyx_L1_error:;
26054   __Pyx_XDECREF(__pyx_t_1);
26055   __Pyx_RefNannyFinishContext();
26056   return -1;
26057 }
26058 
__Pyx_modinit_variable_import_code(void)26059 static int __Pyx_modinit_variable_import_code(void) {
26060   __Pyx_RefNannyDeclarations
26061   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
26062   /*--- Variable import code ---*/
26063   __Pyx_RefNannyFinishContext();
26064   return 0;
26065 }
26066 
__Pyx_modinit_function_import_code(void)26067 static int __Pyx_modinit_function_import_code(void) {
26068   __Pyx_RefNannyDeclarations
26069   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
26070   /*--- Function import code ---*/
26071   __Pyx_RefNannyFinishContext();
26072   return 0;
26073 }
26074 
26075 
26076 #ifndef CYTHON_NO_PYINIT_EXPORT
26077 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
26078 #elif PY_MAJOR_VERSION < 3
26079 #ifdef __cplusplus
26080 #define __Pyx_PyMODINIT_FUNC extern "C" void
26081 #else
26082 #define __Pyx_PyMODINIT_FUNC void
26083 #endif
26084 #else
26085 #ifdef __cplusplus
26086 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
26087 #else
26088 #define __Pyx_PyMODINIT_FUNC PyObject *
26089 #endif
26090 #endif
26091 
26092 
26093 #if PY_MAJOR_VERSION < 3
26094 __Pyx_PyMODINIT_FUNC init_exponential_smoothers(void) CYTHON_SMALL_CODE; /*proto*/
init_exponential_smoothers(void)26095 __Pyx_PyMODINIT_FUNC init_exponential_smoothers(void)
26096 #else
26097 __Pyx_PyMODINIT_FUNC PyInit__exponential_smoothers(void) CYTHON_SMALL_CODE; /*proto*/
26098 __Pyx_PyMODINIT_FUNC PyInit__exponential_smoothers(void)
26099 #if CYTHON_PEP489_MULTI_PHASE_INIT
26100 {
26101   return PyModuleDef_Init(&__pyx_moduledef);
26102 }
26103 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
26104     #if PY_VERSION_HEX >= 0x030700A1
26105     static PY_INT64_T main_interpreter_id = -1;
26106     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
26107     if (main_interpreter_id == -1) {
26108         main_interpreter_id = current_id;
26109         return (unlikely(current_id == -1)) ? -1 : 0;
26110     } else if (unlikely(main_interpreter_id != current_id))
26111     #else
26112     static PyInterpreterState *main_interpreter = NULL;
26113     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
26114     if (!main_interpreter) {
26115         main_interpreter = current_interpreter;
26116     } else if (unlikely(main_interpreter != current_interpreter))
26117     #endif
26118     {
26119         PyErr_SetString(
26120             PyExc_ImportError,
26121             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
26122         return -1;
26123     }
26124     return 0;
26125 }
26126 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) {
26127     PyObject *value = PyObject_GetAttrString(spec, from_name);
26128     int result = 0;
26129     if (likely(value)) {
26130         if (allow_none || value != Py_None) {
26131             result = PyDict_SetItemString(moddict, to_name, value);
26132         }
26133         Py_DECREF(value);
26134     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
26135         PyErr_Clear();
26136     } else {
26137         result = -1;
26138     }
26139     return result;
26140 }
26141 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
26142     PyObject *module = NULL, *moddict, *modname;
26143     if (__Pyx_check_single_interpreter())
26144         return NULL;
26145     if (__pyx_m)
26146         return __Pyx_NewRef(__pyx_m);
26147     modname = PyObject_GetAttrString(spec, "name");
26148     if (unlikely(!modname)) goto bad;
26149     module = PyModule_NewObject(modname);
26150     Py_DECREF(modname);
26151     if (unlikely(!module)) goto bad;
26152     moddict = PyModule_GetDict(module);
26153     if (unlikely(!moddict)) goto bad;
26154     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
26155     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
26156     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
26157     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
26158     return module;
26159 bad:
26160     Py_XDECREF(module);
26161     return NULL;
26162 }
26163 
26164 
26165 static CYTHON_SMALL_CODE int __pyx_pymod_exec__exponential_smoothers(PyObject *__pyx_pyinit_module)
26166 #endif
26167 #endif
26168 {
26169   PyObject *__pyx_t_1 = NULL;
26170   int __pyx_t_2;
26171   PyObject *__pyx_t_3 = NULL;
26172   PyObject *__pyx_t_4 = NULL;
26173   double __pyx_t_5;
26174   static PyThread_type_lock __pyx_t_6[8];
26175   int __pyx_lineno = 0;
26176   const char *__pyx_filename = NULL;
26177   int __pyx_clineno = 0;
26178   __Pyx_RefNannyDeclarations
26179   #if CYTHON_PEP489_MULTI_PHASE_INIT
26180   if (__pyx_m) {
26181     if (__pyx_m == __pyx_pyinit_module) return 0;
26182     PyErr_SetString(PyExc_RuntimeError, "Module '_exponential_smoothers' has already been imported. Re-initialisation is not supported.");
26183     return -1;
26184   }
26185   #elif PY_MAJOR_VERSION >= 3
26186   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
26187   #endif
26188   #if CYTHON_REFNANNY
26189 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
26190 if (!__Pyx_RefNanny) {
26191   PyErr_Clear();
26192   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
26193   if (!__Pyx_RefNanny)
26194       Py_FatalError("failed to import 'refnanny' module");
26195 }
26196 #endif
26197   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__exponential_smoothers(void)", 0);
26198   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26199   #ifdef __Pxy_PyFrame_Initialize_Offsets
26200   __Pxy_PyFrame_Initialize_Offsets();
26201   #endif
26202   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
26203   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
26204   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
26205   #ifdef __Pyx_CyFunction_USED
26206   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26207   #endif
26208   #ifdef __Pyx_FusedFunction_USED
26209   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26210   #endif
26211   #ifdef __Pyx_Coroutine_USED
26212   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26213   #endif
26214   #ifdef __Pyx_Generator_USED
26215   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26216   #endif
26217   #ifdef __Pyx_AsyncGen_USED
26218   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26219   #endif
26220   #ifdef __Pyx_StopAsyncIteration_USED
26221   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26222   #endif
26223   /*--- Library function declarations ---*/
26224   /*--- Threads initialization code ---*/
26225   #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
26226   PyEval_InitThreads();
26227   #endif
26228   /*--- Module creation code ---*/
26229   #if CYTHON_PEP489_MULTI_PHASE_INIT
26230   __pyx_m = __pyx_pyinit_module;
26231   Py_INCREF(__pyx_m);
26232   #else
26233   #if PY_MAJOR_VERSION < 3
26234   __pyx_m = Py_InitModule4("_exponential_smoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
26235   #else
26236   __pyx_m = PyModule_Create(&__pyx_moduledef);
26237   #endif
26238   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
26239   #endif
26240   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
26241   Py_INCREF(__pyx_d);
26242   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
26243   Py_INCREF(__pyx_b);
26244   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
26245   Py_INCREF(__pyx_cython_runtime);
26246   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
26247   /*--- Initialize various global constants etc. ---*/
26248   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26249   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
26250   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26251   #endif
26252   if (__pyx_module_is_main_statsmodels__tsa__holtwinters___exponential_smoothers) {
26253     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26254   }
26255   #if PY_MAJOR_VERSION >= 3
26256   {
26257     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
26258     if (!PyDict_GetItemString(modules, "statsmodels.tsa.holtwinters._exponential_smoothers")) {
26259       if (unlikely(PyDict_SetItemString(modules, "statsmodels.tsa.holtwinters._exponential_smoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
26260     }
26261   }
26262   #endif
26263   /*--- Builtin init code ---*/
26264   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26265   /*--- Constants init code ---*/
26266   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26267   /*--- Global type/function init code ---*/
26268   (void)__Pyx_modinit_global_init_code();
26269   (void)__Pyx_modinit_variable_export_code();
26270   (void)__Pyx_modinit_function_export_code();
26271   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
26272   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
26273   (void)__Pyx_modinit_variable_import_code();
26274   (void)__Pyx_modinit_function_import_code();
26275   /*--- Execution code ---*/
26276   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
26277   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26278   #endif
26279 
26280   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":4
26281  * #cython: language_level=3, wraparound=False, boundscheck=False, cdivision=True
26282  *
26283  * import numpy as np             # <<<<<<<<<<<<<<
26284  *
26285  * cimport numpy as np
26286  */
26287   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
26288   __Pyx_GOTREF(__pyx_t_1);
26289   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
26290   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26291 
26292   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":8
26293  * cimport numpy as np
26294  *
26295  * np.import_array()             # <<<<<<<<<<<<<<
26296  *
26297  * cdef double LOWER_BOUND = np.sqrt(np.finfo(float).eps)
26298  */
26299   __pyx_t_2 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 8, __pyx_L1_error)
26300 
26301   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":10
26302  * np.import_array()
26303  *
26304  * cdef double LOWER_BOUND = np.sqrt(np.finfo(float).eps)             # <<<<<<<<<<<<<<
26305  *
26306  *
26307  */
26308   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
26309   __Pyx_GOTREF(__pyx_t_1);
26310   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error)
26311   __Pyx_GOTREF(__pyx_t_3);
26312   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26313   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
26314   __Pyx_GOTREF(__pyx_t_1);
26315   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_finfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
26316   __Pyx_GOTREF(__pyx_t_4);
26317   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26318   __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)(&PyFloat_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
26319   __Pyx_GOTREF(__pyx_t_1);
26320   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26321   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_eps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
26322   __Pyx_GOTREF(__pyx_t_4);
26323   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26324   __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
26325   __Pyx_GOTREF(__pyx_t_1);
26326   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26327   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26328   __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L1_error)
26329   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26330   __pyx_v_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_LOWER_BOUND = __pyx_t_5;
26331 
26332   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":127
26333  *     return a, b, g
26334  *
26335  * def _test_to_restricted(p, sel, bounds):             # <<<<<<<<<<<<<<
26336  *     """Testing harness"""
26337  *     return to_restricted(p, sel, bounds)
26338  */
26339   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_1_test_to_restricted, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
26340   __Pyx_GOTREF(__pyx_t_1);
26341   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_to_restricted, __pyx_t_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
26342   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26343 
26344   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":163
26345  *
26346  * # noinspection PyProtectedMember
26347  * def holt__(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26348  *     """
26349  *     Compute the sum of squared residuals for Simple Exponential Smoothing
26350  */
26351   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_3holt__, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
26352   __Pyx_GOTREF(__pyx_t_1);
26353   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt, __pyx_t_1) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
26354   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26355 
26356   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":188
26357  *
26358  * # noinspection PyProtectedMember
26359  * def holt_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26360  *     """
26361  *     Multiplicative and Multiplicative Damped
26362  */
26363   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_5holt_mul_dam, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
26364   __Pyx_GOTREF(__pyx_t_1);
26365   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt_mul_dam, __pyx_t_1) < 0) __PYX_ERR(0, 188, __pyx_L1_error)
26366   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26367 
26368   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":211
26369  *
26370  * # noinspection PyProtectedMember
26371  * def holt_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26372  *     """
26373  *     Additive and Additive Damped
26374  */
26375   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_7holt_add_dam, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
26376   __Pyx_GOTREF(__pyx_t_1);
26377   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt_add_dam, __pyx_t_1) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
26378   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26379 
26380   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":272
26381  *
26382  * # noinspection PyProtectedMember
26383  * def holt_win_add_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26384  *     """
26385  *     Additive and Additive Damped with Additive Seasonal
26386  */
26387   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_9holt_win_add_add_dam, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
26388   __Pyx_GOTREF(__pyx_t_1);
26389   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt_win_add_add_dam, __pyx_t_1) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
26390   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26391 
26392   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":301
26393  *
26394  * # noinspection PyProtectedMember
26395  * def holt_win__add(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26396  *     """
26397  *     Additive Seasonal
26398  */
26399   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_11holt_win__add, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
26400   __Pyx_GOTREF(__pyx_t_1);
26401   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt_win__add, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
26402   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26403 
26404   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":327
26405  *
26406  * # noinspection PyProtectedMember
26407  * def holt_win__mul(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26408  *     """
26409  *     Multiplicative Seasonal
26410  */
26411   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_13holt_win__mul, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
26412   __Pyx_GOTREF(__pyx_t_1);
26413   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt_win__mul, __pyx_t_1) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
26414   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26415 
26416   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":352
26417  *
26418  * # noinspection PyProtectedMember
26419  * def holt_win_mul_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26420  *     """
26421  *     Multiplicative and Multiplicative Damped with Multiplicative Seasonal
26422  */
26423   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_15holt_win_mul_mul_dam, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
26424   __Pyx_GOTREF(__pyx_t_1);
26425   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt_win_mul_mul_dam, __pyx_t_1) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
26426   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26427 
26428   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":383
26429  *
26430  * # noinspection PyProtectedMember
26431  * def holt_win_add_mul_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26432  *     """
26433  *     Additive and Additive Damped with Multiplicative Seasonal
26434  */
26435   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_17holt_win_add_mul_dam, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
26436   __Pyx_GOTREF(__pyx_t_1);
26437   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt_win_add_mul_dam, __pyx_t_1) < 0) __PYX_ERR(0, 383, __pyx_L1_error)
26438   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26439 
26440   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":414
26441  *
26442  * # noinspection PyProtectedMember
26443  * def holt_win_mul_add_dam(double[::1] x, HoltWintersArgs hw_args):             # <<<<<<<<<<<<<<
26444  *     """
26445  *     Multiplicative and Multiplicative Damped with Additive Seasonal
26446  */
26447   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_19holt_win_mul_add_dam, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
26448   __Pyx_GOTREF(__pyx_t_1);
26449   if (PyDict_SetItem(__pyx_d, __pyx_n_s_holt_win_mul_add_dam, __pyx_t_1) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
26450   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26451 
26452   /* "(tree fragment)":1
26453  * def __pyx_unpickle_HoltWintersArgs(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26454  *     cdef object __pyx_PickleError
26455  *     cdef object __pyx_result
26456  */
26457   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11statsmodels_3tsa_11holtwinters_22_exponential_smoothers_21__pyx_unpickle_HoltWintersArgs, NULL, __pyx_n_s_statsmodels_tsa_holtwinters__exp_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
26458   __Pyx_GOTREF(__pyx_t_1);
26459   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_HoltWintersArgs, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
26460   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26461 
26462   /* "statsmodels/tsa/holtwinters/_exponential_smoothers.pyx":1
26463  * #!python             # <<<<<<<<<<<<<<
26464  * #cython: language_level=3, wraparound=False, boundscheck=False, cdivision=True
26465  *
26466  */
26467   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
26468   __Pyx_GOTREF(__pyx_t_1);
26469   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26470   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26471 
26472   /* "View.MemoryView":209
26473  *         info.obj = self
26474  *
26475  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
26476  *
26477  *     def __dealloc__(array self):
26478  */
26479   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
26480   __Pyx_GOTREF(__pyx_t_1);
26481   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
26482   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26483   PyType_Modified(__pyx_array_type);
26484 
26485   /* "View.MemoryView":286
26486  *         return self.name
26487  *
26488  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
26489  * cdef strided = Enum("<strided and direct>") # default
26490  * cdef indirect = Enum("<strided and indirect>")
26491  */
26492   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
26493   __Pyx_GOTREF(__pyx_t_1);
26494   __Pyx_XGOTREF(generic);
26495   __Pyx_DECREF_SET(generic, __pyx_t_1);
26496   __Pyx_GIVEREF(__pyx_t_1);
26497   __pyx_t_1 = 0;
26498 
26499   /* "View.MemoryView":287
26500  *
26501  * cdef generic = Enum("<strided and direct or indirect>")
26502  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
26503  * cdef indirect = Enum("<strided and indirect>")
26504  *
26505  */
26506   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
26507   __Pyx_GOTREF(__pyx_t_1);
26508   __Pyx_XGOTREF(strided);
26509   __Pyx_DECREF_SET(strided, __pyx_t_1);
26510   __Pyx_GIVEREF(__pyx_t_1);
26511   __pyx_t_1 = 0;
26512 
26513   /* "View.MemoryView":288
26514  * cdef generic = Enum("<strided and direct or indirect>")
26515  * cdef strided = Enum("<strided and direct>") # default
26516  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
26517  *
26518  *
26519  */
26520   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
26521   __Pyx_GOTREF(__pyx_t_1);
26522   __Pyx_XGOTREF(indirect);
26523   __Pyx_DECREF_SET(indirect, __pyx_t_1);
26524   __Pyx_GIVEREF(__pyx_t_1);
26525   __pyx_t_1 = 0;
26526 
26527   /* "View.MemoryView":291
26528  *
26529  *
26530  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
26531  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
26532  *
26533  */
26534   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
26535   __Pyx_GOTREF(__pyx_t_1);
26536   __Pyx_XGOTREF(contiguous);
26537   __Pyx_DECREF_SET(contiguous, __pyx_t_1);
26538   __Pyx_GIVEREF(__pyx_t_1);
26539   __pyx_t_1 = 0;
26540 
26541   /* "View.MemoryView":292
26542  *
26543  * cdef contiguous = Enum("<contiguous and direct>")
26544  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
26545  *
26546  *
26547  */
26548   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
26549   __Pyx_GOTREF(__pyx_t_1);
26550   __Pyx_XGOTREF(indirect_contiguous);
26551   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
26552   __Pyx_GIVEREF(__pyx_t_1);
26553   __pyx_t_1 = 0;
26554 
26555   /* "View.MemoryView":316
26556  *
26557  * DEF THREAD_LOCKS_PREALLOCATED = 8
26558  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
26559  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
26560  *     PyThread_allocate_lock(),
26561  */
26562   __pyx_memoryview_thread_locks_used = 0;
26563 
26564   /* "View.MemoryView":317
26565  * DEF THREAD_LOCKS_PREALLOCATED = 8
26566  * cdef int __pyx_memoryview_thread_locks_used = 0
26567  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
26568  *     PyThread_allocate_lock(),
26569  *     PyThread_allocate_lock(),
26570  */
26571   __pyx_t_6[0] = PyThread_allocate_lock();
26572   __pyx_t_6[1] = PyThread_allocate_lock();
26573   __pyx_t_6[2] = PyThread_allocate_lock();
26574   __pyx_t_6[3] = PyThread_allocate_lock();
26575   __pyx_t_6[4] = PyThread_allocate_lock();
26576   __pyx_t_6[5] = PyThread_allocate_lock();
26577   __pyx_t_6[6] = PyThread_allocate_lock();
26578   __pyx_t_6[7] = PyThread_allocate_lock();
26579   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_6, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
26580 
26581   /* "View.MemoryView":549
26582  *         info.obj = self
26583  *
26584  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
26585  *
26586  *
26587  */
26588   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
26589   __Pyx_GOTREF(__pyx_t_1);
26590   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
26591   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26592   PyType_Modified(__pyx_memoryview_type);
26593 
26594   /* "View.MemoryView":995
26595  *         return self.from_object
26596  *
26597  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
26598  *
26599  *
26600  */
26601   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
26602   __Pyx_GOTREF(__pyx_t_1);
26603   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
26604   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26605   PyType_Modified(__pyx_memoryviewslice_type);
26606 
26607   /* "(tree fragment)":1
26608  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26609  *     cdef object __pyx_PickleError
26610  *     cdef object __pyx_result
26611  */
26612   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
26613   __Pyx_GOTREF(__pyx_t_1);
26614   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
26615   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26616 
26617   /* "(tree fragment)":11
26618  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
26619  *     return __pyx_result
26620  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
26621  *     __pyx_result.name = __pyx_state[0]
26622  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
26623  */
26624 
26625   /*--- Wrapped vars code ---*/
26626 
26627   goto __pyx_L0;
26628   __pyx_L1_error:;
26629   __Pyx_XDECREF(__pyx_t_1);
26630   __Pyx_XDECREF(__pyx_t_3);
26631   __Pyx_XDECREF(__pyx_t_4);
26632   if (__pyx_m) {
26633     if (__pyx_d) {
26634       __Pyx_AddTraceback("init statsmodels.tsa.holtwinters._exponential_smoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
26635     }
26636     Py_CLEAR(__pyx_m);
26637   } else if (!PyErr_Occurred()) {
26638     PyErr_SetString(PyExc_ImportError, "init statsmodels.tsa.holtwinters._exponential_smoothers");
26639   }
26640   __pyx_L0:;
26641   __Pyx_RefNannyFinishContext();
26642   #if CYTHON_PEP489_MULTI_PHASE_INIT
26643   return (__pyx_m != NULL) ? 0 : -1;
26644   #elif PY_MAJOR_VERSION >= 3
26645   return __pyx_m;
26646   #else
26647   return;
26648   #endif
26649 }
26650 
26651 /* --- Runtime support code --- */
26652 /* Refnanny */
26653 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)26654 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
26655     PyObject *m = NULL, *p = NULL;
26656     void *r = NULL;
26657     m = PyImport_ImportModule(modname);
26658     if (!m) goto end;
26659     p = PyObject_GetAttrString(m, "RefNannyAPI");
26660     if (!p) goto end;
26661     r = PyLong_AsVoidPtr(p);
26662 end:
26663     Py_XDECREF(p);
26664     Py_XDECREF(m);
26665     return (__Pyx_RefNannyAPIStruct *)r;
26666 }
26667 #endif
26668 
26669 /* PyObjectGetAttrStr */
26670 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)26671 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
26672     PyTypeObject* tp = Py_TYPE(obj);
26673     if (likely(tp->tp_getattro))
26674         return tp->tp_getattro(obj, attr_name);
26675 #if PY_MAJOR_VERSION < 3
26676     if (likely(tp->tp_getattr))
26677         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
26678 #endif
26679     return PyObject_GetAttr(obj, attr_name);
26680 }
26681 #endif
26682 
26683 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)26684 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
26685     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
26686     if (unlikely(!result)) {
26687         PyErr_Format(PyExc_NameError,
26688 #if PY_MAJOR_VERSION >= 3
26689             "name '%U' is not defined", name);
26690 #else
26691             "name '%.200s' is not defined", PyString_AS_STRING(name));
26692 #endif
26693     }
26694     return result;
26695 }
26696 
26697 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)26698 static void __Pyx_RaiseArgtupleInvalid(
26699     const char* func_name,
26700     int exact,
26701     Py_ssize_t num_min,
26702     Py_ssize_t num_max,
26703     Py_ssize_t num_found)
26704 {
26705     Py_ssize_t num_expected;
26706     const char *more_or_less;
26707     if (num_found < num_min) {
26708         num_expected = num_min;
26709         more_or_less = "at least";
26710     } else {
26711         num_expected = num_max;
26712         more_or_less = "at most";
26713     }
26714     if (exact) {
26715         more_or_less = "exactly";
26716     }
26717     PyErr_Format(PyExc_TypeError,
26718                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
26719                  func_name, more_or_less, num_expected,
26720                  (num_expected == 1) ? "" : "s", num_found);
26721 }
26722 
26723 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)26724 static void __Pyx_RaiseDoubleKeywordsError(
26725     const char* func_name,
26726     PyObject* kw_name)
26727 {
26728     PyErr_Format(PyExc_TypeError,
26729         #if PY_MAJOR_VERSION >= 3
26730         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
26731         #else
26732         "%s() got multiple values for keyword argument '%s'", func_name,
26733         PyString_AsString(kw_name));
26734         #endif
26735 }
26736 
26737 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)26738 static int __Pyx_ParseOptionalKeywords(
26739     PyObject *kwds,
26740     PyObject **argnames[],
26741     PyObject *kwds2,
26742     PyObject *values[],
26743     Py_ssize_t num_pos_args,
26744     const char* function_name)
26745 {
26746     PyObject *key = 0, *value = 0;
26747     Py_ssize_t pos = 0;
26748     PyObject*** name;
26749     PyObject*** first_kw_arg = argnames + num_pos_args;
26750     while (PyDict_Next(kwds, &pos, &key, &value)) {
26751         name = first_kw_arg;
26752         while (*name && (**name != key)) name++;
26753         if (*name) {
26754             values[name-argnames] = value;
26755             continue;
26756         }
26757         name = first_kw_arg;
26758         #if PY_MAJOR_VERSION < 3
26759         if (likely(PyString_Check(key))) {
26760             while (*name) {
26761                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
26762                         && _PyString_Eq(**name, key)) {
26763                     values[name-argnames] = value;
26764                     break;
26765                 }
26766                 name++;
26767             }
26768             if (*name) continue;
26769             else {
26770                 PyObject*** argname = argnames;
26771                 while (argname != first_kw_arg) {
26772                     if ((**argname == key) || (
26773                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
26774                              && _PyString_Eq(**argname, key))) {
26775                         goto arg_passed_twice;
26776                     }
26777                     argname++;
26778                 }
26779             }
26780         } else
26781         #endif
26782         if (likely(PyUnicode_Check(key))) {
26783             while (*name) {
26784                 int cmp = (**name == key) ? 0 :
26785                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
26786                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
26787                 #endif
26788                     PyUnicode_Compare(**name, key);
26789                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
26790                 if (cmp == 0) {
26791                     values[name-argnames] = value;
26792                     break;
26793                 }
26794                 name++;
26795             }
26796             if (*name) continue;
26797             else {
26798                 PyObject*** argname = argnames;
26799                 while (argname != first_kw_arg) {
26800                     int cmp = (**argname == key) ? 0 :
26801                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
26802                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
26803                     #endif
26804                         PyUnicode_Compare(**argname, key);
26805                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
26806                     if (cmp == 0) goto arg_passed_twice;
26807                     argname++;
26808                 }
26809             }
26810         } else
26811             goto invalid_keyword_type;
26812         if (kwds2) {
26813             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
26814         } else {
26815             goto invalid_keyword;
26816         }
26817     }
26818     return 0;
26819 arg_passed_twice:
26820     __Pyx_RaiseDoubleKeywordsError(function_name, key);
26821     goto bad;
26822 invalid_keyword_type:
26823     PyErr_Format(PyExc_TypeError,
26824         "%.200s() keywords must be strings", function_name);
26825     goto bad;
26826 invalid_keyword:
26827     PyErr_Format(PyExc_TypeError,
26828     #if PY_MAJOR_VERSION < 3
26829         "%.200s() got an unexpected keyword argument '%.200s'",
26830         function_name, PyString_AsString(key));
26831     #else
26832         "%s() got an unexpected keyword argument '%U'",
26833         function_name, key);
26834     #endif
26835 bad:
26836     return -1;
26837 }
26838 
26839 /* MemviewSliceInit */
26840 static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)26841 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
26842                         int ndim,
26843                         __Pyx_memviewslice *memviewslice,
26844                         int memview_is_new_reference)
26845 {
26846     __Pyx_RefNannyDeclarations
26847     int i, retval=-1;
26848     Py_buffer *buf = &memview->view;
26849     __Pyx_RefNannySetupContext("init_memviewslice", 0);
26850     if (unlikely(memviewslice->memview || memviewslice->data)) {
26851         PyErr_SetString(PyExc_ValueError,
26852             "memviewslice is already initialized!");
26853         goto fail;
26854     }
26855     if (buf->strides) {
26856         for (i = 0; i < ndim; i++) {
26857             memviewslice->strides[i] = buf->strides[i];
26858         }
26859     } else {
26860         Py_ssize_t stride = buf->itemsize;
26861         for (i = ndim - 1; i >= 0; i--) {
26862             memviewslice->strides[i] = stride;
26863             stride *= buf->shape[i];
26864         }
26865     }
26866     for (i = 0; i < ndim; i++) {
26867         memviewslice->shape[i]   = buf->shape[i];
26868         if (buf->suboffsets) {
26869             memviewslice->suboffsets[i] = buf->suboffsets[i];
26870         } else {
26871             memviewslice->suboffsets[i] = -1;
26872         }
26873     }
26874     memviewslice->memview = memview;
26875     memviewslice->data = (char *)buf->buf;
26876     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
26877         Py_INCREF(memview);
26878     }
26879     retval = 0;
26880     goto no_fail;
26881 fail:
26882     memviewslice->memview = 0;
26883     memviewslice->data = 0;
26884     retval = -1;
26885 no_fail:
26886     __Pyx_RefNannyFinishContext();
26887     return retval;
26888 }
26889 #ifndef Py_NO_RETURN
26890 #define Py_NO_RETURN
26891 #endif
__pyx_fatalerror(const char * fmt,...)26892 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
26893     va_list vargs;
26894     char msg[200];
26895 #ifdef HAVE_STDARG_PROTOTYPES
26896     va_start(vargs, fmt);
26897 #else
26898     va_start(vargs);
26899 #endif
26900     vsnprintf(msg, 200, fmt, vargs);
26901     va_end(vargs);
26902     Py_FatalError(msg);
26903 }
26904 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)26905 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26906                                    PyThread_type_lock lock)
26907 {
26908     int result;
26909     PyThread_acquire_lock(lock, 1);
26910     result = (*acquisition_count)++;
26911     PyThread_release_lock(lock);
26912     return result;
26913 }
26914 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)26915 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26916                                    PyThread_type_lock lock)
26917 {
26918     int result;
26919     PyThread_acquire_lock(lock, 1);
26920     result = (*acquisition_count)--;
26921     PyThread_release_lock(lock);
26922     return result;
26923 }
26924 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)26925 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
26926 {
26927     int first_time;
26928     struct __pyx_memoryview_obj *memview = memslice->memview;
26929     if (unlikely(!memview || (PyObject *) memview == Py_None))
26930         return;
26931     if (unlikely(__pyx_get_slice_count(memview) < 0))
26932         __pyx_fatalerror("Acquisition count is %d (line %d)",
26933                          __pyx_get_slice_count(memview), lineno);
26934     first_time = __pyx_add_acquisition_count(memview) == 0;
26935     if (unlikely(first_time)) {
26936         if (have_gil) {
26937             Py_INCREF((PyObject *) memview);
26938         } else {
26939             PyGILState_STATE _gilstate = PyGILState_Ensure();
26940             Py_INCREF((PyObject *) memview);
26941             PyGILState_Release(_gilstate);
26942         }
26943     }
26944 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)26945 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
26946                                              int have_gil, int lineno) {
26947     int last_time;
26948     struct __pyx_memoryview_obj *memview = memslice->memview;
26949     if (unlikely(!memview || (PyObject *) memview == Py_None)) {
26950         memslice->memview = NULL;
26951         return;
26952     }
26953     if (unlikely(__pyx_get_slice_count(memview) <= 0))
26954         __pyx_fatalerror("Acquisition count is %d (line %d)",
26955                          __pyx_get_slice_count(memview), lineno);
26956     last_time = __pyx_sub_acquisition_count(memview) == 1;
26957     memslice->data = NULL;
26958     if (unlikely(last_time)) {
26959         if (have_gil) {
26960             Py_CLEAR(memslice->memview);
26961         } else {
26962             PyGILState_STATE _gilstate = PyGILState_Ensure();
26963             Py_CLEAR(memslice->memview);
26964             PyGILState_Release(_gilstate);
26965         }
26966     } else {
26967         memslice->memview = NULL;
26968     }
26969 }
26970 
26971 /* PyDictVersioning */
26972 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)26973 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
26974     PyObject *dict = Py_TYPE(obj)->tp_dict;
26975     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
26976 }
__Pyx_get_object_dict_version(PyObject * obj)26977 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
26978     PyObject **dictptr = NULL;
26979     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
26980     if (offset) {
26981 #if CYTHON_COMPILING_IN_CPYTHON
26982         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
26983 #else
26984         dictptr = _PyObject_GetDictPtr(obj);
26985 #endif
26986     }
26987     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
26988 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)26989 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
26990     PyObject *dict = Py_TYPE(obj)->tp_dict;
26991     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
26992         return 0;
26993     return obj_dict_version == __Pyx_get_object_dict_version(obj);
26994 }
26995 #endif
26996 
26997 /* GetModuleGlobalName */
26998 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)26999 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
27000 #else
27001 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
27002 #endif
27003 {
27004     PyObject *result;
27005 #if !CYTHON_AVOID_BORROWED_REFS
27006 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
27007     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
27008     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
27009     if (likely(result)) {
27010         return __Pyx_NewRef(result);
27011     } else if (unlikely(PyErr_Occurred())) {
27012         return NULL;
27013     }
27014 #else
27015     result = PyDict_GetItem(__pyx_d, name);
27016     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
27017     if (likely(result)) {
27018         return __Pyx_NewRef(result);
27019     }
27020 #endif
27021 #else
27022     result = PyObject_GetItem(__pyx_d, name);
27023     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
27024     if (likely(result)) {
27025         return __Pyx_NewRef(result);
27026     }
27027     PyErr_Clear();
27028 #endif
27029     return __Pyx_GetBuiltinName(name);
27030 }
27031 
27032 /* PyCFunctionFastCall */
27033 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)27034 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
27035     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
27036     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
27037     PyObject *self = PyCFunction_GET_SELF(func);
27038     int flags = PyCFunction_GET_FLAGS(func);
27039     assert(PyCFunction_Check(func));
27040     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
27041     assert(nargs >= 0);
27042     assert(nargs == 0 || args != NULL);
27043     /* _PyCFunction_FastCallDict() must not be called with an exception set,
27044        because it may clear it (directly or indirectly) and so the
27045        caller loses its exception */
27046     assert(!PyErr_Occurred());
27047     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
27048         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
27049     } else {
27050         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
27051     }
27052 }
27053 #endif
27054 
27055 /* PyFunctionFastCall */
27056 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)27057 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
27058                                                PyObject *globals) {
27059     PyFrameObject *f;
27060     PyThreadState *tstate = __Pyx_PyThreadState_Current;
27061     PyObject **fastlocals;
27062     Py_ssize_t i;
27063     PyObject *result;
27064     assert(globals != NULL);
27065     /* XXX Perhaps we should create a specialized
27066        PyFrame_New() that doesn't take locals, but does
27067        take builtins without sanity checking them.
27068        */
27069     assert(tstate != NULL);
27070     f = PyFrame_New(tstate, co, globals, NULL);
27071     if (f == NULL) {
27072         return NULL;
27073     }
27074     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
27075     for (i = 0; i < na; i++) {
27076         Py_INCREF(*args);
27077         fastlocals[i] = *args++;
27078     }
27079     result = PyEval_EvalFrameEx(f,0);
27080     ++tstate->recursion_depth;
27081     Py_DECREF(f);
27082     --tstate->recursion_depth;
27083     return result;
27084 }
27085 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)27086 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
27087     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
27088     PyObject *globals = PyFunction_GET_GLOBALS(func);
27089     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
27090     PyObject *closure;
27091 #if PY_MAJOR_VERSION >= 3
27092     PyObject *kwdefs;
27093 #endif
27094     PyObject *kwtuple, **k;
27095     PyObject **d;
27096     Py_ssize_t nd;
27097     Py_ssize_t nk;
27098     PyObject *result;
27099     assert(kwargs == NULL || PyDict_Check(kwargs));
27100     nk = kwargs ? PyDict_Size(kwargs) : 0;
27101     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
27102         return NULL;
27103     }
27104     if (
27105 #if PY_MAJOR_VERSION >= 3
27106             co->co_kwonlyargcount == 0 &&
27107 #endif
27108             likely(kwargs == NULL || nk == 0) &&
27109             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
27110         if (argdefs == NULL && co->co_argcount == nargs) {
27111             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
27112             goto done;
27113         }
27114         else if (nargs == 0 && argdefs != NULL
27115                  && co->co_argcount == Py_SIZE(argdefs)) {
27116             /* function called with no arguments, but all parameters have
27117                a default value: use default values as arguments .*/
27118             args = &PyTuple_GET_ITEM(argdefs, 0);
27119             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
27120             goto done;
27121         }
27122     }
27123     if (kwargs != NULL) {
27124         Py_ssize_t pos, i;
27125         kwtuple = PyTuple_New(2 * nk);
27126         if (kwtuple == NULL) {
27127             result = NULL;
27128             goto done;
27129         }
27130         k = &PyTuple_GET_ITEM(kwtuple, 0);
27131         pos = i = 0;
27132         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
27133             Py_INCREF(k[i]);
27134             Py_INCREF(k[i+1]);
27135             i += 2;
27136         }
27137         nk = i / 2;
27138     }
27139     else {
27140         kwtuple = NULL;
27141         k = NULL;
27142     }
27143     closure = PyFunction_GET_CLOSURE(func);
27144 #if PY_MAJOR_VERSION >= 3
27145     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
27146 #endif
27147     if (argdefs != NULL) {
27148         d = &PyTuple_GET_ITEM(argdefs, 0);
27149         nd = Py_SIZE(argdefs);
27150     }
27151     else {
27152         d = NULL;
27153         nd = 0;
27154     }
27155 #if PY_MAJOR_VERSION >= 3
27156     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
27157                                args, (int)nargs,
27158                                k, (int)nk,
27159                                d, (int)nd, kwdefs, closure);
27160 #else
27161     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
27162                                args, (int)nargs,
27163                                k, (int)nk,
27164                                d, (int)nd, closure);
27165 #endif
27166     Py_XDECREF(kwtuple);
27167 done:
27168     Py_LeaveRecursiveCall();
27169     return result;
27170 }
27171 #endif
27172 #endif
27173 
27174 /* PyObjectCall */
27175 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)27176 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
27177     PyObject *result;
27178     ternaryfunc call = Py_TYPE(func)->tp_call;
27179     if (unlikely(!call))
27180         return PyObject_Call(func, arg, kw);
27181     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
27182         return NULL;
27183     result = (*call)(func, arg, kw);
27184     Py_LeaveRecursiveCall();
27185     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
27186         PyErr_SetString(
27187             PyExc_SystemError,
27188             "NULL result without error in PyObject_Call");
27189     }
27190     return result;
27191 }
27192 #endif
27193 
27194 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)27195 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
27196     PyObject *args, *result = NULL;
27197     #if CYTHON_FAST_PYCALL
27198     if (PyFunction_Check(function)) {
27199         PyObject *args[2] = {arg1, arg2};
27200         return __Pyx_PyFunction_FastCall(function, args, 2);
27201     }
27202     #endif
27203     #if CYTHON_FAST_PYCCALL
27204     if (__Pyx_PyFastCFunction_Check(function)) {
27205         PyObject *args[2] = {arg1, arg2};
27206         return __Pyx_PyCFunction_FastCall(function, args, 2);
27207     }
27208     #endif
27209     args = PyTuple_New(2);
27210     if (unlikely(!args)) goto done;
27211     Py_INCREF(arg1);
27212     PyTuple_SET_ITEM(args, 0, arg1);
27213     Py_INCREF(arg2);
27214     PyTuple_SET_ITEM(args, 1, arg2);
27215     Py_INCREF(function);
27216     result = __Pyx_PyObject_Call(function, args, NULL);
27217     Py_DECREF(args);
27218     Py_DECREF(function);
27219 done:
27220     return result;
27221 }
27222 
27223 /* PyObjectCallMethO */
27224 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)27225 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
27226     PyObject *self, *result;
27227     PyCFunction cfunc;
27228     cfunc = PyCFunction_GET_FUNCTION(func);
27229     self = PyCFunction_GET_SELF(func);
27230     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
27231         return NULL;
27232     result = cfunc(self, arg);
27233     Py_LeaveRecursiveCall();
27234     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
27235         PyErr_SetString(
27236             PyExc_SystemError,
27237             "NULL result without error in PyObject_Call");
27238     }
27239     return result;
27240 }
27241 #endif
27242 
27243 /* PyObjectCallOneArg */
27244 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)27245 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27246     PyObject *result;
27247     PyObject *args = PyTuple_New(1);
27248     if (unlikely(!args)) return NULL;
27249     Py_INCREF(arg);
27250     PyTuple_SET_ITEM(args, 0, arg);
27251     result = __Pyx_PyObject_Call(func, args, NULL);
27252     Py_DECREF(args);
27253     return result;
27254 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)27255 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27256 #if CYTHON_FAST_PYCALL
27257     if (PyFunction_Check(func)) {
27258         return __Pyx_PyFunction_FastCall(func, &arg, 1);
27259     }
27260 #endif
27261     if (likely(PyCFunction_Check(func))) {
27262         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
27263             return __Pyx_PyObject_CallMethO(func, arg);
27264 #if CYTHON_FAST_PYCCALL
27265         } else if (__Pyx_PyFastCFunction_Check(func)) {
27266             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
27267 #endif
27268         }
27269     }
27270     return __Pyx__PyObject_CallOneArg(func, arg);
27271 }
27272 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)27273 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27274     PyObject *result;
27275     PyObject *args = PyTuple_Pack(1, arg);
27276     if (unlikely(!args)) return NULL;
27277     result = __Pyx_PyObject_Call(func, args, NULL);
27278     Py_DECREF(args);
27279     return result;
27280 }
27281 #endif
27282 
27283 /* PyErrExceptionMatches */
27284 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)27285 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27286     Py_ssize_t i, n;
27287     n = PyTuple_GET_SIZE(tuple);
27288 #if PY_MAJOR_VERSION >= 3
27289     for (i=0; i<n; i++) {
27290         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
27291     }
27292 #endif
27293     for (i=0; i<n; i++) {
27294         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
27295     }
27296     return 0;
27297 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)27298 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
27299     PyObject *exc_type = tstate->curexc_type;
27300     if (exc_type == err) return 1;
27301     if (unlikely(!exc_type)) return 0;
27302     if (unlikely(PyTuple_Check(err)))
27303         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
27304     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
27305 }
27306 #endif
27307 
27308 /* PyErrFetchRestore */
27309 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)27310 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
27311     PyObject *tmp_type, *tmp_value, *tmp_tb;
27312     tmp_type = tstate->curexc_type;
27313     tmp_value = tstate->curexc_value;
27314     tmp_tb = tstate->curexc_traceback;
27315     tstate->curexc_type = type;
27316     tstate->curexc_value = value;
27317     tstate->curexc_traceback = tb;
27318     Py_XDECREF(tmp_type);
27319     Py_XDECREF(tmp_value);
27320     Py_XDECREF(tmp_tb);
27321 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)27322 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27323     *type = tstate->curexc_type;
27324     *value = tstate->curexc_value;
27325     *tb = tstate->curexc_traceback;
27326     tstate->curexc_type = 0;
27327     tstate->curexc_value = 0;
27328     tstate->curexc_traceback = 0;
27329 }
27330 #endif
27331 
27332 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)27333 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
27334 #if CYTHON_USE_TYPE_SLOTS
27335 #if PY_MAJOR_VERSION >= 3
27336     if (likely(PyUnicode_Check(n)))
27337 #else
27338     if (likely(PyString_Check(n)))
27339 #endif
27340         return __Pyx_PyObject_GetAttrStr(o, n);
27341 #endif
27342     return PyObject_GetAttr(o, n);
27343 }
27344 
27345 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)27346 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
27347     __Pyx_PyThreadState_declare
27348     __Pyx_PyThreadState_assign
27349     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
27350         return NULL;
27351     __Pyx_PyErr_Clear();
27352     Py_INCREF(d);
27353     return d;
27354 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)27355 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
27356     PyObject *r = __Pyx_GetAttr(o, n);
27357     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
27358 }
27359 
27360 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)27361 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
27362     PyErr_Format(PyExc_ValueError,
27363                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
27364 }
27365 
27366 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)27367 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
27368     PyErr_Format(PyExc_ValueError,
27369                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
27370                  index, (index == 1) ? "" : "s");
27371 }
27372 
27373 /* IterFinish */
__Pyx_IterFinish(void)27374 static CYTHON_INLINE int __Pyx_IterFinish(void) {
27375 #if CYTHON_FAST_THREAD_STATE
27376     PyThreadState *tstate = __Pyx_PyThreadState_Current;
27377     PyObject* exc_type = tstate->curexc_type;
27378     if (unlikely(exc_type)) {
27379         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
27380             PyObject *exc_value, *exc_tb;
27381             exc_value = tstate->curexc_value;
27382             exc_tb = tstate->curexc_traceback;
27383             tstate->curexc_type = 0;
27384             tstate->curexc_value = 0;
27385             tstate->curexc_traceback = 0;
27386             Py_DECREF(exc_type);
27387             Py_XDECREF(exc_value);
27388             Py_XDECREF(exc_tb);
27389             return 0;
27390         } else {
27391             return -1;
27392         }
27393     }
27394     return 0;
27395 #else
27396     if (unlikely(PyErr_Occurred())) {
27397         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
27398             PyErr_Clear();
27399             return 0;
27400         } else {
27401             return -1;
27402         }
27403     }
27404     return 0;
27405 #endif
27406 }
27407 
27408 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)27409 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
27410     if (unlikely(retval)) {
27411         Py_DECREF(retval);
27412         __Pyx_RaiseTooManyValuesError(expected);
27413         return -1;
27414     } else {
27415         return __Pyx_IterFinish();
27416     }
27417     return 0;
27418 }
27419 
27420 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)27421 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
27422 {
27423     if (unlikely(!type)) {
27424         PyErr_SetString(PyExc_SystemError, "Missing type object");
27425         return 0;
27426     }
27427     else if (exact) {
27428         #if PY_MAJOR_VERSION == 2
27429         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
27430         #endif
27431     }
27432     else {
27433         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
27434     }
27435     PyErr_Format(PyExc_TypeError,
27436         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
27437         name, type->tp_name, Py_TYPE(obj)->tp_name);
27438     return 0;
27439 }
27440 
27441 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)27442 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
27443     PyObject *empty_list = 0;
27444     PyObject *module = 0;
27445     PyObject *global_dict = 0;
27446     PyObject *empty_dict = 0;
27447     PyObject *list;
27448     #if PY_MAJOR_VERSION < 3
27449     PyObject *py_import;
27450     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
27451     if (!py_import)
27452         goto bad;
27453     #endif
27454     if (from_list)
27455         list = from_list;
27456     else {
27457         empty_list = PyList_New(0);
27458         if (!empty_list)
27459             goto bad;
27460         list = empty_list;
27461     }
27462     global_dict = PyModule_GetDict(__pyx_m);
27463     if (!global_dict)
27464         goto bad;
27465     empty_dict = PyDict_New();
27466     if (!empty_dict)
27467         goto bad;
27468     {
27469         #if PY_MAJOR_VERSION >= 3
27470         if (level == -1) {
27471             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
27472                 module = PyImport_ImportModuleLevelObject(
27473                     name, global_dict, empty_dict, list, 1);
27474                 if (!module) {
27475                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
27476                         goto bad;
27477                     PyErr_Clear();
27478                 }
27479             }
27480             level = 0;
27481         }
27482         #endif
27483         if (!module) {
27484             #if PY_MAJOR_VERSION < 3
27485             PyObject *py_level = PyInt_FromLong(level);
27486             if (!py_level)
27487                 goto bad;
27488             module = PyObject_CallFunctionObjArgs(py_import,
27489                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
27490             Py_DECREF(py_level);
27491             #else
27492             module = PyImport_ImportModuleLevelObject(
27493                 name, global_dict, empty_dict, list, level);
27494             #endif
27495         }
27496     }
27497 bad:
27498     #if PY_MAJOR_VERSION < 3
27499     Py_XDECREF(py_import);
27500     #endif
27501     Py_XDECREF(empty_list);
27502     Py_XDECREF(empty_dict);
27503     return module;
27504 }
27505 
27506 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)27507 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
27508     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
27509     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
27510         PyErr_Format(PyExc_ImportError,
27511         #if PY_MAJOR_VERSION < 3
27512             "cannot import name %.230s", PyString_AS_STRING(name));
27513         #else
27514             "cannot import name %S", name);
27515         #endif
27516     }
27517     return value;
27518 }
27519 
27520 /* RaiseException */
27521 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)27522 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
27523                         CYTHON_UNUSED PyObject *cause) {
27524     __Pyx_PyThreadState_declare
27525     Py_XINCREF(type);
27526     if (!value || value == Py_None)
27527         value = NULL;
27528     else
27529         Py_INCREF(value);
27530     if (!tb || tb == Py_None)
27531         tb = NULL;
27532     else {
27533         Py_INCREF(tb);
27534         if (!PyTraceBack_Check(tb)) {
27535             PyErr_SetString(PyExc_TypeError,
27536                 "raise: arg 3 must be a traceback or None");
27537             goto raise_error;
27538         }
27539     }
27540     if (PyType_Check(type)) {
27541 #if CYTHON_COMPILING_IN_PYPY
27542         if (!value) {
27543             Py_INCREF(Py_None);
27544             value = Py_None;
27545         }
27546 #endif
27547         PyErr_NormalizeException(&type, &value, &tb);
27548     } else {
27549         if (value) {
27550             PyErr_SetString(PyExc_TypeError,
27551                 "instance exception may not have a separate value");
27552             goto raise_error;
27553         }
27554         value = type;
27555         type = (PyObject*) Py_TYPE(type);
27556         Py_INCREF(type);
27557         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
27558             PyErr_SetString(PyExc_TypeError,
27559                 "raise: exception class must be a subclass of BaseException");
27560             goto raise_error;
27561         }
27562     }
27563     __Pyx_PyThreadState_assign
27564     __Pyx_ErrRestore(type, value, tb);
27565     return;
27566 raise_error:
27567     Py_XDECREF(value);
27568     Py_XDECREF(type);
27569     Py_XDECREF(tb);
27570     return;
27571 }
27572 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)27573 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
27574     PyObject* owned_instance = NULL;
27575     if (tb == Py_None) {
27576         tb = 0;
27577     } else if (tb && !PyTraceBack_Check(tb)) {
27578         PyErr_SetString(PyExc_TypeError,
27579             "raise: arg 3 must be a traceback or None");
27580         goto bad;
27581     }
27582     if (value == Py_None)
27583         value = 0;
27584     if (PyExceptionInstance_Check(type)) {
27585         if (value) {
27586             PyErr_SetString(PyExc_TypeError,
27587                 "instance exception may not have a separate value");
27588             goto bad;
27589         }
27590         value = type;
27591         type = (PyObject*) Py_TYPE(value);
27592     } else if (PyExceptionClass_Check(type)) {
27593         PyObject *instance_class = NULL;
27594         if (value && PyExceptionInstance_Check(value)) {
27595             instance_class = (PyObject*) Py_TYPE(value);
27596             if (instance_class != type) {
27597                 int is_subclass = PyObject_IsSubclass(instance_class, type);
27598                 if (!is_subclass) {
27599                     instance_class = NULL;
27600                 } else if (unlikely(is_subclass == -1)) {
27601                     goto bad;
27602                 } else {
27603                     type = instance_class;
27604                 }
27605             }
27606         }
27607         if (!instance_class) {
27608             PyObject *args;
27609             if (!value)
27610                 args = PyTuple_New(0);
27611             else if (PyTuple_Check(value)) {
27612                 Py_INCREF(value);
27613                 args = value;
27614             } else
27615                 args = PyTuple_Pack(1, value);
27616             if (!args)
27617                 goto bad;
27618             owned_instance = PyObject_Call(type, args, NULL);
27619             Py_DECREF(args);
27620             if (!owned_instance)
27621                 goto bad;
27622             value = owned_instance;
27623             if (!PyExceptionInstance_Check(value)) {
27624                 PyErr_Format(PyExc_TypeError,
27625                              "calling %R should have returned an instance of "
27626                              "BaseException, not %R",
27627                              type, Py_TYPE(value));
27628                 goto bad;
27629             }
27630         }
27631     } else {
27632         PyErr_SetString(PyExc_TypeError,
27633             "raise: exception class must be a subclass of BaseException");
27634         goto bad;
27635     }
27636     if (cause) {
27637         PyObject *fixed_cause;
27638         if (cause == Py_None) {
27639             fixed_cause = NULL;
27640         } else if (PyExceptionClass_Check(cause)) {
27641             fixed_cause = PyObject_CallObject(cause, NULL);
27642             if (fixed_cause == NULL)
27643                 goto bad;
27644         } else if (PyExceptionInstance_Check(cause)) {
27645             fixed_cause = cause;
27646             Py_INCREF(fixed_cause);
27647         } else {
27648             PyErr_SetString(PyExc_TypeError,
27649                             "exception causes must derive from "
27650                             "BaseException");
27651             goto bad;
27652         }
27653         PyException_SetCause(value, fixed_cause);
27654     }
27655     PyErr_SetObject(type, value);
27656     if (tb) {
27657 #if CYTHON_COMPILING_IN_PYPY
27658         PyObject *tmp_type, *tmp_value, *tmp_tb;
27659         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
27660         Py_INCREF(tb);
27661         PyErr_Restore(tmp_type, tmp_value, tb);
27662         Py_XDECREF(tmp_tb);
27663 #else
27664         PyThreadState *tstate = __Pyx_PyThreadState_Current;
27665         PyObject* tmp_tb = tstate->curexc_traceback;
27666         if (tb != tmp_tb) {
27667             Py_INCREF(tb);
27668             tstate->curexc_traceback = tb;
27669             Py_XDECREF(tmp_tb);
27670         }
27671 #endif
27672     }
27673 bad:
27674     Py_XDECREF(owned_instance);
27675     return;
27676 }
27677 #endif
27678 
27679 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)27680 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
27681     PyObject *r;
27682     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
27683         PyErr_SetString(PyExc_TypeError,
27684                         "hasattr(): attribute name must be string");
27685         return -1;
27686     }
27687     r = __Pyx_GetAttr(o, n);
27688     if (unlikely(!r)) {
27689         PyErr_Clear();
27690         return 0;
27691     } else {
27692         Py_DECREF(r);
27693         return 1;
27694     }
27695 }
27696 
27697 /* GetTopmostException */
27698 #if CYTHON_USE_EXC_INFO_STACK
27699 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)27700 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
27701 {
27702     _PyErr_StackItem *exc_info = tstate->exc_info;
27703     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
27704            exc_info->previous_item != NULL)
27705     {
27706         exc_info = exc_info->previous_item;
27707     }
27708     return exc_info;
27709 }
27710 #endif
27711 
27712 /* SaveResetException */
27713 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)27714 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27715     #if CYTHON_USE_EXC_INFO_STACK
27716     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
27717     *type = exc_info->exc_type;
27718     *value = exc_info->exc_value;
27719     *tb = exc_info->exc_traceback;
27720     #else
27721     *type = tstate->exc_type;
27722     *value = tstate->exc_value;
27723     *tb = tstate->exc_traceback;
27724     #endif
27725     Py_XINCREF(*type);
27726     Py_XINCREF(*value);
27727     Py_XINCREF(*tb);
27728 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)27729 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
27730     PyObject *tmp_type, *tmp_value, *tmp_tb;
27731     #if CYTHON_USE_EXC_INFO_STACK
27732     _PyErr_StackItem *exc_info = tstate->exc_info;
27733     tmp_type = exc_info->exc_type;
27734     tmp_value = exc_info->exc_value;
27735     tmp_tb = exc_info->exc_traceback;
27736     exc_info->exc_type = type;
27737     exc_info->exc_value = value;
27738     exc_info->exc_traceback = tb;
27739     #else
27740     tmp_type = tstate->exc_type;
27741     tmp_value = tstate->exc_value;
27742     tmp_tb = tstate->exc_traceback;
27743     tstate->exc_type = type;
27744     tstate->exc_value = value;
27745     tstate->exc_traceback = tb;
27746     #endif
27747     Py_XDECREF(tmp_type);
27748     Py_XDECREF(tmp_value);
27749     Py_XDECREF(tmp_tb);
27750 }
27751 #endif
27752 
27753 /* GetException */
27754 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)27755 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
27756 #else
27757 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
27758 #endif
27759 {
27760     PyObject *local_type, *local_value, *local_tb;
27761 #if CYTHON_FAST_THREAD_STATE
27762     PyObject *tmp_type, *tmp_value, *tmp_tb;
27763     local_type = tstate->curexc_type;
27764     local_value = tstate->curexc_value;
27765     local_tb = tstate->curexc_traceback;
27766     tstate->curexc_type = 0;
27767     tstate->curexc_value = 0;
27768     tstate->curexc_traceback = 0;
27769 #else
27770     PyErr_Fetch(&local_type, &local_value, &local_tb);
27771 #endif
27772     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
27773 #if CYTHON_FAST_THREAD_STATE
27774     if (unlikely(tstate->curexc_type))
27775 #else
27776     if (unlikely(PyErr_Occurred()))
27777 #endif
27778         goto bad;
27779     #if PY_MAJOR_VERSION >= 3
27780     if (local_tb) {
27781         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
27782             goto bad;
27783     }
27784     #endif
27785     Py_XINCREF(local_tb);
27786     Py_XINCREF(local_type);
27787     Py_XINCREF(local_value);
27788     *type = local_type;
27789     *value = local_value;
27790     *tb = local_tb;
27791 #if CYTHON_FAST_THREAD_STATE
27792     #if CYTHON_USE_EXC_INFO_STACK
27793     {
27794         _PyErr_StackItem *exc_info = tstate->exc_info;
27795         tmp_type = exc_info->exc_type;
27796         tmp_value = exc_info->exc_value;
27797         tmp_tb = exc_info->exc_traceback;
27798         exc_info->exc_type = local_type;
27799         exc_info->exc_value = local_value;
27800         exc_info->exc_traceback = local_tb;
27801     }
27802     #else
27803     tmp_type = tstate->exc_type;
27804     tmp_value = tstate->exc_value;
27805     tmp_tb = tstate->exc_traceback;
27806     tstate->exc_type = local_type;
27807     tstate->exc_value = local_value;
27808     tstate->exc_traceback = local_tb;
27809     #endif
27810     Py_XDECREF(tmp_type);
27811     Py_XDECREF(tmp_value);
27812     Py_XDECREF(tmp_tb);
27813 #else
27814     PyErr_SetExcInfo(local_type, local_value, local_tb);
27815 #endif
27816     return 0;
27817 bad:
27818     *type = 0;
27819     *value = 0;
27820     *tb = 0;
27821     Py_XDECREF(local_type);
27822     Py_XDECREF(local_value);
27823     Py_XDECREF(local_tb);
27824     return -1;
27825 }
27826 
27827 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)27828 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
27829 #if CYTHON_COMPILING_IN_PYPY
27830     return PyObject_RichCompareBool(s1, s2, equals);
27831 #else
27832     if (s1 == s2) {
27833         return (equals == Py_EQ);
27834     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
27835         const char *ps1, *ps2;
27836         Py_ssize_t length = PyBytes_GET_SIZE(s1);
27837         if (length != PyBytes_GET_SIZE(s2))
27838             return (equals == Py_NE);
27839         ps1 = PyBytes_AS_STRING(s1);
27840         ps2 = PyBytes_AS_STRING(s2);
27841         if (ps1[0] != ps2[0]) {
27842             return (equals == Py_NE);
27843         } else if (length == 1) {
27844             return (equals == Py_EQ);
27845         } else {
27846             int result;
27847 #if CYTHON_USE_UNICODE_INTERNALS
27848             Py_hash_t hash1, hash2;
27849             hash1 = ((PyBytesObject*)s1)->ob_shash;
27850             hash2 = ((PyBytesObject*)s2)->ob_shash;
27851             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
27852                 return (equals == Py_NE);
27853             }
27854 #endif
27855             result = memcmp(ps1, ps2, (size_t)length);
27856             return (equals == Py_EQ) ? (result == 0) : (result != 0);
27857         }
27858     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
27859         return (equals == Py_NE);
27860     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
27861         return (equals == Py_NE);
27862     } else {
27863         int result;
27864         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
27865         if (!py_result)
27866             return -1;
27867         result = __Pyx_PyObject_IsTrue(py_result);
27868         Py_DECREF(py_result);
27869         return result;
27870     }
27871 #endif
27872 }
27873 
27874 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)27875 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
27876 #if CYTHON_COMPILING_IN_PYPY
27877     return PyObject_RichCompareBool(s1, s2, equals);
27878 #else
27879 #if PY_MAJOR_VERSION < 3
27880     PyObject* owned_ref = NULL;
27881 #endif
27882     int s1_is_unicode, s2_is_unicode;
27883     if (s1 == s2) {
27884         goto return_eq;
27885     }
27886     s1_is_unicode = PyUnicode_CheckExact(s1);
27887     s2_is_unicode = PyUnicode_CheckExact(s2);
27888 #if PY_MAJOR_VERSION < 3
27889     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
27890         owned_ref = PyUnicode_FromObject(s2);
27891         if (unlikely(!owned_ref))
27892             return -1;
27893         s2 = owned_ref;
27894         s2_is_unicode = 1;
27895     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
27896         owned_ref = PyUnicode_FromObject(s1);
27897         if (unlikely(!owned_ref))
27898             return -1;
27899         s1 = owned_ref;
27900         s1_is_unicode = 1;
27901     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
27902         return __Pyx_PyBytes_Equals(s1, s2, equals);
27903     }
27904 #endif
27905     if (s1_is_unicode & s2_is_unicode) {
27906         Py_ssize_t length;
27907         int kind;
27908         void *data1, *data2;
27909         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
27910             return -1;
27911         length = __Pyx_PyUnicode_GET_LENGTH(s1);
27912         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
27913             goto return_ne;
27914         }
27915 #if CYTHON_USE_UNICODE_INTERNALS
27916         {
27917             Py_hash_t hash1, hash2;
27918         #if CYTHON_PEP393_ENABLED
27919             hash1 = ((PyASCIIObject*)s1)->hash;
27920             hash2 = ((PyASCIIObject*)s2)->hash;
27921         #else
27922             hash1 = ((PyUnicodeObject*)s1)->hash;
27923             hash2 = ((PyUnicodeObject*)s2)->hash;
27924         #endif
27925             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
27926                 goto return_ne;
27927             }
27928         }
27929 #endif
27930         kind = __Pyx_PyUnicode_KIND(s1);
27931         if (kind != __Pyx_PyUnicode_KIND(s2)) {
27932             goto return_ne;
27933         }
27934         data1 = __Pyx_PyUnicode_DATA(s1);
27935         data2 = __Pyx_PyUnicode_DATA(s2);
27936         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
27937             goto return_ne;
27938         } else if (length == 1) {
27939             goto return_eq;
27940         } else {
27941             int result = memcmp(data1, data2, (size_t)(length * kind));
27942             #if PY_MAJOR_VERSION < 3
27943             Py_XDECREF(owned_ref);
27944             #endif
27945             return (equals == Py_EQ) ? (result == 0) : (result != 0);
27946         }
27947     } else if ((s1 == Py_None) & s2_is_unicode) {
27948         goto return_ne;
27949     } else if ((s2 == Py_None) & s1_is_unicode) {
27950         goto return_ne;
27951     } else {
27952         int result;
27953         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
27954         #if PY_MAJOR_VERSION < 3
27955         Py_XDECREF(owned_ref);
27956         #endif
27957         if (!py_result)
27958             return -1;
27959         result = __Pyx_PyObject_IsTrue(py_result);
27960         Py_DECREF(py_result);
27961         return result;
27962     }
27963 return_eq:
27964     #if PY_MAJOR_VERSION < 3
27965     Py_XDECREF(owned_ref);
27966     #endif
27967     return (equals == Py_EQ);
27968 return_ne:
27969     #if PY_MAJOR_VERSION < 3
27970     Py_XDECREF(owned_ref);
27971     #endif
27972     return (equals == Py_NE);
27973 #endif
27974 }
27975 
27976 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)27977 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
27978     PyObject *r;
27979     if (!j) return NULL;
27980     r = PyObject_GetItem(o, j);
27981     Py_DECREF(j);
27982     return r;
27983 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)27984 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
27985                                                               CYTHON_NCP_UNUSED int wraparound,
27986                                                               CYTHON_NCP_UNUSED int boundscheck) {
27987 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27988     Py_ssize_t wrapped_i = i;
27989     if (wraparound & unlikely(i < 0)) {
27990         wrapped_i += PyList_GET_SIZE(o);
27991     }
27992     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
27993         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
27994         Py_INCREF(r);
27995         return r;
27996     }
27997     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27998 #else
27999     return PySequence_GetItem(o, i);
28000 #endif
28001 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)28002 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
28003                                                               CYTHON_NCP_UNUSED int wraparound,
28004                                                               CYTHON_NCP_UNUSED int boundscheck) {
28005 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28006     Py_ssize_t wrapped_i = i;
28007     if (wraparound & unlikely(i < 0)) {
28008         wrapped_i += PyTuple_GET_SIZE(o);
28009     }
28010     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
28011         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
28012         Py_INCREF(r);
28013         return r;
28014     }
28015     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
28016 #else
28017     return PySequence_GetItem(o, i);
28018 #endif
28019 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)28020 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
28021                                                      CYTHON_NCP_UNUSED int wraparound,
28022                                                      CYTHON_NCP_UNUSED int boundscheck) {
28023 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
28024     if (is_list || PyList_CheckExact(o)) {
28025         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
28026         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
28027             PyObject *r = PyList_GET_ITEM(o, n);
28028             Py_INCREF(r);
28029             return r;
28030         }
28031     }
28032     else if (PyTuple_CheckExact(o)) {
28033         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
28034         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
28035             PyObject *r = PyTuple_GET_ITEM(o, n);
28036             Py_INCREF(r);
28037             return r;
28038         }
28039     } else {
28040         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
28041         if (likely(m && m->sq_item)) {
28042             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
28043                 Py_ssize_t l = m->sq_length(o);
28044                 if (likely(l >= 0)) {
28045                     i += l;
28046                 } else {
28047                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
28048                         return NULL;
28049                     PyErr_Clear();
28050                 }
28051             }
28052             return m->sq_item(o, i);
28053         }
28054     }
28055 #else
28056     if (is_list || PySequence_Check(o)) {
28057         return PySequence_GetItem(o, i);
28058     }
28059 #endif
28060     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
28061 }
28062 
28063 /* ObjectGetItem */
28064 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)28065 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
28066     PyObject *runerr;
28067     Py_ssize_t key_value;
28068     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
28069     if (unlikely(!(m && m->sq_item))) {
28070         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
28071         return NULL;
28072     }
28073     key_value = __Pyx_PyIndex_AsSsize_t(index);
28074     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
28075         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
28076     }
28077     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
28078         PyErr_Clear();
28079         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
28080     }
28081     return NULL;
28082 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)28083 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
28084     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
28085     if (likely(m && m->mp_subscript)) {
28086         return m->mp_subscript(obj, key);
28087     }
28088     return __Pyx_PyObject_GetIndex(obj, key);
28089 }
28090 #endif
28091 
28092 /* decode_c_string */
__Pyx_decode_c_string(const char * cstring,Py_ssize_t start,Py_ssize_t stop,const char * encoding,const char * errors,PyObject * (* decode_func)(const char * s,Py_ssize_t size,const char * errors))28093 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
28094          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
28095          const char* encoding, const char* errors,
28096          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
28097     Py_ssize_t length;
28098     if (unlikely((start < 0) | (stop < 0))) {
28099         size_t slen = strlen(cstring);
28100         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
28101             PyErr_SetString(PyExc_OverflowError,
28102                             "c-string too long to convert to Python");
28103             return NULL;
28104         }
28105         length = (Py_ssize_t) slen;
28106         if (start < 0) {
28107             start += length;
28108             if (start < 0)
28109                 start = 0;
28110         }
28111         if (stop < 0)
28112             stop += length;
28113     }
28114     if (unlikely(stop <= start))
28115         return __Pyx_NewRef(__pyx_empty_unicode);
28116     length = stop - start;
28117     cstring += start;
28118     if (decode_func) {
28119         return decode_func(cstring, length, errors);
28120     } else {
28121         return PyUnicode_Decode(cstring, length, encoding, errors);
28122     }
28123 }
28124 
28125 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)28126 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
28127     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
28128 }
28129 
28130 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)28131 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
28132     if (unlikely(!type)) {
28133         PyErr_SetString(PyExc_SystemError, "Missing type object");
28134         return 0;
28135     }
28136     if (likely(__Pyx_TypeCheck(obj, type)))
28137         return 1;
28138     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
28139                  Py_TYPE(obj)->tp_name, type->tp_name);
28140     return 0;
28141 }
28142 
28143 /* SwapException */
28144 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)28145 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28146     PyObject *tmp_type, *tmp_value, *tmp_tb;
28147     #if CYTHON_USE_EXC_INFO_STACK
28148     _PyErr_StackItem *exc_info = tstate->exc_info;
28149     tmp_type = exc_info->exc_type;
28150     tmp_value = exc_info->exc_value;
28151     tmp_tb = exc_info->exc_traceback;
28152     exc_info->exc_type = *type;
28153     exc_info->exc_value = *value;
28154     exc_info->exc_traceback = *tb;
28155     #else
28156     tmp_type = tstate->exc_type;
28157     tmp_value = tstate->exc_value;
28158     tmp_tb = tstate->exc_traceback;
28159     tstate->exc_type = *type;
28160     tstate->exc_value = *value;
28161     tstate->exc_traceback = *tb;
28162     #endif
28163     *type = tmp_type;
28164     *value = tmp_value;
28165     *tb = tmp_tb;
28166 }
28167 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)28168 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
28169     PyObject *tmp_type, *tmp_value, *tmp_tb;
28170     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
28171     PyErr_SetExcInfo(*type, *value, *tb);
28172     *type = tmp_type;
28173     *value = tmp_value;
28174     *tb = tmp_tb;
28175 }
28176 #endif
28177 
28178 /* FastTypeChecks */
28179 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)28180 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
28181     while (a) {
28182         a = a->tp_base;
28183         if (a == b)
28184             return 1;
28185     }
28186     return b == &PyBaseObject_Type;
28187 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)28188 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
28189     PyObject *mro;
28190     if (a == b) return 1;
28191     mro = a->tp_mro;
28192     if (likely(mro)) {
28193         Py_ssize_t i, n;
28194         n = PyTuple_GET_SIZE(mro);
28195         for (i = 0; i < n; i++) {
28196             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
28197                 return 1;
28198         }
28199         return 0;
28200     }
28201     return __Pyx_InBases(a, b);
28202 }
28203 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)28204 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
28205     PyObject *exception, *value, *tb;
28206     int res;
28207     __Pyx_PyThreadState_declare
28208     __Pyx_PyThreadState_assign
28209     __Pyx_ErrFetch(&exception, &value, &tb);
28210     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
28211     if (unlikely(res == -1)) {
28212         PyErr_WriteUnraisable(err);
28213         res = 0;
28214     }
28215     if (!res) {
28216         res = PyObject_IsSubclass(err, exc_type2);
28217         if (unlikely(res == -1)) {
28218             PyErr_WriteUnraisable(err);
28219             res = 0;
28220         }
28221     }
28222     __Pyx_ErrRestore(exception, value, tb);
28223     return res;
28224 }
28225 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)28226 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
28227     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
28228     if (!res) {
28229         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
28230     }
28231     return res;
28232 }
28233 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)28234 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28235     Py_ssize_t i, n;
28236     assert(PyExceptionClass_Check(exc_type));
28237     n = PyTuple_GET_SIZE(tuple);
28238 #if PY_MAJOR_VERSION >= 3
28239     for (i=0; i<n; i++) {
28240         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
28241     }
28242 #endif
28243     for (i=0; i<n; i++) {
28244         PyObject *t = PyTuple_GET_ITEM(tuple, i);
28245         #if PY_MAJOR_VERSION < 3
28246         if (likely(exc_type == t)) return 1;
28247         #endif
28248         if (likely(PyExceptionClass_Check(t))) {
28249             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
28250         } else {
28251         }
28252     }
28253     return 0;
28254 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)28255 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
28256     if (likely(err == exc_type)) return 1;
28257     if (likely(PyExceptionClass_Check(err))) {
28258         if (likely(PyExceptionClass_Check(exc_type))) {
28259             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
28260         } else if (likely(PyTuple_Check(exc_type))) {
28261             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
28262         } else {
28263         }
28264     }
28265     return PyErr_GivenExceptionMatches(err, exc_type);
28266 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)28267 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
28268     assert(PyExceptionClass_Check(exc_type1));
28269     assert(PyExceptionClass_Check(exc_type2));
28270     if (likely(err == exc_type1 || err == exc_type2)) return 1;
28271     if (likely(PyExceptionClass_Check(err))) {
28272         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
28273     }
28274     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
28275 }
28276 #endif
28277 
28278 /* PyIntBinop */
28279 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)28280 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
28281     (void)inplace;
28282     (void)zerodivision_check;
28283     #if PY_MAJOR_VERSION < 3
28284     if (likely(PyInt_CheckExact(op1))) {
28285         const long b = intval;
28286         long x;
28287         long a = PyInt_AS_LONG(op1);
28288             x = (long)((unsigned long)a + b);
28289             if (likely((x^a) >= 0 || (x^b) >= 0))
28290                 return PyInt_FromLong(x);
28291             return PyLong_Type.tp_as_number->nb_add(op1, op2);
28292     }
28293     #endif
28294     #if CYTHON_USE_PYLONG_INTERNALS
28295     if (likely(PyLong_CheckExact(op1))) {
28296         const long b = intval;
28297         long a, x;
28298 #ifdef HAVE_LONG_LONG
28299         const PY_LONG_LONG llb = intval;
28300         PY_LONG_LONG lla, llx;
28301 #endif
28302         const digit* digits = ((PyLongObject*)op1)->ob_digit;
28303         const Py_ssize_t size = Py_SIZE(op1);
28304         if (likely(__Pyx_sst_abs(size) <= 1)) {
28305             a = likely(size) ? digits[0] : 0;
28306             if (size == -1) a = -a;
28307         } else {
28308             switch (size) {
28309                 case -2:
28310                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28311                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28312                         break;
28313 #ifdef HAVE_LONG_LONG
28314                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
28315                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
28316                         goto long_long;
28317 #endif
28318                     }
28319                     CYTHON_FALLTHROUGH;
28320                 case 2:
28321                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28322                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28323                         break;
28324 #ifdef HAVE_LONG_LONG
28325                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
28326                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
28327                         goto long_long;
28328 #endif
28329                     }
28330                     CYTHON_FALLTHROUGH;
28331                 case -3:
28332                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28333                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28334                         break;
28335 #ifdef HAVE_LONG_LONG
28336                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
28337                         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]));
28338                         goto long_long;
28339 #endif
28340                     }
28341                     CYTHON_FALLTHROUGH;
28342                 case 3:
28343                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28344                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28345                         break;
28346 #ifdef HAVE_LONG_LONG
28347                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
28348                         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]));
28349                         goto long_long;
28350 #endif
28351                     }
28352                     CYTHON_FALLTHROUGH;
28353                 case -4:
28354                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28355                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28356                         break;
28357 #ifdef HAVE_LONG_LONG
28358                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
28359                         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]));
28360                         goto long_long;
28361 #endif
28362                     }
28363                     CYTHON_FALLTHROUGH;
28364                 case 4:
28365                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28366                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28367                         break;
28368 #ifdef HAVE_LONG_LONG
28369                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
28370                         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]));
28371                         goto long_long;
28372 #endif
28373                     }
28374                     CYTHON_FALLTHROUGH;
28375                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
28376             }
28377         }
28378                 x = a + b;
28379             return PyLong_FromLong(x);
28380 #ifdef HAVE_LONG_LONG
28381         long_long:
28382                 llx = lla + llb;
28383             return PyLong_FromLongLong(llx);
28384 #endif
28385 
28386 
28387     }
28388     #endif
28389     if (PyFloat_CheckExact(op1)) {
28390         const long b = intval;
28391         double a = PyFloat_AS_DOUBLE(op1);
28392             double result;
28393             PyFPE_START_PROTECT("add", return NULL)
28394             result = ((double)a) + (double)b;
28395             PyFPE_END_PROTECT(result)
28396             return PyFloat_FromDouble(result);
28397     }
28398     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
28399 }
28400 #endif
28401 
28402 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)28403 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
28404     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
28405 }
28406 
28407 /* PyObject_GenericGetAttrNoDict */
28408 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)28409 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
28410     PyErr_Format(PyExc_AttributeError,
28411 #if PY_MAJOR_VERSION >= 3
28412                  "'%.50s' object has no attribute '%U'",
28413                  tp->tp_name, attr_name);
28414 #else
28415                  "'%.50s' object has no attribute '%.400s'",
28416                  tp->tp_name, PyString_AS_STRING(attr_name));
28417 #endif
28418     return NULL;
28419 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)28420 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
28421     PyObject *descr;
28422     PyTypeObject *tp = Py_TYPE(obj);
28423     if (unlikely(!PyString_Check(attr_name))) {
28424         return PyObject_GenericGetAttr(obj, attr_name);
28425     }
28426     assert(!tp->tp_dictoffset);
28427     descr = _PyType_Lookup(tp, attr_name);
28428     if (unlikely(!descr)) {
28429         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
28430     }
28431     Py_INCREF(descr);
28432     #if PY_MAJOR_VERSION < 3
28433     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
28434     #endif
28435     {
28436         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
28437         if (unlikely(f)) {
28438             PyObject *res = f(descr, obj, (PyObject *)tp);
28439             Py_DECREF(descr);
28440             return res;
28441         }
28442     }
28443     return descr;
28444 }
28445 #endif
28446 
28447 /* PyObject_GenericGetAttr */
28448 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)28449 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
28450     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
28451         return PyObject_GenericGetAttr(obj, attr_name);
28452     }
28453     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
28454 }
28455 #endif
28456 
28457 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)28458 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
28459     __Pyx_PyThreadState_declare
28460     __Pyx_PyThreadState_assign
28461     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28462         __Pyx_PyErr_Clear();
28463 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)28464 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28465     PyObject *result;
28466 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
28467     PyTypeObject* tp = Py_TYPE(obj);
28468     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28469         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28470     }
28471 #endif
28472     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28473     if (unlikely(!result)) {
28474         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28475     }
28476     return result;
28477 }
28478 
28479 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)28480 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
28481   int ret;
28482   PyObject *name_attr;
28483   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
28484   if (likely(name_attr)) {
28485       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
28486   } else {
28487       ret = -1;
28488   }
28489   if (unlikely(ret < 0)) {
28490       PyErr_Clear();
28491       ret = 0;
28492   }
28493   Py_XDECREF(name_attr);
28494   return ret;
28495 }
__Pyx_setup_reduce(PyObject * type_obj)28496 static int __Pyx_setup_reduce(PyObject* type_obj) {
28497     int ret = 0;
28498     PyObject *object_reduce = NULL;
28499     PyObject *object_reduce_ex = NULL;
28500     PyObject *reduce = NULL;
28501     PyObject *reduce_ex = NULL;
28502     PyObject *reduce_cython = NULL;
28503     PyObject *setstate = NULL;
28504     PyObject *setstate_cython = NULL;
28505 #if CYTHON_USE_PYTYPE_LOOKUP
28506     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
28507 #else
28508     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
28509 #endif
28510 #if CYTHON_USE_PYTYPE_LOOKUP
28511     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
28512 #else
28513     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
28514 #endif
28515     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
28516     if (reduce_ex == object_reduce_ex) {
28517 #if CYTHON_USE_PYTYPE_LOOKUP
28518         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
28519 #else
28520         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
28521 #endif
28522         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
28523         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
28524             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
28525             if (likely(reduce_cython)) {
28526                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28527                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28528             } else if (reduce == object_reduce || PyErr_Occurred()) {
28529                 goto __PYX_BAD;
28530             }
28531             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
28532             if (!setstate) PyErr_Clear();
28533             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
28534                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
28535                 if (likely(setstate_cython)) {
28536                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28537                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28538                 } else if (!setstate || PyErr_Occurred()) {
28539                     goto __PYX_BAD;
28540                 }
28541             }
28542             PyType_Modified((PyTypeObject*)type_obj);
28543         }
28544     }
28545     goto __PYX_GOOD;
28546 __PYX_BAD:
28547     if (!PyErr_Occurred())
28548         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
28549     ret = -1;
28550 __PYX_GOOD:
28551 #if !CYTHON_USE_PYTYPE_LOOKUP
28552     Py_XDECREF(object_reduce);
28553     Py_XDECREF(object_reduce_ex);
28554 #endif
28555     Py_XDECREF(reduce);
28556     Py_XDECREF(reduce_ex);
28557     Py_XDECREF(reduce_cython);
28558     Py_XDECREF(setstate);
28559     Py_XDECREF(setstate_cython);
28560     return ret;
28561 }
28562 
28563 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)28564 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
28565 #if PY_VERSION_HEX >= 0x02070000
28566     PyObject *ob = PyCapsule_New(vtable, 0, 0);
28567 #else
28568     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
28569 #endif
28570     if (!ob)
28571         goto bad;
28572     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
28573         goto bad;
28574     Py_DECREF(ob);
28575     return 0;
28576 bad:
28577     Py_XDECREF(ob);
28578     return -1;
28579 }
28580 
28581 /* TypeImport */
28582 #ifndef __PYX_HAVE_RT_ImportType
28583 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)28584 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
28585     size_t size, enum __Pyx_ImportType_CheckSize check_size)
28586 {
28587     PyObject *result = 0;
28588     char warning[200];
28589     Py_ssize_t basicsize;
28590 #ifdef Py_LIMITED_API
28591     PyObject *py_basicsize;
28592 #endif
28593     result = PyObject_GetAttrString(module, class_name);
28594     if (!result)
28595         goto bad;
28596     if (!PyType_Check(result)) {
28597         PyErr_Format(PyExc_TypeError,
28598             "%.200s.%.200s is not a type object",
28599             module_name, class_name);
28600         goto bad;
28601     }
28602 #ifndef Py_LIMITED_API
28603     basicsize = ((PyTypeObject *)result)->tp_basicsize;
28604 #else
28605     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
28606     if (!py_basicsize)
28607         goto bad;
28608     basicsize = PyLong_AsSsize_t(py_basicsize);
28609     Py_DECREF(py_basicsize);
28610     py_basicsize = 0;
28611     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
28612         goto bad;
28613 #endif
28614     if ((size_t)basicsize < size) {
28615         PyErr_Format(PyExc_ValueError,
28616             "%.200s.%.200s size changed, may indicate binary incompatibility. "
28617             "Expected %zd from C header, got %zd from PyObject",
28618             module_name, class_name, size, basicsize);
28619         goto bad;
28620     }
28621     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
28622         PyErr_Format(PyExc_ValueError,
28623             "%.200s.%.200s size changed, may indicate binary incompatibility. "
28624             "Expected %zd from C header, got %zd from PyObject",
28625             module_name, class_name, size, basicsize);
28626         goto bad;
28627     }
28628     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
28629         PyOS_snprintf(warning, sizeof(warning),
28630             "%s.%s size changed, may indicate binary incompatibility. "
28631             "Expected %zd from C header, got %zd from PyObject",
28632             module_name, class_name, size, basicsize);
28633         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
28634     }
28635     return (PyTypeObject *)result;
28636 bad:
28637     Py_XDECREF(result);
28638     return NULL;
28639 }
28640 #endif
28641 
28642 /* CLineInTraceback */
28643 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)28644 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
28645     PyObject *use_cline;
28646     PyObject *ptype, *pvalue, *ptraceback;
28647 #if CYTHON_COMPILING_IN_CPYTHON
28648     PyObject **cython_runtime_dict;
28649 #endif
28650     if (unlikely(!__pyx_cython_runtime)) {
28651         return c_line;
28652     }
28653     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
28654 #if CYTHON_COMPILING_IN_CPYTHON
28655     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
28656     if (likely(cython_runtime_dict)) {
28657         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
28658             use_cline, *cython_runtime_dict,
28659             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
28660     } else
28661 #endif
28662     {
28663       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
28664       if (use_cline_obj) {
28665         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
28666         Py_DECREF(use_cline_obj);
28667       } else {
28668         PyErr_Clear();
28669         use_cline = NULL;
28670       }
28671     }
28672     if (!use_cline) {
28673         c_line = 0;
28674         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
28675     }
28676     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
28677         c_line = 0;
28678     }
28679     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
28680     return c_line;
28681 }
28682 #endif
28683 
28684 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)28685 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
28686     int start = 0, mid = 0, end = count - 1;
28687     if (end >= 0 && code_line > entries[end].code_line) {
28688         return count;
28689     }
28690     while (start < end) {
28691         mid = start + (end - start) / 2;
28692         if (code_line < entries[mid].code_line) {
28693             end = mid;
28694         } else if (code_line > entries[mid].code_line) {
28695              start = mid + 1;
28696         } else {
28697             return mid;
28698         }
28699     }
28700     if (code_line <= entries[mid].code_line) {
28701         return mid;
28702     } else {
28703         return mid + 1;
28704     }
28705 }
__pyx_find_code_object(int code_line)28706 static PyCodeObject *__pyx_find_code_object(int code_line) {
28707     PyCodeObject* code_object;
28708     int pos;
28709     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
28710         return NULL;
28711     }
28712     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
28713     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
28714         return NULL;
28715     }
28716     code_object = __pyx_code_cache.entries[pos].code_object;
28717     Py_INCREF(code_object);
28718     return code_object;
28719 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)28720 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
28721     int pos, i;
28722     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
28723     if (unlikely(!code_line)) {
28724         return;
28725     }
28726     if (unlikely(!entries)) {
28727         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
28728         if (likely(entries)) {
28729             __pyx_code_cache.entries = entries;
28730             __pyx_code_cache.max_count = 64;
28731             __pyx_code_cache.count = 1;
28732             entries[0].code_line = code_line;
28733             entries[0].code_object = code_object;
28734             Py_INCREF(code_object);
28735         }
28736         return;
28737     }
28738     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
28739     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
28740         PyCodeObject* tmp = entries[pos].code_object;
28741         entries[pos].code_object = code_object;
28742         Py_DECREF(tmp);
28743         return;
28744     }
28745     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
28746         int new_max = __pyx_code_cache.max_count + 64;
28747         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
28748             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
28749         if (unlikely(!entries)) {
28750             return;
28751         }
28752         __pyx_code_cache.entries = entries;
28753         __pyx_code_cache.max_count = new_max;
28754     }
28755     for (i=__pyx_code_cache.count; i>pos; i--) {
28756         entries[i] = entries[i-1];
28757     }
28758     entries[pos].code_line = code_line;
28759     entries[pos].code_object = code_object;
28760     __pyx_code_cache.count++;
28761     Py_INCREF(code_object);
28762 }
28763 
28764 /* AddTraceback */
28765 #include "compile.h"
28766 #include "frameobject.h"
28767 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)28768 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
28769             const char *funcname, int c_line,
28770             int py_line, const char *filename) {
28771     PyCodeObject *py_code = 0;
28772     PyObject *py_srcfile = 0;
28773     PyObject *py_funcname = 0;
28774     #if PY_MAJOR_VERSION < 3
28775     py_srcfile = PyString_FromString(filename);
28776     #else
28777     py_srcfile = PyUnicode_FromString(filename);
28778     #endif
28779     if (!py_srcfile) goto bad;
28780     if (c_line) {
28781         #if PY_MAJOR_VERSION < 3
28782         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
28783         #else
28784         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
28785         #endif
28786     }
28787     else {
28788         #if PY_MAJOR_VERSION < 3
28789         py_funcname = PyString_FromString(funcname);
28790         #else
28791         py_funcname = PyUnicode_FromString(funcname);
28792         #endif
28793     }
28794     if (!py_funcname) goto bad;
28795     py_code = __Pyx_PyCode_New(
28796         0,
28797         0,
28798         0,
28799         0,
28800         0,
28801         __pyx_empty_bytes, /*PyObject *code,*/
28802         __pyx_empty_tuple, /*PyObject *consts,*/
28803         __pyx_empty_tuple, /*PyObject *names,*/
28804         __pyx_empty_tuple, /*PyObject *varnames,*/
28805         __pyx_empty_tuple, /*PyObject *freevars,*/
28806         __pyx_empty_tuple, /*PyObject *cellvars,*/
28807         py_srcfile,   /*PyObject *filename,*/
28808         py_funcname,  /*PyObject *name,*/
28809         py_line,
28810         __pyx_empty_bytes  /*PyObject *lnotab*/
28811     );
28812     Py_DECREF(py_srcfile);
28813     Py_DECREF(py_funcname);
28814     return py_code;
28815 bad:
28816     Py_XDECREF(py_srcfile);
28817     Py_XDECREF(py_funcname);
28818     return NULL;
28819 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)28820 static void __Pyx_AddTraceback(const char *funcname, int c_line,
28821                                int py_line, const char *filename) {
28822     PyCodeObject *py_code = 0;
28823     PyFrameObject *py_frame = 0;
28824     PyThreadState *tstate = __Pyx_PyThreadState_Current;
28825     if (c_line) {
28826         c_line = __Pyx_CLineForTraceback(tstate, c_line);
28827     }
28828     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
28829     if (!py_code) {
28830         py_code = __Pyx_CreateCodeObjectForTraceback(
28831             funcname, c_line, py_line, filename);
28832         if (!py_code) goto bad;
28833         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
28834     }
28835     py_frame = PyFrame_New(
28836         tstate,            /*PyThreadState *tstate,*/
28837         py_code,           /*PyCodeObject *code,*/
28838         __pyx_d,    /*PyObject *globals,*/
28839         0                  /*PyObject *locals*/
28840     );
28841     if (!py_frame) goto bad;
28842     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
28843     PyTraceBack_Here(py_frame);
28844 bad:
28845     Py_XDECREF(py_code);
28846     Py_XDECREF(py_frame);
28847 }
28848 
28849 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)28850 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
28851     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
28852         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
28853         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
28854     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
28855     return -1;
28856 }
__Pyx_ReleaseBuffer(Py_buffer * view)28857 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
28858     PyObject *obj = view->obj;
28859     if (!obj) return;
28860     if (PyObject_CheckBuffer(obj)) {
28861         PyBuffer_Release(view);
28862         return;
28863     }
28864     if ((0)) {}
28865     view->obj = NULL;
28866     Py_DECREF(obj);
28867 }
28868 #endif
28869 
28870 
28871 /* MemviewSliceIsContig */
28872 static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)28873 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
28874 {
28875     int i, index, step, start;
28876     Py_ssize_t itemsize = mvs.memview->view.itemsize;
28877     if (order == 'F') {
28878         step = 1;
28879         start = 0;
28880     } else {
28881         step = -1;
28882         start = ndim - 1;
28883     }
28884     for (i = 0; i < ndim; i++) {
28885         index = start + step * i;
28886         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
28887             return 0;
28888         itemsize *= mvs.shape[index];
28889     }
28890     return 1;
28891 }
28892 
28893 /* OverlappingSlices */
28894 static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)28895 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
28896                                void **out_start, void **out_end,
28897                                int ndim, size_t itemsize)
28898 {
28899     char *start, *end;
28900     int i;
28901     start = end = slice->data;
28902     for (i = 0; i < ndim; i++) {
28903         Py_ssize_t stride = slice->strides[i];
28904         Py_ssize_t extent = slice->shape[i];
28905         if (extent == 0) {
28906             *out_start = *out_end = start;
28907             return;
28908         } else {
28909             if (stride > 0)
28910                 end += stride * (extent - 1);
28911             else
28912                 start += stride * (extent - 1);
28913         }
28914     }
28915     *out_start = start;
28916     *out_end = end + itemsize;
28917 }
28918 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)28919 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
28920                      __Pyx_memviewslice *slice2,
28921                      int ndim, size_t itemsize)
28922 {
28923     void *start1, *end1, *start2, *end2;
28924     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
28925     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
28926     return (start1 < end2) && (start2 < end1);
28927 }
28928 
28929 /* Capsule */
28930 static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)28931 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
28932 {
28933     PyObject *cobj;
28934 #if PY_VERSION_HEX >= 0x02070000
28935     cobj = PyCapsule_New(p, sig, NULL);
28936 #else
28937     cobj = PyCObject_FromVoidPtr(p, NULL);
28938 #endif
28939     return cobj;
28940 }
28941 
28942 /* MemviewDtypeToObject */
__pyx_memview_get_double(const char * itemp)28943 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
28944     return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
28945 }
__pyx_memview_set_double(const char * itemp,PyObject * obj)28946 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
28947     double value = __pyx_PyFloat_AsDouble(obj);
28948     if ((value == (double)-1) && PyErr_Occurred())
28949         return 0;
28950     *(double *) itemp = value;
28951     return 1;
28952 }
28953 
28954 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)28955 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
28956 {
28957   union {
28958     uint32_t u32;
28959     uint8_t u8[4];
28960   } S;
28961   S.u32 = 0x01020304;
28962   return S.u8[0] == 4;
28963 }
28964 
28965 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)28966 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
28967                               __Pyx_BufFmt_StackElem* stack,
28968                               __Pyx_TypeInfo* type) {
28969   stack[0].field = &ctx->root;
28970   stack[0].parent_offset = 0;
28971   ctx->root.type = type;
28972   ctx->root.name = "buffer dtype";
28973   ctx->root.offset = 0;
28974   ctx->head = stack;
28975   ctx->head->field = &ctx->root;
28976   ctx->fmt_offset = 0;
28977   ctx->head->parent_offset = 0;
28978   ctx->new_packmode = '@';
28979   ctx->enc_packmode = '@';
28980   ctx->new_count = 1;
28981   ctx->enc_count = 0;
28982   ctx->enc_type = 0;
28983   ctx->is_complex = 0;
28984   ctx->is_valid_array = 0;
28985   ctx->struct_alignment = 0;
28986   while (type->typegroup == 'S') {
28987     ++ctx->head;
28988     ctx->head->field = type->fields;
28989     ctx->head->parent_offset = 0;
28990     type = type->fields->type;
28991   }
28992 }
__Pyx_BufFmt_ParseNumber(const char ** ts)28993 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
28994     int count;
28995     const char* t = *ts;
28996     if (*t < '0' || *t > '9') {
28997       return -1;
28998     } else {
28999         count = *t++ - '0';
29000         while (*t >= '0' && *t <= '9') {
29001             count *= 10;
29002             count += *t++ - '0';
29003         }
29004     }
29005     *ts = t;
29006     return count;
29007 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)29008 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
29009     int number = __Pyx_BufFmt_ParseNumber(ts);
29010     if (number == -1)
29011         PyErr_Format(PyExc_ValueError,\
29012                      "Does not understand character buffer dtype format string ('%c')", **ts);
29013     return number;
29014 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)29015 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
29016   PyErr_Format(PyExc_ValueError,
29017                "Unexpected format string character: '%c'", ch);
29018 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)29019 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
29020   switch (ch) {
29021     case '?': return "'bool'";
29022     case 'c': return "'char'";
29023     case 'b': return "'signed char'";
29024     case 'B': return "'unsigned char'";
29025     case 'h': return "'short'";
29026     case 'H': return "'unsigned short'";
29027     case 'i': return "'int'";
29028     case 'I': return "'unsigned int'";
29029     case 'l': return "'long'";
29030     case 'L': return "'unsigned long'";
29031     case 'q': return "'long long'";
29032     case 'Q': return "'unsigned long long'";
29033     case 'f': return (is_complex ? "'complex float'" : "'float'");
29034     case 'd': return (is_complex ? "'complex double'" : "'double'");
29035     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
29036     case 'T': return "a struct";
29037     case 'O': return "Python object";
29038     case 'P': return "a pointer";
29039     case 's': case 'p': return "a string";
29040     case 0: return "end";
29041     default: return "unparseable format string";
29042   }
29043 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)29044 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
29045   switch (ch) {
29046     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
29047     case 'h': case 'H': return 2;
29048     case 'i': case 'I': case 'l': case 'L': return 4;
29049     case 'q': case 'Q': return 8;
29050     case 'f': return (is_complex ? 8 : 4);
29051     case 'd': return (is_complex ? 16 : 8);
29052     case 'g': {
29053       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
29054       return 0;
29055     }
29056     case 'O': case 'P': return sizeof(void*);
29057     default:
29058       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29059       return 0;
29060     }
29061 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)29062 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
29063   switch (ch) {
29064     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
29065     case 'h': case 'H': return sizeof(short);
29066     case 'i': case 'I': return sizeof(int);
29067     case 'l': case 'L': return sizeof(long);
29068     #ifdef HAVE_LONG_LONG
29069     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
29070     #endif
29071     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
29072     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
29073     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
29074     case 'O': case 'P': return sizeof(void*);
29075     default: {
29076       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29077       return 0;
29078     }
29079   }
29080 }
29081 typedef struct { char c; short x; } __Pyx_st_short;
29082 typedef struct { char c; int x; } __Pyx_st_int;
29083 typedef struct { char c; long x; } __Pyx_st_long;
29084 typedef struct { char c; float x; } __Pyx_st_float;
29085 typedef struct { char c; double x; } __Pyx_st_double;
29086 typedef struct { char c; long double x; } __Pyx_st_longdouble;
29087 typedef struct { char c; void *x; } __Pyx_st_void_p;
29088 #ifdef HAVE_LONG_LONG
29089 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
29090 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)29091 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
29092   switch (ch) {
29093     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
29094     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
29095     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
29096     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
29097 #ifdef HAVE_LONG_LONG
29098     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
29099 #endif
29100     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
29101     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
29102     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
29103     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
29104     default:
29105       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29106       return 0;
29107     }
29108 }
29109 /* These are for computing the padding at the end of the struct to align
29110    on the first member of the struct. This will probably the same as above,
29111    but we don't have any guarantees.
29112  */
29113 typedef struct { short x; char c; } __Pyx_pad_short;
29114 typedef struct { int x; char c; } __Pyx_pad_int;
29115 typedef struct { long x; char c; } __Pyx_pad_long;
29116 typedef struct { float x; char c; } __Pyx_pad_float;
29117 typedef struct { double x; char c; } __Pyx_pad_double;
29118 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
29119 typedef struct { void *x; char c; } __Pyx_pad_void_p;
29120 #ifdef HAVE_LONG_LONG
29121 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
29122 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)29123 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
29124   switch (ch) {
29125     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
29126     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
29127     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
29128     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
29129 #ifdef HAVE_LONG_LONG
29130     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
29131 #endif
29132     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
29133     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
29134     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
29135     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
29136     default:
29137       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29138       return 0;
29139     }
29140 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)29141 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
29142   switch (ch) {
29143     case 'c':
29144         return 'H';
29145     case 'b': case 'h': case 'i':
29146     case 'l': case 'q': case 's': case 'p':
29147         return 'I';
29148     case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
29149         return 'U';
29150     case 'f': case 'd': case 'g':
29151         return (is_complex ? 'C' : 'R');
29152     case 'O':
29153         return 'O';
29154     case 'P':
29155         return 'P';
29156     default: {
29157       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
29158       return 0;
29159     }
29160   }
29161 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)29162 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
29163   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
29164     const char* expected;
29165     const char* quote;
29166     if (ctx->head == NULL) {
29167       expected = "end";
29168       quote = "";
29169     } else {
29170       expected = ctx->head->field->type->name;
29171       quote = "'";
29172     }
29173     PyErr_Format(PyExc_ValueError,
29174                  "Buffer dtype mismatch, expected %s%s%s but got %s",
29175                  quote, expected, quote,
29176                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
29177   } else {
29178     __Pyx_StructField* field = ctx->head->field;
29179     __Pyx_StructField* parent = (ctx->head - 1)->field;
29180     PyErr_Format(PyExc_ValueError,
29181                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
29182                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
29183                  parent->type->name, field->name);
29184   }
29185 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)29186 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
29187   char group;
29188   size_t size, offset, arraysize = 1;
29189   if (ctx->enc_type == 0) return 0;
29190   if (ctx->head->field->type->arraysize[0]) {
29191     int i, ndim = 0;
29192     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
29193         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
29194         ndim = 1;
29195         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
29196             PyErr_Format(PyExc_ValueError,
29197                          "Expected a dimension of size %zu, got %zu",
29198                          ctx->head->field->type->arraysize[0], ctx->enc_count);
29199             return -1;
29200         }
29201     }
29202     if (!ctx->is_valid_array) {
29203       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
29204                    ctx->head->field->type->ndim, ndim);
29205       return -1;
29206     }
29207     for (i = 0; i < ctx->head->field->type->ndim; i++) {
29208       arraysize *= ctx->head->field->type->arraysize[i];
29209     }
29210     ctx->is_valid_array = 0;
29211     ctx->enc_count = 1;
29212   }
29213   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
29214   do {
29215     __Pyx_StructField* field = ctx->head->field;
29216     __Pyx_TypeInfo* type = field->type;
29217     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
29218       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
29219     } else {
29220       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
29221     }
29222     if (ctx->enc_packmode == '@') {
29223       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
29224       size_t align_mod_offset;
29225       if (align_at == 0) return -1;
29226       align_mod_offset = ctx->fmt_offset % align_at;
29227       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
29228       if (ctx->struct_alignment == 0)
29229           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
29230                                                                  ctx->is_complex);
29231     }
29232     if (type->size != size || type->typegroup != group) {
29233       if (type->typegroup == 'C' && type->fields != NULL) {
29234         size_t parent_offset = ctx->head->parent_offset + field->offset;
29235         ++ctx->head;
29236         ctx->head->field = type->fields;
29237         ctx->head->parent_offset = parent_offset;
29238         continue;
29239       }
29240       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
29241       } else {
29242           __Pyx_BufFmt_RaiseExpected(ctx);
29243           return -1;
29244       }
29245     }
29246     offset = ctx->head->parent_offset + field->offset;
29247     if (ctx->fmt_offset != offset) {
29248       PyErr_Format(PyExc_ValueError,
29249                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
29250                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
29251       return -1;
29252     }
29253     ctx->fmt_offset += size;
29254     if (arraysize)
29255       ctx->fmt_offset += (arraysize - 1) * size;
29256     --ctx->enc_count;
29257     while (1) {
29258       if (field == &ctx->root) {
29259         ctx->head = NULL;
29260         if (ctx->enc_count != 0) {
29261           __Pyx_BufFmt_RaiseExpected(ctx);
29262           return -1;
29263         }
29264         break;
29265       }
29266       ctx->head->field = ++field;
29267       if (field->type == NULL) {
29268         --ctx->head;
29269         field = ctx->head->field;
29270         continue;
29271       } else if (field->type->typegroup == 'S') {
29272         size_t parent_offset = ctx->head->parent_offset + field->offset;
29273         if (field->type->fields->type == NULL) continue;
29274         field = field->type->fields;
29275         ++ctx->head;
29276         ctx->head->field = field;
29277         ctx->head->parent_offset = parent_offset;
29278         break;
29279       } else {
29280         break;
29281       }
29282     }
29283   } while (ctx->enc_count);
29284   ctx->enc_type = 0;
29285   ctx->is_complex = 0;
29286   return 0;
29287 }
29288 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)29289 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
29290 {
29291     const char *ts = *tsp;
29292     int i = 0, number, ndim;
29293     ++ts;
29294     if (ctx->new_count != 1) {
29295         PyErr_SetString(PyExc_ValueError,
29296                         "Cannot handle repeated arrays in format string");
29297         return NULL;
29298     }
29299     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29300     ndim = ctx->head->field->type->ndim;
29301     while (*ts && *ts != ')') {
29302         switch (*ts) {
29303             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
29304             default:  break;
29305         }
29306         number = __Pyx_BufFmt_ExpectNumber(&ts);
29307         if (number == -1) return NULL;
29308         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
29309             return PyErr_Format(PyExc_ValueError,
29310                         "Expected a dimension of size %zu, got %d",
29311                         ctx->head->field->type->arraysize[i], number);
29312         if (*ts != ',' && *ts != ')')
29313             return PyErr_Format(PyExc_ValueError,
29314                                 "Expected a comma in format string, got '%c'", *ts);
29315         if (*ts == ',') ts++;
29316         i++;
29317     }
29318     if (i != ndim)
29319         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
29320                             ctx->head->field->type->ndim, i);
29321     if (!*ts) {
29322         PyErr_SetString(PyExc_ValueError,
29323                         "Unexpected end of format string, expected ')'");
29324         return NULL;
29325     }
29326     ctx->is_valid_array = 1;
29327     ctx->new_count = 1;
29328     *tsp = ++ts;
29329     return Py_None;
29330 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)29331 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
29332   int got_Z = 0;
29333   while (1) {
29334     switch(*ts) {
29335       case 0:
29336         if (ctx->enc_type != 0 && ctx->head == NULL) {
29337           __Pyx_BufFmt_RaiseExpected(ctx);
29338           return NULL;
29339         }
29340         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29341         if (ctx->head != NULL) {
29342           __Pyx_BufFmt_RaiseExpected(ctx);
29343           return NULL;
29344         }
29345         return ts;
29346       case ' ':
29347       case '\r':
29348       case '\n':
29349         ++ts;
29350         break;
29351       case '<':
29352         if (!__Pyx_Is_Little_Endian()) {
29353           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
29354           return NULL;
29355         }
29356         ctx->new_packmode = '=';
29357         ++ts;
29358         break;
29359       case '>':
29360       case '!':
29361         if (__Pyx_Is_Little_Endian()) {
29362           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
29363           return NULL;
29364         }
29365         ctx->new_packmode = '=';
29366         ++ts;
29367         break;
29368       case '=':
29369       case '@':
29370       case '^':
29371         ctx->new_packmode = *ts++;
29372         break;
29373       case 'T':
29374         {
29375           const char* ts_after_sub;
29376           size_t i, struct_count = ctx->new_count;
29377           size_t struct_alignment = ctx->struct_alignment;
29378           ctx->new_count = 1;
29379           ++ts;
29380           if (*ts != '{') {
29381             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
29382             return NULL;
29383           }
29384           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29385           ctx->enc_type = 0;
29386           ctx->enc_count = 0;
29387           ctx->struct_alignment = 0;
29388           ++ts;
29389           ts_after_sub = ts;
29390           for (i = 0; i != struct_count; ++i) {
29391             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
29392             if (!ts_after_sub) return NULL;
29393           }
29394           ts = ts_after_sub;
29395           if (struct_alignment) ctx->struct_alignment = struct_alignment;
29396         }
29397         break;
29398       case '}':
29399         {
29400           size_t alignment = ctx->struct_alignment;
29401           ++ts;
29402           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29403           ctx->enc_type = 0;
29404           if (alignment && ctx->fmt_offset % alignment) {
29405             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
29406           }
29407         }
29408         return ts;
29409       case 'x':
29410         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29411         ctx->fmt_offset += ctx->new_count;
29412         ctx->new_count = 1;
29413         ctx->enc_count = 0;
29414         ctx->enc_type = 0;
29415         ctx->enc_packmode = ctx->new_packmode;
29416         ++ts;
29417         break;
29418       case 'Z':
29419         got_Z = 1;
29420         ++ts;
29421         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
29422           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
29423           return NULL;
29424         }
29425         CYTHON_FALLTHROUGH;
29426       case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
29427       case 'l': case 'L': case 'q': case 'Q':
29428       case 'f': case 'd': case 'g':
29429       case 'O': case 'p':
29430         if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
29431             (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
29432           ctx->enc_count += ctx->new_count;
29433           ctx->new_count = 1;
29434           got_Z = 0;
29435           ++ts;
29436           break;
29437         }
29438         CYTHON_FALLTHROUGH;
29439       case 's':
29440         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
29441         ctx->enc_count = ctx->new_count;
29442         ctx->enc_packmode = ctx->new_packmode;
29443         ctx->enc_type = *ts;
29444         ctx->is_complex = got_Z;
29445         ++ts;
29446         ctx->new_count = 1;
29447         got_Z = 0;
29448         break;
29449       case ':':
29450         ++ts;
29451         while(*ts != ':') ++ts;
29452         ++ts;
29453         break;
29454       case '(':
29455         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
29456         break;
29457       default:
29458         {
29459           int number = __Pyx_BufFmt_ExpectNumber(&ts);
29460           if (number == -1) return NULL;
29461           ctx->new_count = (size_t)number;
29462         }
29463     }
29464   }
29465 }
29466 
29467 /* TypeInfoCompare */
29468   static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo * a,__Pyx_TypeInfo * b)29469 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
29470 {
29471     int i;
29472     if (!a || !b)
29473         return 0;
29474     if (a == b)
29475         return 1;
29476     if (a->size != b->size || a->typegroup != b->typegroup ||
29477             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
29478         if (a->typegroup == 'H' || b->typegroup == 'H') {
29479             return a->size == b->size;
29480         } else {
29481             return 0;
29482         }
29483     }
29484     if (a->ndim) {
29485         for (i = 0; i < a->ndim; i++)
29486             if (a->arraysize[i] != b->arraysize[i])
29487                 return 0;
29488     }
29489     if (a->typegroup == 'S') {
29490         if (a->flags != b->flags)
29491             return 0;
29492         if (a->fields || b->fields) {
29493             if (!(a->fields && b->fields))
29494                 return 0;
29495             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
29496                 __Pyx_StructField *field_a = a->fields + i;
29497                 __Pyx_StructField *field_b = b->fields + i;
29498                 if (field_a->offset != field_b->offset ||
29499                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
29500                     return 0;
29501             }
29502             return !a->fields[i].type && !b->fields[i].type;
29503         }
29504     }
29505     return 1;
29506 }
29507 
29508 /* MemviewSliceValidateAndInit */
29509   static int
__pyx_check_strides(Py_buffer * buf,int dim,int ndim,int spec)29510 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
29511 {
29512     if (buf->shape[dim] <= 1)
29513         return 1;
29514     if (buf->strides) {
29515         if (spec & __Pyx_MEMVIEW_CONTIG) {
29516             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
29517                 if (unlikely(buf->strides[dim] != sizeof(void *))) {
29518                     PyErr_Format(PyExc_ValueError,
29519                                  "Buffer is not indirectly contiguous "
29520                                  "in dimension %d.", dim);
29521                     goto fail;
29522                 }
29523             } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
29524                 PyErr_SetString(PyExc_ValueError,
29525                                 "Buffer and memoryview are not contiguous "
29526                                 "in the same dimension.");
29527                 goto fail;
29528             }
29529         }
29530         if (spec & __Pyx_MEMVIEW_FOLLOW) {
29531             Py_ssize_t stride = buf->strides[dim];
29532             if (stride < 0)
29533                 stride = -stride;
29534             if (unlikely(stride < buf->itemsize)) {
29535                 PyErr_SetString(PyExc_ValueError,
29536                                 "Buffer and memoryview are not contiguous "
29537                                 "in the same dimension.");
29538                 goto fail;
29539             }
29540         }
29541     } else {
29542         if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
29543             PyErr_Format(PyExc_ValueError,
29544                          "C-contiguous buffer is not contiguous in "
29545                          "dimension %d", dim);
29546             goto fail;
29547         } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
29548             PyErr_Format(PyExc_ValueError,
29549                          "C-contiguous buffer is not indirect in "
29550                          "dimension %d", dim);
29551             goto fail;
29552         } else if (unlikely(buf->suboffsets)) {
29553             PyErr_SetString(PyExc_ValueError,
29554                             "Buffer exposes suboffsets but no strides");
29555             goto fail;
29556         }
29557     }
29558     return 1;
29559 fail:
29560     return 0;
29561 }
29562 static int
__pyx_check_suboffsets(Py_buffer * buf,int dim,CYTHON_UNUSED int ndim,int spec)29563 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
29564 {
29565     if (spec & __Pyx_MEMVIEW_DIRECT) {
29566         if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
29567             PyErr_Format(PyExc_ValueError,
29568                          "Buffer not compatible with direct access "
29569                          "in dimension %d.", dim);
29570             goto fail;
29571         }
29572     }
29573     if (spec & __Pyx_MEMVIEW_PTR) {
29574         if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
29575             PyErr_Format(PyExc_ValueError,
29576                          "Buffer is not indirectly accessible "
29577                          "in dimension %d.", dim);
29578             goto fail;
29579         }
29580     }
29581     return 1;
29582 fail:
29583     return 0;
29584 }
29585 static int
__pyx_verify_contig(Py_buffer * buf,int ndim,int c_or_f_flag)29586 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
29587 {
29588     int i;
29589     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
29590         Py_ssize_t stride = 1;
29591         for (i = 0; i < ndim; i++) {
29592             if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
29593                 PyErr_SetString(PyExc_ValueError,
29594                     "Buffer not fortran contiguous.");
29595                 goto fail;
29596             }
29597             stride = stride * buf->shape[i];
29598         }
29599     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
29600         Py_ssize_t stride = 1;
29601         for (i = ndim - 1; i >- 1; i--) {
29602             if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
29603                 PyErr_SetString(PyExc_ValueError,
29604                     "Buffer not C contiguous.");
29605                 goto fail;
29606             }
29607             stride = stride * buf->shape[i];
29608         }
29609     }
29610     return 1;
29611 fail:
29612     return 0;
29613 }
__Pyx_ValidateAndInit_memviewslice(int * axes_specs,int c_or_f_flag,int buf_flags,int ndim,__Pyx_TypeInfo * dtype,__Pyx_BufFmt_StackElem stack[],__Pyx_memviewslice * memviewslice,PyObject * original_obj)29614 static int __Pyx_ValidateAndInit_memviewslice(
29615                 int *axes_specs,
29616                 int c_or_f_flag,
29617                 int buf_flags,
29618                 int ndim,
29619                 __Pyx_TypeInfo *dtype,
29620                 __Pyx_BufFmt_StackElem stack[],
29621                 __Pyx_memviewslice *memviewslice,
29622                 PyObject *original_obj)
29623 {
29624     struct __pyx_memoryview_obj *memview, *new_memview;
29625     __Pyx_RefNannyDeclarations
29626     Py_buffer *buf;
29627     int i, spec = 0, retval = -1;
29628     __Pyx_BufFmt_Context ctx;
29629     int from_memoryview = __pyx_memoryview_check(original_obj);
29630     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
29631     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
29632                                                             original_obj)->typeinfo)) {
29633         memview = (struct __pyx_memoryview_obj *) original_obj;
29634         new_memview = NULL;
29635     } else {
29636         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
29637                                             original_obj, buf_flags, 0, dtype);
29638         new_memview = memview;
29639         if (unlikely(!memview))
29640             goto fail;
29641     }
29642     buf = &memview->view;
29643     if (unlikely(buf->ndim != ndim)) {
29644         PyErr_Format(PyExc_ValueError,
29645                 "Buffer has wrong number of dimensions (expected %d, got %d)",
29646                 ndim, buf->ndim);
29647         goto fail;
29648     }
29649     if (new_memview) {
29650         __Pyx_BufFmt_Init(&ctx, stack, dtype);
29651         if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
29652     }
29653     if (unlikely((unsigned) buf->itemsize != dtype->size)) {
29654         PyErr_Format(PyExc_ValueError,
29655                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
29656                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
29657                      buf->itemsize,
29658                      (buf->itemsize > 1) ? "s" : "",
29659                      dtype->name,
29660                      dtype->size,
29661                      (dtype->size > 1) ? "s" : "");
29662         goto fail;
29663     }
29664     if (buf->len > 0) {
29665         for (i = 0; i < ndim; i++) {
29666             spec = axes_specs[i];
29667             if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
29668                 goto fail;
29669             if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
29670                 goto fail;
29671         }
29672         if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
29673             goto fail;
29674     }
29675     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
29676                                          new_memview != NULL) == -1)) {
29677         goto fail;
29678     }
29679     retval = 0;
29680     goto no_fail;
29681 fail:
29682     Py_XDECREF(new_memview);
29683     retval = -1;
29684 no_fail:
29685     __Pyx_RefNannyFinishContext();
29686     return retval;
29687 }
29688 
29689 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject * obj,int writable_flag)29690   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj, int writable_flag) {
29691     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29692     __Pyx_BufFmt_StackElem stack[1];
29693     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
29694     int retcode;
29695     if (obj == Py_None) {
29696         result.memview = (struct __pyx_memoryview_obj *) Py_None;
29697         return result;
29698     }
29699     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
29700                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
29701                                                  &__Pyx_TypeInfo_double, stack,
29702                                                  &result, obj);
29703     if (unlikely(retcode == -1))
29704         goto __pyx_fail;
29705     return result;
29706 __pyx_fail:
29707     result.memview = NULL;
29708     result.data = NULL;
29709     return result;
29710 }
29711 
29712 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject * obj,int writable_flag)29713   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
29714     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29715     __Pyx_BufFmt_StackElem stack[1];
29716     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
29717     int retcode;
29718     if (obj == Py_None) {
29719         result.memview = (struct __pyx_memoryview_obj *) Py_None;
29720         return result;
29721     }
29722     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
29723                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
29724                                                  &__Pyx_TypeInfo_double, stack,
29725                                                  &result, obj);
29726     if (unlikely(retcode == -1))
29727         goto __pyx_fail;
29728     return result;
29729 __pyx_fail:
29730     result.memview = NULL;
29731     result.data = NULL;
29732     return result;
29733 }
29734 
29735 /* CIntFromPyVerify */
29736   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
29737     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
29738 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
29739     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
29740 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
29741     {\
29742         func_type value = func_value;\
29743         if (sizeof(target_type) < sizeof(func_type)) {\
29744             if (unlikely(value != (func_type) (target_type) value)) {\
29745                 func_type zero = 0;\
29746                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
29747                     return (target_type) -1;\
29748                 if (is_unsigned && unlikely(value < zero))\
29749                     goto raise_neg_overflow;\
29750                 else\
29751                     goto raise_overflow;\
29752             }\
29753         }\
29754         return (target_type) value;\
29755     }
29756 
29757 /* MemviewDtypeToObject */
__pyx_memview_get_long(const char * itemp)29758   static CYTHON_INLINE PyObject *__pyx_memview_get_long(const char *itemp) {
29759     return (PyObject *) __Pyx_PyInt_From_long(*(long *) itemp);
29760 }
__pyx_memview_set_long(const char * itemp,PyObject * obj)29761 static CYTHON_INLINE int __pyx_memview_set_long(const char *itemp, PyObject *obj) {
29762     long value = __Pyx_PyInt_As_long(obj);
29763     if ((value == (long)-1) && PyErr_Occurred())
29764         return 0;
29765     *(long *) itemp = value;
29766     return 1;
29767 }
29768 
29769 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_long(PyObject * obj,int writable_flag)29770   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_long(PyObject *obj, int writable_flag) {
29771     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
29772     __Pyx_BufFmt_StackElem stack[1];
29773     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
29774     int retcode;
29775     if (obj == Py_None) {
29776         result.memview = (struct __pyx_memoryview_obj *) Py_None;
29777         return result;
29778     }
29779     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
29780                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
29781                                                  &__Pyx_TypeInfo_long, stack,
29782                                                  &result, obj);
29783     if (unlikely(retcode == -1))
29784         goto __pyx_fail;
29785     return result;
29786 __pyx_fail:
29787     result.memview = NULL;
29788     result.data = NULL;
29789     return result;
29790 }
29791 
29792 /* Declarations */
29793   #if CYTHON_CCOMPLEX
29794   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)29795     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
29796       return ::std::complex< float >(x, y);
29797     }
29798   #else
__pyx_t_float_complex_from_parts(float x,float y)29799     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
29800       return x + y*(__pyx_t_float_complex)_Complex_I;
29801     }
29802   #endif
29803 #else
__pyx_t_float_complex_from_parts(float x,float y)29804     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
29805       __pyx_t_float_complex z;
29806       z.real = x;
29807       z.imag = y;
29808       return z;
29809     }
29810 #endif
29811 
29812 /* Arithmetic */
29813   #if CYTHON_CCOMPLEX
29814 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)29815     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
29816        return (a.real == b.real) && (a.imag == b.imag);
29817     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)29818     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
29819         __pyx_t_float_complex z;
29820         z.real = a.real + b.real;
29821         z.imag = a.imag + b.imag;
29822         return z;
29823     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)29824     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
29825         __pyx_t_float_complex z;
29826         z.real = a.real - b.real;
29827         z.imag = a.imag - b.imag;
29828         return z;
29829     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)29830     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
29831         __pyx_t_float_complex z;
29832         z.real = a.real * b.real - a.imag * b.imag;
29833         z.imag = a.real * b.imag + a.imag * b.real;
29834         return z;
29835     }
29836     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)29837     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
29838         if (b.imag == 0) {
29839             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
29840         } else if (fabsf(b.real) >= fabsf(b.imag)) {
29841             if (b.real == 0 && b.imag == 0) {
29842                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
29843             } else {
29844                 float r = b.imag / b.real;
29845                 float s = (float)(1.0) / (b.real + b.imag * r);
29846                 return __pyx_t_float_complex_from_parts(
29847                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
29848             }
29849         } else {
29850             float r = b.real / b.imag;
29851             float s = (float)(1.0) / (b.imag + b.real * r);
29852             return __pyx_t_float_complex_from_parts(
29853                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
29854         }
29855     }
29856     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)29857     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
29858         if (b.imag == 0) {
29859             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
29860         } else {
29861             float denom = b.real * b.real + b.imag * b.imag;
29862             return __pyx_t_float_complex_from_parts(
29863                 (a.real * b.real + a.imag * b.imag) / denom,
29864                 (a.imag * b.real - a.real * b.imag) / denom);
29865         }
29866     }
29867     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)29868     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
29869         __pyx_t_float_complex z;
29870         z.real = -a.real;
29871         z.imag = -a.imag;
29872         return z;
29873     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)29874     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
29875        return (a.real == 0) && (a.imag == 0);
29876     }
__Pyx_c_conj_float(__pyx_t_float_complex a)29877     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
29878         __pyx_t_float_complex z;
29879         z.real =  a.real;
29880         z.imag = -a.imag;
29881         return z;
29882     }
29883     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)29884         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
29885           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
29886             return sqrtf(z.real*z.real + z.imag*z.imag);
29887           #else
29888             return hypotf(z.real, z.imag);
29889           #endif
29890         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)29891         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
29892             __pyx_t_float_complex z;
29893             float r, lnr, theta, z_r, z_theta;
29894             if (b.imag == 0 && b.real == (int)b.real) {
29895                 if (b.real < 0) {
29896                     float denom = a.real * a.real + a.imag * a.imag;
29897                     a.real = a.real / denom;
29898                     a.imag = -a.imag / denom;
29899                     b.real = -b.real;
29900                 }
29901                 switch ((int)b.real) {
29902                     case 0:
29903                         z.real = 1;
29904                         z.imag = 0;
29905                         return z;
29906                     case 1:
29907                         return a;
29908                     case 2:
29909                         return __Pyx_c_prod_float(a, a);
29910                     case 3:
29911                         z = __Pyx_c_prod_float(a, a);
29912                         return __Pyx_c_prod_float(z, a);
29913                     case 4:
29914                         z = __Pyx_c_prod_float(a, a);
29915                         return __Pyx_c_prod_float(z, z);
29916                 }
29917             }
29918             if (a.imag == 0) {
29919                 if (a.real == 0) {
29920                     return a;
29921                 } else if (b.imag == 0) {
29922                     z.real = powf(a.real, b.real);
29923                     z.imag = 0;
29924                     return z;
29925                 } else if (a.real > 0) {
29926                     r = a.real;
29927                     theta = 0;
29928                 } else {
29929                     r = -a.real;
29930                     theta = atan2f(0.0, -1.0);
29931                 }
29932             } else {
29933                 r = __Pyx_c_abs_float(a);
29934                 theta = atan2f(a.imag, a.real);
29935             }
29936             lnr = logf(r);
29937             z_r = expf(lnr * b.real - theta * b.imag);
29938             z_theta = theta * b.real + lnr * b.imag;
29939             z.real = z_r * cosf(z_theta);
29940             z.imag = z_r * sinf(z_theta);
29941             return z;
29942         }
29943     #endif
29944 #endif
29945 
29946 /* Declarations */
29947   #if CYTHON_CCOMPLEX
29948   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)29949     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
29950       return ::std::complex< double >(x, y);
29951     }
29952   #else
__pyx_t_double_complex_from_parts(double x,double y)29953     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
29954       return x + y*(__pyx_t_double_complex)_Complex_I;
29955     }
29956   #endif
29957 #else
__pyx_t_double_complex_from_parts(double x,double y)29958     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
29959       __pyx_t_double_complex z;
29960       z.real = x;
29961       z.imag = y;
29962       return z;
29963     }
29964 #endif
29965 
29966 /* Arithmetic */
29967   #if CYTHON_CCOMPLEX
29968 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)29969     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29970        return (a.real == b.real) && (a.imag == b.imag);
29971     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)29972     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29973         __pyx_t_double_complex z;
29974         z.real = a.real + b.real;
29975         z.imag = a.imag + b.imag;
29976         return z;
29977     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)29978     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29979         __pyx_t_double_complex z;
29980         z.real = a.real - b.real;
29981         z.imag = a.imag - b.imag;
29982         return z;
29983     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)29984     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29985         __pyx_t_double_complex z;
29986         z.real = a.real * b.real - a.imag * b.imag;
29987         z.imag = a.real * b.imag + a.imag * b.real;
29988         return z;
29989     }
29990     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)29991     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29992         if (b.imag == 0) {
29993             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
29994         } else if (fabs(b.real) >= fabs(b.imag)) {
29995             if (b.real == 0 && b.imag == 0) {
29996                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
29997             } else {
29998                 double r = b.imag / b.real;
29999                 double s = (double)(1.0) / (b.real + b.imag * r);
30000                 return __pyx_t_double_complex_from_parts(
30001                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
30002             }
30003         } else {
30004             double r = b.real / b.imag;
30005             double s = (double)(1.0) / (b.imag + b.real * r);
30006             return __pyx_t_double_complex_from_parts(
30007                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
30008         }
30009     }
30010     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)30011     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
30012         if (b.imag == 0) {
30013             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
30014         } else {
30015             double denom = b.real * b.real + b.imag * b.imag;
30016             return __pyx_t_double_complex_from_parts(
30017                 (a.real * b.real + a.imag * b.imag) / denom,
30018                 (a.imag * b.real - a.real * b.imag) / denom);
30019         }
30020     }
30021     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)30022     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
30023         __pyx_t_double_complex z;
30024         z.real = -a.real;
30025         z.imag = -a.imag;
30026         return z;
30027     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)30028     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
30029        return (a.real == 0) && (a.imag == 0);
30030     }
__Pyx_c_conj_double(__pyx_t_double_complex a)30031     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
30032         __pyx_t_double_complex z;
30033         z.real =  a.real;
30034         z.imag = -a.imag;
30035         return z;
30036     }
30037     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)30038         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
30039           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
30040             return sqrt(z.real*z.real + z.imag*z.imag);
30041           #else
30042             return hypot(z.real, z.imag);
30043           #endif
30044         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)30045         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
30046             __pyx_t_double_complex z;
30047             double r, lnr, theta, z_r, z_theta;
30048             if (b.imag == 0 && b.real == (int)b.real) {
30049                 if (b.real < 0) {
30050                     double denom = a.real * a.real + a.imag * a.imag;
30051                     a.real = a.real / denom;
30052                     a.imag = -a.imag / denom;
30053                     b.real = -b.real;
30054                 }
30055                 switch ((int)b.real) {
30056                     case 0:
30057                         z.real = 1;
30058                         z.imag = 0;
30059                         return z;
30060                     case 1:
30061                         return a;
30062                     case 2:
30063                         return __Pyx_c_prod_double(a, a);
30064                     case 3:
30065                         z = __Pyx_c_prod_double(a, a);
30066                         return __Pyx_c_prod_double(z, a);
30067                     case 4:
30068                         z = __Pyx_c_prod_double(a, a);
30069                         return __Pyx_c_prod_double(z, z);
30070                 }
30071             }
30072             if (a.imag == 0) {
30073                 if (a.real == 0) {
30074                     return a;
30075                 } else if (b.imag == 0) {
30076                     z.real = pow(a.real, b.real);
30077                     z.imag = 0;
30078                     return z;
30079                 } else if (a.real > 0) {
30080                     r = a.real;
30081                     theta = 0;
30082                 } else {
30083                     r = -a.real;
30084                     theta = atan2(0.0, -1.0);
30085                 }
30086             } else {
30087                 r = __Pyx_c_abs_double(a);
30088                 theta = atan2(a.imag, a.real);
30089             }
30090             lnr = log(r);
30091             z_r = exp(lnr * b.real - theta * b.imag);
30092             z_theta = theta * b.real + lnr * b.imag;
30093             z.real = z_r * cos(z_theta);
30094             z.imag = z_r * sin(z_theta);
30095             return z;
30096         }
30097     #endif
30098 #endif
30099 
30100 /* MemviewSliceCopyTemplate */
30101   static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice * from_mvs,const char * mode,int ndim,size_t sizeof_dtype,int contig_flag,int dtype_is_object)30102 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
30103                                  const char *mode, int ndim,
30104                                  size_t sizeof_dtype, int contig_flag,
30105                                  int dtype_is_object)
30106 {
30107     __Pyx_RefNannyDeclarations
30108     int i;
30109     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
30110     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
30111     Py_buffer *buf = &from_memview->view;
30112     PyObject *shape_tuple = NULL;
30113     PyObject *temp_int = NULL;
30114     struct __pyx_array_obj *array_obj = NULL;
30115     struct __pyx_memoryview_obj *memview_obj = NULL;
30116     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
30117     for (i = 0; i < ndim; i++) {
30118         if (unlikely(from_mvs->suboffsets[i] >= 0)) {
30119             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
30120                                            "indirect dimensions (axis %d)", i);
30121             goto fail;
30122         }
30123     }
30124     shape_tuple = PyTuple_New(ndim);
30125     if (unlikely(!shape_tuple)) {
30126         goto fail;
30127     }
30128     __Pyx_GOTREF(shape_tuple);
30129     for(i = 0; i < ndim; i++) {
30130         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
30131         if(unlikely(!temp_int)) {
30132             goto fail;
30133         } else {
30134             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
30135             temp_int = NULL;
30136         }
30137     }
30138     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
30139     if (unlikely(!array_obj)) {
30140         goto fail;
30141     }
30142     __Pyx_GOTREF(array_obj);
30143     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
30144                                     (PyObject *) array_obj, contig_flag,
30145                                     dtype_is_object,
30146                                     from_mvs->memview->typeinfo);
30147     if (unlikely(!memview_obj))
30148         goto fail;
30149     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
30150         goto fail;
30151     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
30152                                                 dtype_is_object) < 0))
30153         goto fail;
30154     goto no_fail;
30155 fail:
30156     __Pyx_XDECREF(new_mvs.memview);
30157     new_mvs.memview = NULL;
30158     new_mvs.data = NULL;
30159 no_fail:
30160     __Pyx_XDECREF(shape_tuple);
30161     __Pyx_XDECREF(temp_int);
30162     __Pyx_XDECREF(array_obj);
30163     __Pyx_RefNannyFinishContext();
30164     return new_mvs;
30165 }
30166 
30167 /* CIntToPy */
__Pyx_PyInt_From_long(long value)30168   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
30169 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30170 #pragma GCC diagnostic push
30171 #pragma GCC diagnostic ignored "-Wconversion"
30172 #endif
30173     const long neg_one = (long) -1, const_zero = (long) 0;
30174 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30175 #pragma GCC diagnostic pop
30176 #endif
30177     const int is_unsigned = neg_one > const_zero;
30178     if (is_unsigned) {
30179         if (sizeof(long) < sizeof(long)) {
30180             return PyInt_FromLong((long) value);
30181         } else if (sizeof(long) <= sizeof(unsigned long)) {
30182             return PyLong_FromUnsignedLong((unsigned long) value);
30183 #ifdef HAVE_LONG_LONG
30184         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
30185             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
30186 #endif
30187         }
30188     } else {
30189         if (sizeof(long) <= sizeof(long)) {
30190             return PyInt_FromLong((long) value);
30191 #ifdef HAVE_LONG_LONG
30192         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
30193             return PyLong_FromLongLong((PY_LONG_LONG) value);
30194 #endif
30195         }
30196     }
30197     {
30198         int one = 1; int little = (int)*(unsigned char *)&one;
30199         unsigned char *bytes = (unsigned char *)&value;
30200         return _PyLong_FromByteArray(bytes, sizeof(long),
30201                                      little, !is_unsigned);
30202     }
30203 }
30204 
30205 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)30206   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
30207 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30208 #pragma GCC diagnostic push
30209 #pragma GCC diagnostic ignored "-Wconversion"
30210 #endif
30211     const long neg_one = (long) -1, const_zero = (long) 0;
30212 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30213 #pragma GCC diagnostic pop
30214 #endif
30215     const int is_unsigned = neg_one > const_zero;
30216 #if PY_MAJOR_VERSION < 3
30217     if (likely(PyInt_Check(x))) {
30218         if (sizeof(long) < sizeof(long)) {
30219             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
30220         } else {
30221             long val = PyInt_AS_LONG(x);
30222             if (is_unsigned && unlikely(val < 0)) {
30223                 goto raise_neg_overflow;
30224             }
30225             return (long) val;
30226         }
30227     } else
30228 #endif
30229     if (likely(PyLong_Check(x))) {
30230         if (is_unsigned) {
30231 #if CYTHON_USE_PYLONG_INTERNALS
30232             const digit* digits = ((PyLongObject*)x)->ob_digit;
30233             switch (Py_SIZE(x)) {
30234                 case  0: return (long) 0;
30235                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
30236                 case 2:
30237                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
30238                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30239                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30240                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
30241                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
30242                         }
30243                     }
30244                     break;
30245                 case 3:
30246                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
30247                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30248                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30249                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
30250                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
30251                         }
30252                     }
30253                     break;
30254                 case 4:
30255                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
30256                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30257                             __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])))
30258                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
30259                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
30260                         }
30261                     }
30262                     break;
30263             }
30264 #endif
30265 #if CYTHON_COMPILING_IN_CPYTHON
30266             if (unlikely(Py_SIZE(x) < 0)) {
30267                 goto raise_neg_overflow;
30268             }
30269 #else
30270             {
30271                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
30272                 if (unlikely(result < 0))
30273                     return (long) -1;
30274                 if (unlikely(result == 1))
30275                     goto raise_neg_overflow;
30276             }
30277 #endif
30278             if (sizeof(long) <= sizeof(unsigned long)) {
30279                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
30280 #ifdef HAVE_LONG_LONG
30281             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
30282                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
30283 #endif
30284             }
30285         } else {
30286 #if CYTHON_USE_PYLONG_INTERNALS
30287             const digit* digits = ((PyLongObject*)x)->ob_digit;
30288             switch (Py_SIZE(x)) {
30289                 case  0: return (long) 0;
30290                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
30291                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
30292                 case -2:
30293                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
30294                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30295                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30296                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30297                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
30298                         }
30299                     }
30300                     break;
30301                 case 2:
30302                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
30303                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30304                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30305                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30306                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
30307                         }
30308                     }
30309                     break;
30310                 case -3:
30311                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30312                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30313                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30314                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30315                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
30316                         }
30317                     }
30318                     break;
30319                 case 3:
30320                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
30321                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30322                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30323                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30324                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
30325                         }
30326                     }
30327                     break;
30328                 case -4:
30329                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30330                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30331                             __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])))
30332                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30333                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
30334                         }
30335                     }
30336                     break;
30337                 case 4:
30338                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
30339                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30340                             __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])))
30341                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30342                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
30343                         }
30344                     }
30345                     break;
30346             }
30347 #endif
30348             if (sizeof(long) <= sizeof(long)) {
30349                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
30350 #ifdef HAVE_LONG_LONG
30351             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
30352                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
30353 #endif
30354             }
30355         }
30356         {
30357 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
30358             PyErr_SetString(PyExc_RuntimeError,
30359                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
30360 #else
30361             long val;
30362             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
30363  #if PY_MAJOR_VERSION < 3
30364             if (likely(v) && !PyLong_Check(v)) {
30365                 PyObject *tmp = v;
30366                 v = PyNumber_Long(tmp);
30367                 Py_DECREF(tmp);
30368             }
30369  #endif
30370             if (likely(v)) {
30371                 int one = 1; int is_little = (int)*(unsigned char *)&one;
30372                 unsigned char *bytes = (unsigned char *)&val;
30373                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
30374                                               bytes, sizeof(val),
30375                                               is_little, !is_unsigned);
30376                 Py_DECREF(v);
30377                 if (likely(!ret))
30378                     return val;
30379             }
30380 #endif
30381             return (long) -1;
30382         }
30383     } else {
30384         long val;
30385         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
30386         if (!tmp) return (long) -1;
30387         val = __Pyx_PyInt_As_long(tmp);
30388         Py_DECREF(tmp);
30389         return val;
30390     }
30391 raise_overflow:
30392     PyErr_SetString(PyExc_OverflowError,
30393         "value too large to convert to long");
30394     return (long) -1;
30395 raise_neg_overflow:
30396     PyErr_SetString(PyExc_OverflowError,
30397         "can't convert negative value to long");
30398     return (long) -1;
30399 }
30400 
30401 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)30402   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
30403 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30404 #pragma GCC diagnostic push
30405 #pragma GCC diagnostic ignored "-Wconversion"
30406 #endif
30407     const int neg_one = (int) -1, const_zero = (int) 0;
30408 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30409 #pragma GCC diagnostic pop
30410 #endif
30411     const int is_unsigned = neg_one > const_zero;
30412 #if PY_MAJOR_VERSION < 3
30413     if (likely(PyInt_Check(x))) {
30414         if (sizeof(int) < sizeof(long)) {
30415             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
30416         } else {
30417             long val = PyInt_AS_LONG(x);
30418             if (is_unsigned && unlikely(val < 0)) {
30419                 goto raise_neg_overflow;
30420             }
30421             return (int) val;
30422         }
30423     } else
30424 #endif
30425     if (likely(PyLong_Check(x))) {
30426         if (is_unsigned) {
30427 #if CYTHON_USE_PYLONG_INTERNALS
30428             const digit* digits = ((PyLongObject*)x)->ob_digit;
30429             switch (Py_SIZE(x)) {
30430                 case  0: return (int) 0;
30431                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
30432                 case 2:
30433                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
30434                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30435                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30436                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
30437                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
30438                         }
30439                     }
30440                     break;
30441                 case 3:
30442                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
30443                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30444                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30445                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
30446                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
30447                         }
30448                     }
30449                     break;
30450                 case 4:
30451                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
30452                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30453                             __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])))
30454                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
30455                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
30456                         }
30457                     }
30458                     break;
30459             }
30460 #endif
30461 #if CYTHON_COMPILING_IN_CPYTHON
30462             if (unlikely(Py_SIZE(x) < 0)) {
30463                 goto raise_neg_overflow;
30464             }
30465 #else
30466             {
30467                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
30468                 if (unlikely(result < 0))
30469                     return (int) -1;
30470                 if (unlikely(result == 1))
30471                     goto raise_neg_overflow;
30472             }
30473 #endif
30474             if (sizeof(int) <= sizeof(unsigned long)) {
30475                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
30476 #ifdef HAVE_LONG_LONG
30477             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
30478                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
30479 #endif
30480             }
30481         } else {
30482 #if CYTHON_USE_PYLONG_INTERNALS
30483             const digit* digits = ((PyLongObject*)x)->ob_digit;
30484             switch (Py_SIZE(x)) {
30485                 case  0: return (int) 0;
30486                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
30487                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
30488                 case -2:
30489                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
30490                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30491                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30492                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
30493                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
30494                         }
30495                     }
30496                     break;
30497                 case 2:
30498                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
30499                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30500                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30501                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
30502                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
30503                         }
30504                     }
30505                     break;
30506                 case -3:
30507                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
30508                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30509                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30510                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
30511                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
30512                         }
30513                     }
30514                     break;
30515                 case 3:
30516                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
30517                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30518                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30519                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
30520                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
30521                         }
30522                     }
30523                     break;
30524                 case -4:
30525                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
30526                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30527                             __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])))
30528                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
30529                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
30530                         }
30531                     }
30532                     break;
30533                 case 4:
30534                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
30535                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30536                             __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])))
30537                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
30538                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
30539                         }
30540                     }
30541                     break;
30542             }
30543 #endif
30544             if (sizeof(int) <= sizeof(long)) {
30545                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
30546 #ifdef HAVE_LONG_LONG
30547             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
30548                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
30549 #endif
30550             }
30551         }
30552         {
30553 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
30554             PyErr_SetString(PyExc_RuntimeError,
30555                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
30556 #else
30557             int val;
30558             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
30559  #if PY_MAJOR_VERSION < 3
30560             if (likely(v) && !PyLong_Check(v)) {
30561                 PyObject *tmp = v;
30562                 v = PyNumber_Long(tmp);
30563                 Py_DECREF(tmp);
30564             }
30565  #endif
30566             if (likely(v)) {
30567                 int one = 1; int is_little = (int)*(unsigned char *)&one;
30568                 unsigned char *bytes = (unsigned char *)&val;
30569                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
30570                                               bytes, sizeof(val),
30571                                               is_little, !is_unsigned);
30572                 Py_DECREF(v);
30573                 if (likely(!ret))
30574                     return val;
30575             }
30576 #endif
30577             return (int) -1;
30578         }
30579     } else {
30580         int val;
30581         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
30582         if (!tmp) return (int) -1;
30583         val = __Pyx_PyInt_As_int(tmp);
30584         Py_DECREF(tmp);
30585         return val;
30586     }
30587 raise_overflow:
30588     PyErr_SetString(PyExc_OverflowError,
30589         "value too large to convert to int");
30590     return (int) -1;
30591 raise_neg_overflow:
30592     PyErr_SetString(PyExc_OverflowError,
30593         "can't convert negative value to int");
30594     return (int) -1;
30595 }
30596 
30597 /* CIntToPy */
__Pyx_PyInt_From_int(int value)30598   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
30599 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30600 #pragma GCC diagnostic push
30601 #pragma GCC diagnostic ignored "-Wconversion"
30602 #endif
30603     const int neg_one = (int) -1, const_zero = (int) 0;
30604 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30605 #pragma GCC diagnostic pop
30606 #endif
30607     const int is_unsigned = neg_one > const_zero;
30608     if (is_unsigned) {
30609         if (sizeof(int) < sizeof(long)) {
30610             return PyInt_FromLong((long) value);
30611         } else if (sizeof(int) <= sizeof(unsigned long)) {
30612             return PyLong_FromUnsignedLong((unsigned long) value);
30613 #ifdef HAVE_LONG_LONG
30614         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
30615             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
30616 #endif
30617         }
30618     } else {
30619         if (sizeof(int) <= sizeof(long)) {
30620             return PyInt_FromLong((long) value);
30621 #ifdef HAVE_LONG_LONG
30622         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
30623             return PyLong_FromLongLong((PY_LONG_LONG) value);
30624 #endif
30625         }
30626     }
30627     {
30628         int one = 1; int little = (int)*(unsigned char *)&one;
30629         unsigned char *bytes = (unsigned char *)&value;
30630         return _PyLong_FromByteArray(bytes, sizeof(int),
30631                                      little, !is_unsigned);
30632     }
30633 }
30634 
30635 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)30636   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
30637 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30638 #pragma GCC diagnostic push
30639 #pragma GCC diagnostic ignored "-Wconversion"
30640 #endif
30641     const char neg_one = (char) -1, const_zero = (char) 0;
30642 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30643 #pragma GCC diagnostic pop
30644 #endif
30645     const int is_unsigned = neg_one > const_zero;
30646 #if PY_MAJOR_VERSION < 3
30647     if (likely(PyInt_Check(x))) {
30648         if (sizeof(char) < sizeof(long)) {
30649             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
30650         } else {
30651             long val = PyInt_AS_LONG(x);
30652             if (is_unsigned && unlikely(val < 0)) {
30653                 goto raise_neg_overflow;
30654             }
30655             return (char) val;
30656         }
30657     } else
30658 #endif
30659     if (likely(PyLong_Check(x))) {
30660         if (is_unsigned) {
30661 #if CYTHON_USE_PYLONG_INTERNALS
30662             const digit* digits = ((PyLongObject*)x)->ob_digit;
30663             switch (Py_SIZE(x)) {
30664                 case  0: return (char) 0;
30665                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
30666                 case 2:
30667                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
30668                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30669                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30670                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
30671                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
30672                         }
30673                     }
30674                     break;
30675                 case 3:
30676                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
30677                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30678                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30679                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
30680                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
30681                         }
30682                     }
30683                     break;
30684                 case 4:
30685                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
30686                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30687                             __PYX_VERIFY_RETURN_INT(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])))
30688                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
30689                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
30690                         }
30691                     }
30692                     break;
30693             }
30694 #endif
30695 #if CYTHON_COMPILING_IN_CPYTHON
30696             if (unlikely(Py_SIZE(x) < 0)) {
30697                 goto raise_neg_overflow;
30698             }
30699 #else
30700             {
30701                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
30702                 if (unlikely(result < 0))
30703                     return (char) -1;
30704                 if (unlikely(result == 1))
30705                     goto raise_neg_overflow;
30706             }
30707 #endif
30708             if (sizeof(char) <= sizeof(unsigned long)) {
30709                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
30710 #ifdef HAVE_LONG_LONG
30711             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
30712                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
30713 #endif
30714             }
30715         } else {
30716 #if CYTHON_USE_PYLONG_INTERNALS
30717             const digit* digits = ((PyLongObject*)x)->ob_digit;
30718             switch (Py_SIZE(x)) {
30719                 case  0: return (char) 0;
30720                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
30721                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
30722                 case -2:
30723                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
30724                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30725                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30726                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
30727                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
30728                         }
30729                     }
30730                     break;
30731                 case 2:
30732                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
30733                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30734                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30735                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
30736                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
30737                         }
30738                     }
30739                     break;
30740                 case -3:
30741                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
30742                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30743                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30744                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
30745                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
30746                         }
30747                     }
30748                     break;
30749                 case 3:
30750                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
30751                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30752                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30753                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
30754                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
30755                         }
30756                     }
30757                     break;
30758                 case -4:
30759                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
30760                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30761                             __PYX_VERIFY_RETURN_INT(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])))
30762                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
30763                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
30764                         }
30765                     }
30766                     break;
30767                 case 4:
30768                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
30769                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30770                             __PYX_VERIFY_RETURN_INT(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])))
30771                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
30772                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
30773                         }
30774                     }
30775                     break;
30776             }
30777 #endif
30778             if (sizeof(char) <= sizeof(long)) {
30779                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
30780 #ifdef HAVE_LONG_LONG
30781             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
30782                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
30783 #endif
30784             }
30785         }
30786         {
30787 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
30788             PyErr_SetString(PyExc_RuntimeError,
30789                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
30790 #else
30791             char val;
30792             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
30793  #if PY_MAJOR_VERSION < 3
30794             if (likely(v) && !PyLong_Check(v)) {
30795                 PyObject *tmp = v;
30796                 v = PyNumber_Long(tmp);
30797                 Py_DECREF(tmp);
30798             }
30799  #endif
30800             if (likely(v)) {
30801                 int one = 1; int is_little = (int)*(unsigned char *)&one;
30802                 unsigned char *bytes = (unsigned char *)&val;
30803                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
30804                                               bytes, sizeof(val),
30805                                               is_little, !is_unsigned);
30806                 Py_DECREF(v);
30807                 if (likely(!ret))
30808                     return val;
30809             }
30810 #endif
30811             return (char) -1;
30812         }
30813     } else {
30814         char val;
30815         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
30816         if (!tmp) return (char) -1;
30817         val = __Pyx_PyInt_As_char(tmp);
30818         Py_DECREF(tmp);
30819         return val;
30820     }
30821 raise_overflow:
30822     PyErr_SetString(PyExc_OverflowError,
30823         "value too large to convert to char");
30824     return (char) -1;
30825 raise_neg_overflow:
30826     PyErr_SetString(PyExc_OverflowError,
30827         "can't convert negative value to char");
30828     return (char) -1;
30829 }
30830 
30831 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)30832   static int __Pyx_check_binary_version(void) {
30833     char ctversion[4], rtversion[4];
30834     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
30835     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
30836     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
30837         char message[200];
30838         PyOS_snprintf(message, sizeof(message),
30839                       "compiletime version %s of module '%.100s' "
30840                       "does not match runtime version %s",
30841                       ctversion, __Pyx_MODULE_NAME, rtversion);
30842         return PyErr_WarnEx(NULL, message, 1);
30843     }
30844     return 0;
30845 }
30846 
30847 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)30848   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
30849     while (t->p) {
30850         #if PY_MAJOR_VERSION < 3
30851         if (t->is_unicode) {
30852             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
30853         } else if (t->intern) {
30854             *t->p = PyString_InternFromString(t->s);
30855         } else {
30856             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
30857         }
30858         #else
30859         if (t->is_unicode | t->is_str) {
30860             if (t->intern) {
30861                 *t->p = PyUnicode_InternFromString(t->s);
30862             } else if (t->encoding) {
30863                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
30864             } else {
30865                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
30866             }
30867         } else {
30868             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
30869         }
30870         #endif
30871         if (!*t->p)
30872             return -1;
30873         if (PyObject_Hash(*t->p) == -1)
30874             return -1;
30875         ++t;
30876     }
30877     return 0;
30878 }
30879 
__Pyx_PyUnicode_FromString(const char * c_str)30880 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
30881     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
30882 }
__Pyx_PyObject_AsString(PyObject * o)30883 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
30884     Py_ssize_t ignore;
30885     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
30886 }
30887 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
30888 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)30889 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
30890     char* defenc_c;
30891     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
30892     if (!defenc) return NULL;
30893     defenc_c = PyBytes_AS_STRING(defenc);
30894 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
30895     {
30896         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
30897         char* c;
30898         for (c = defenc_c; c < end; c++) {
30899             if ((unsigned char) (*c) >= 128) {
30900                 PyUnicode_AsASCIIString(o);
30901                 return NULL;
30902             }
30903         }
30904     }
30905 #endif
30906     *length = PyBytes_GET_SIZE(defenc);
30907     return defenc_c;
30908 }
30909 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)30910 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
30911     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
30912 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
30913     if (likely(PyUnicode_IS_ASCII(o))) {
30914         *length = PyUnicode_GET_LENGTH(o);
30915         return PyUnicode_AsUTF8(o);
30916     } else {
30917         PyUnicode_AsASCIIString(o);
30918         return NULL;
30919     }
30920 #else
30921     return PyUnicode_AsUTF8AndSize(o, length);
30922 #endif
30923 }
30924 #endif
30925 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)30926 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
30927 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
30928     if (
30929 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
30930             __Pyx_sys_getdefaultencoding_not_ascii &&
30931 #endif
30932             PyUnicode_Check(o)) {
30933         return __Pyx_PyUnicode_AsStringAndSize(o, length);
30934     } else
30935 #endif
30936 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
30937     if (PyByteArray_Check(o)) {
30938         *length = PyByteArray_GET_SIZE(o);
30939         return PyByteArray_AS_STRING(o);
30940     } else
30941 #endif
30942     {
30943         char* result;
30944         int r = PyBytes_AsStringAndSize(o, &result, length);
30945         if (unlikely(r < 0)) {
30946             return NULL;
30947         } else {
30948             return result;
30949         }
30950     }
30951 }
__Pyx_PyObject_IsTrue(PyObject * x)30952 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
30953    int is_true = x == Py_True;
30954    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
30955    else return PyObject_IsTrue(x);
30956 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)30957 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
30958     int retval;
30959     if (unlikely(!x)) return -1;
30960     retval = __Pyx_PyObject_IsTrue(x);
30961     Py_DECREF(x);
30962     return retval;
30963 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)30964 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
30965 #if PY_MAJOR_VERSION >= 3
30966     if (PyLong_Check(result)) {
30967         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
30968                 "__int__ returned non-int (type %.200s).  "
30969                 "The ability to return an instance of a strict subclass of int "
30970                 "is deprecated, and may be removed in a future version of Python.",
30971                 Py_TYPE(result)->tp_name)) {
30972             Py_DECREF(result);
30973             return NULL;
30974         }
30975         return result;
30976     }
30977 #endif
30978     PyErr_Format(PyExc_TypeError,
30979                  "__%.4s__ returned non-%.4s (type %.200s)",
30980                  type_name, type_name, Py_TYPE(result)->tp_name);
30981     Py_DECREF(result);
30982     return NULL;
30983 }
__Pyx_PyNumber_IntOrLong(PyObject * x)30984 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
30985 #if CYTHON_USE_TYPE_SLOTS
30986   PyNumberMethods *m;
30987 #endif
30988   const char *name = NULL;
30989   PyObject *res = NULL;
30990 #if PY_MAJOR_VERSION < 3
30991   if (likely(PyInt_Check(x) || PyLong_Check(x)))
30992 #else
30993   if (likely(PyLong_Check(x)))
30994 #endif
30995     return __Pyx_NewRef(x);
30996 #if CYTHON_USE_TYPE_SLOTS
30997   m = Py_TYPE(x)->tp_as_number;
30998   #if PY_MAJOR_VERSION < 3
30999   if (m && m->nb_int) {
31000     name = "int";
31001     res = m->nb_int(x);
31002   }
31003   else if (m && m->nb_long) {
31004     name = "long";
31005     res = m->nb_long(x);
31006   }
31007   #else
31008   if (likely(m && m->nb_int)) {
31009     name = "int";
31010     res = m->nb_int(x);
31011   }
31012   #endif
31013 #else
31014   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
31015     res = PyNumber_Int(x);
31016   }
31017 #endif
31018   if (likely(res)) {
31019 #if PY_MAJOR_VERSION < 3
31020     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
31021 #else
31022     if (unlikely(!PyLong_CheckExact(res))) {
31023 #endif
31024         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
31025     }
31026   }
31027   else if (!PyErr_Occurred()) {
31028     PyErr_SetString(PyExc_TypeError,
31029                     "an integer is required");
31030   }
31031   return res;
31032 }
31033 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
31034   Py_ssize_t ival;
31035   PyObject *x;
31036 #if PY_MAJOR_VERSION < 3
31037   if (likely(PyInt_CheckExact(b))) {
31038     if (sizeof(Py_ssize_t) >= sizeof(long))
31039         return PyInt_AS_LONG(b);
31040     else
31041         return PyInt_AsSsize_t(b);
31042   }
31043 #endif
31044   if (likely(PyLong_CheckExact(b))) {
31045     #if CYTHON_USE_PYLONG_INTERNALS
31046     const digit* digits = ((PyLongObject*)b)->ob_digit;
31047     const Py_ssize_t size = Py_SIZE(b);
31048     if (likely(__Pyx_sst_abs(size) <= 1)) {
31049         ival = likely(size) ? digits[0] : 0;
31050         if (size == -1) ival = -ival;
31051         return ival;
31052     } else {
31053       switch (size) {
31054          case 2:
31055            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
31056              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31057            }
31058            break;
31059          case -2:
31060            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
31061              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31062            }
31063            break;
31064          case 3:
31065            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
31066              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31067            }
31068            break;
31069          case -3:
31070            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
31071              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31072            }
31073            break;
31074          case 4:
31075            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
31076              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]));
31077            }
31078            break;
31079          case -4:
31080            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
31081              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]));
31082            }
31083            break;
31084       }
31085     }
31086     #endif
31087     return PyLong_AsSsize_t(b);
31088   }
31089   x = PyNumber_Index(b);
31090   if (!x) return -1;
31091   ival = PyInt_AsSsize_t(x);
31092   Py_DECREF(x);
31093   return ival;
31094 }
31095 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
31096   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
31097 }
31098 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
31099     return PyInt_FromSize_t(ival);
31100 }
31101 
31102 
31103 #endif /* Py_PYTHON_H */
31104