Advertisement
Fhernd

definir_tipo_dato.c

Feb 21st, 2018
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 103.24 KB | None | 0 0
  1. /* Generated by Cython 0.25.2 */
  2.  
  3. #define PY_SSIZE_T_CLEAN
  4. #include "Python.h"
  5. #ifndef Py_PYTHON_H
  6.     #error Python headers needed to compile C extensions, please install development version of Python.
  7. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
  8.     #error Cython requires Python 2.6+ or Python 3.2+.
  9. #else
  10. #define CYTHON_ABI "0_25_2"
  11. #include <stddef.h>
  12. #ifndef offsetof
  13.   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  14. #endif
  15. #if !defined(WIN32) && !defined(MS_WINDOWS)
  16.   #ifndef __stdcall
  17.     #define __stdcall
  18.   #endif
  19.   #ifndef __cdecl
  20.     #define __cdecl
  21.   #endif
  22.   #ifndef __fastcall
  23.     #define __fastcall
  24.   #endif
  25. #endif
  26. #ifndef DL_IMPORT
  27.   #define DL_IMPORT(t) t
  28. #endif
  29. #ifndef DL_EXPORT
  30.   #define DL_EXPORT(t) t
  31. #endif
  32. #ifndef HAVE_LONG_LONG
  33.   #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
  34.     #define HAVE_LONG_LONG
  35.   #endif
  36. #endif
  37. #ifndef PY_LONG_LONG
  38.   #define PY_LONG_LONG LONG_LONG
  39. #endif
  40. #ifndef Py_HUGE_VAL
  41.   #define Py_HUGE_VAL HUGE_VAL
  42. #endif
  43. #ifdef PYPY_VERSION
  44.   #define CYTHON_COMPILING_IN_PYPY 1
  45.   #define CYTHON_COMPILING_IN_PYSTON 0
  46.   #define CYTHON_COMPILING_IN_CPYTHON 0
  47.   #undef CYTHON_USE_TYPE_SLOTS
  48.   #define CYTHON_USE_TYPE_SLOTS 0
  49.   #undef CYTHON_USE_ASYNC_SLOTS
  50.   #define CYTHON_USE_ASYNC_SLOTS 0
  51.   #undef CYTHON_USE_PYLIST_INTERNALS
  52.   #define CYTHON_USE_PYLIST_INTERNALS 0
  53.   #undef CYTHON_USE_UNICODE_INTERNALS
  54.   #define CYTHON_USE_UNICODE_INTERNALS 0
  55.   #undef CYTHON_USE_UNICODE_WRITER
  56.   #define CYTHON_USE_UNICODE_WRITER 0
  57.   #undef CYTHON_USE_PYLONG_INTERNALS
  58.   #define CYTHON_USE_PYLONG_INTERNALS 0
  59.   #undef CYTHON_AVOID_BORROWED_REFS
  60.   #define CYTHON_AVOID_BORROWED_REFS 1
  61.   #undef CYTHON_ASSUME_SAFE_MACROS
  62.   #define CYTHON_ASSUME_SAFE_MACROS 0
  63.   #undef CYTHON_UNPACK_METHODS
  64.   #define CYTHON_UNPACK_METHODS 0
  65.   #undef CYTHON_FAST_THREAD_STATE
  66.   #define CYTHON_FAST_THREAD_STATE 0
  67.   #undef CYTHON_FAST_PYCALL
  68.   #define CYTHON_FAST_PYCALL 0
  69. #elif defined(PYSTON_VERSION)
  70.   #define CYTHON_COMPILING_IN_PYPY 0
  71.   #define CYTHON_COMPILING_IN_PYSTON 1
  72.   #define CYTHON_COMPILING_IN_CPYTHON 0
  73.   #ifndef CYTHON_USE_TYPE_SLOTS
  74.     #define CYTHON_USE_TYPE_SLOTS 1
  75.   #endif
  76.   #undef CYTHON_USE_ASYNC_SLOTS
  77.   #define CYTHON_USE_ASYNC_SLOTS 0
  78.   #undef CYTHON_USE_PYLIST_INTERNALS
  79.   #define CYTHON_USE_PYLIST_INTERNALS 0
  80.   #ifndef CYTHON_USE_UNICODE_INTERNALS
  81.     #define CYTHON_USE_UNICODE_INTERNALS 1
  82.   #endif
  83.   #undef CYTHON_USE_UNICODE_WRITER
  84.   #define CYTHON_USE_UNICODE_WRITER 0
  85.   #undef CYTHON_USE_PYLONG_INTERNALS
  86.   #define CYTHON_USE_PYLONG_INTERNALS 0
  87.   #ifndef CYTHON_AVOID_BORROWED_REFS
  88.     #define CYTHON_AVOID_BORROWED_REFS 0
  89.   #endif
  90.   #ifndef CYTHON_ASSUME_SAFE_MACROS
  91.     #define CYTHON_ASSUME_SAFE_MACROS 1
  92.   #endif
  93.   #ifndef CYTHON_UNPACK_METHODS
  94.     #define CYTHON_UNPACK_METHODS 1
  95.   #endif
  96.   #undef CYTHON_FAST_THREAD_STATE
  97.   #define CYTHON_FAST_THREAD_STATE 0
  98.   #undef CYTHON_FAST_PYCALL
  99.   #define CYTHON_FAST_PYCALL 0
  100. #else
  101.   #define CYTHON_COMPILING_IN_PYPY 0
  102.   #define CYTHON_COMPILING_IN_PYSTON 0
  103.   #define CYTHON_COMPILING_IN_CPYTHON 1
  104.   #ifndef CYTHON_USE_TYPE_SLOTS
  105.     #define CYTHON_USE_TYPE_SLOTS 1
  106.   #endif
  107.   #if PY_MAJOR_VERSION < 3
  108.     #undef CYTHON_USE_ASYNC_SLOTS
  109.     #define CYTHON_USE_ASYNC_SLOTS 0
  110.   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  111.     #define CYTHON_USE_ASYNC_SLOTS 1
  112.   #endif
  113.   #if PY_VERSION_HEX < 0x02070000
  114.     #undef CYTHON_USE_PYLONG_INTERNALS
  115.     #define CYTHON_USE_PYLONG_INTERNALS 0
  116.   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
  117.     #define CYTHON_USE_PYLONG_INTERNALS 1
  118.   #endif
  119.   #ifndef CYTHON_USE_PYLIST_INTERNALS
  120.     #define CYTHON_USE_PYLIST_INTERNALS 1
  121.   #endif
  122.   #ifndef CYTHON_USE_UNICODE_INTERNALS
  123.     #define CYTHON_USE_UNICODE_INTERNALS 1
  124.   #endif
  125.   #if PY_VERSION_HEX < 0x030300F0
  126.     #undef CYTHON_USE_UNICODE_WRITER
  127.     #define CYTHON_USE_UNICODE_WRITER 0
  128.   #elif !defined(CYTHON_USE_UNICODE_WRITER)
  129.     #define CYTHON_USE_UNICODE_WRITER 1
  130.   #endif
  131.   #ifndef CYTHON_AVOID_BORROWED_REFS
  132.     #define CYTHON_AVOID_BORROWED_REFS 0
  133.   #endif
  134.   #ifndef CYTHON_ASSUME_SAFE_MACROS
  135.     #define CYTHON_ASSUME_SAFE_MACROS 1
  136.   #endif
  137.   #ifndef CYTHON_UNPACK_METHODS
  138.     #define CYTHON_UNPACK_METHODS 1
  139.   #endif
  140.   #ifndef CYTHON_FAST_THREAD_STATE
  141.     #define CYTHON_FAST_THREAD_STATE 1
  142.   #endif
  143.   #ifndef CYTHON_FAST_PYCALL
  144.     #define CYTHON_FAST_PYCALL 1
  145.   #endif
  146. #endif
  147. #if !defined(CYTHON_FAST_PYCCALL)
  148. #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
  149. #endif
  150. #if CYTHON_USE_PYLONG_INTERNALS
  151.   #include "longintrepr.h"
  152.   #undef SHIFT
  153.   #undef BASE
  154.   #undef MASK
  155. #endif
  156. #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  157.   #define Py_OptimizeFlag 0
  158. #endif
  159. #define __PYX_BUILD_PY_SSIZE_T "n"
  160. #define CYTHON_FORMAT_SSIZE_T "z"
  161. #if PY_MAJOR_VERSION < 3
  162.   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  163.   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  164.           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  165.   #define __Pyx_DefaultClassType PyClass_Type
  166. #else
  167.   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  168.   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  169.           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  170.   #define __Pyx_DefaultClassType PyType_Type
  171. #endif
  172. #ifndef Py_TPFLAGS_CHECKTYPES
  173.   #define Py_TPFLAGS_CHECKTYPES 0
  174. #endif
  175. #ifndef Py_TPFLAGS_HAVE_INDEX
  176.   #define Py_TPFLAGS_HAVE_INDEX 0
  177. #endif
  178. #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  179.   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  180. #endif
  181. #ifndef Py_TPFLAGS_HAVE_FINALIZE
  182.   #define Py_TPFLAGS_HAVE_FINALIZE 0
  183. #endif
  184. #ifndef METH_FASTCALL
  185.   #define METH_FASTCALL 0x80
  186.   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
  187.                                               Py_ssize_t nargs, PyObject *kwnames);
  188. #else
  189.   #define __Pyx_PyCFunctionFast _PyCFunctionFast
  190. #endif
  191. #if CYTHON_FAST_PYCCALL
  192. #define __Pyx_PyFastCFunction_Check(func)\
  193.     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
  194. #else
  195. #define __Pyx_PyFastCFunction_Check(func) 0
  196. #endif
  197. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  198.   #define CYTHON_PEP393_ENABLED 1
  199.   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
  200.                                               0 : _PyUnicode_Ready((PyObject *)(op)))
  201.   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  202.   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  203.   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  204.   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  205.   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  206.   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  207.   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  208.   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  209. #else
  210.   #define CYTHON_PEP393_ENABLED 0
  211.   #define PyUnicode_1BYTE_KIND  1
  212.   #define PyUnicode_2BYTE_KIND  2
  213.   #define PyUnicode_4BYTE_KIND  4
  214.   #define __Pyx_PyUnicode_READY(op)       (0)
  215.   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  216.   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  217.   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  218.   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  219.   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  220.   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  221.   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  222.   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
  223. #endif
  224. #if CYTHON_COMPILING_IN_PYPY
  225.   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  226.   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
  227. #else
  228.   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  229.   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
  230.       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  231. #endif
  232. #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  233.   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  234. #endif
  235. #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  236.   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  237. #endif
  238. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  239.   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  240. #endif
  241. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  242.   #define PyObject_Malloc(s)   PyMem_Malloc(s)
  243.   #define PyObject_Free(p)     PyMem_Free(p)
  244.   #define PyObject_Realloc(p)  PyMem_Realloc(p)
  245. #endif
  246. #if CYTHON_COMPILING_IN_PYSTON
  247.   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  248.   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
  249. #else
  250.   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  251.   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
  252. #endif
  253. #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  254. #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  255. #if PY_MAJOR_VERSION >= 3
  256.   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
  257. #else
  258.   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
  259. #endif
  260. #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  261.   #define PyObject_ASCII(o)            PyObject_Repr(o)
  262. #endif
  263. #if PY_MAJOR_VERSION >= 3
  264.   #define PyBaseString_Type            PyUnicode_Type
  265.   #define PyStringObject               PyUnicodeObject
  266.   #define PyString_Type                PyUnicode_Type
  267.   #define PyString_Check               PyUnicode_Check
  268.   #define PyString_CheckExact          PyUnicode_CheckExact
  269. #endif
  270. #if PY_MAJOR_VERSION >= 3
  271.   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  272.   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  273. #else
  274.   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  275.   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  276. #endif
  277. #ifndef PySet_CheckExact
  278.   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
  279. #endif
  280. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  281. #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
  282. #if PY_MAJOR_VERSION >= 3
  283.   #define PyIntObject                  PyLongObject
  284.   #define PyInt_Type                   PyLong_Type
  285.   #define PyInt_Check(op)              PyLong_Check(op)
  286.   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  287.   #define PyInt_FromString             PyLong_FromString
  288.   #define PyInt_FromUnicode            PyLong_FromUnicode
  289.   #define PyInt_FromLong               PyLong_FromLong
  290.   #define PyInt_FromSize_t             PyLong_FromSize_t
  291.   #define PyInt_FromSsize_t            PyLong_FromSsize_t
  292.   #define PyInt_AsLong                 PyLong_AsLong
  293.   #define PyInt_AS_LONG                PyLong_AS_LONG
  294.   #define PyInt_AsSsize_t              PyLong_AsSsize_t
  295.   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  296.   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  297.   #define PyNumber_Int                 PyNumber_Long
  298. #endif
  299. #if PY_MAJOR_VERSION >= 3
  300.   #define PyBoolObject                 PyLongObject
  301. #endif
  302. #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  303.   #ifndef PyUnicode_InternFromString
  304.     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  305.   #endif
  306. #endif
  307. #if PY_VERSION_HEX < 0x030200A4
  308.   typedef long Py_hash_t;
  309.   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  310.   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
  311. #else
  312.   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  313.   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
  314. #endif
  315. #if PY_MAJOR_VERSION >= 3
  316.   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
  317. #else
  318.   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
  319. #endif
  320. #if CYTHON_USE_ASYNC_SLOTS
  321.   #if PY_VERSION_HEX >= 0x030500B1
  322.     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
  323.     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  324.   #else
  325.     typedef struct {
  326.         unaryfunc am_await;
  327.         unaryfunc am_aiter;
  328.         unaryfunc am_anext;
  329.     } __Pyx_PyAsyncMethodsStruct;
  330.     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  331.   #endif
  332. #else
  333.   #define __Pyx_PyType_AsAsync(obj) NULL
  334. #endif
  335. #ifndef CYTHON_RESTRICT
  336.   #if defined(__GNUC__)
  337.     #define CYTHON_RESTRICT __restrict__
  338.   #elif defined(_MSC_VER) && _MSC_VER >= 1400
  339.     #define CYTHON_RESTRICT __restrict
  340.   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  341.     #define CYTHON_RESTRICT restrict
  342.   #else
  343.     #define CYTHON_RESTRICT
  344.   #endif
  345. #endif
  346. #ifndef CYTHON_UNUSED
  347. # if defined(__GNUC__)
  348. #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  349. #     define CYTHON_UNUSED __attribute__ ((__unused__))
  350. #   else
  351. #     define CYTHON_UNUSED
  352. #   endif
  353. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  354. #   define CYTHON_UNUSED __attribute__ ((__unused__))
  355. # else
  356. #   define CYTHON_UNUSED
  357. # endif
  358. #endif
  359. #ifndef CYTHON_MAYBE_UNUSED_VAR
  360. #  if defined(__cplusplus)
  361.      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
  362. #  else
  363. #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
  364. #  endif
  365. #endif
  366. #ifndef CYTHON_NCP_UNUSED
  367. # if CYTHON_COMPILING_IN_CPYTHON
  368. #  define CYTHON_NCP_UNUSED
  369. # else
  370. #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
  371. # endif
  372. #endif
  373. #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
  374.  
  375. #ifndef CYTHON_INLINE
  376.   #if defined(__clang__)
  377.     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  378.   #elif defined(__GNUC__)
  379.     #define CYTHON_INLINE __inline__
  380.   #elif defined(_MSC_VER)
  381.     #define CYTHON_INLINE __inline
  382.   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  383.     #define CYTHON_INLINE inline
  384.   #else
  385.     #define CYTHON_INLINE
  386.   #endif
  387. #endif
  388.  
  389. #if defined(WIN32) || defined(MS_WINDOWS)
  390.   #define _USE_MATH_DEFINES
  391. #endif
  392. #include <math.h>
  393. #ifdef NAN
  394. #define __PYX_NAN() ((float) NAN)
  395. #else
  396. static CYTHON_INLINE float __PYX_NAN() {
  397.   float value;
  398.   memset(&value, 0xFF, sizeof(value));
  399.   return value;
  400. }
  401. #endif
  402. #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
  403. #define __Pyx_truncl trunc
  404. #else
  405. #define __Pyx_truncl truncl
  406. #endif
  407.  
  408.  
  409. #define __PYX_ERR(f_index, lineno, Ln_error) \
  410. { \
  411.   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
  412. }
  413.  
  414. #if PY_MAJOR_VERSION >= 3
  415.   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  416.   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
  417. #else
  418.   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  419.   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
  420. #endif
  421.  
  422. #ifndef __PYX_EXTERN_C
  423.   #ifdef __cplusplus
  424.     #define __PYX_EXTERN_C extern "C"
  425.   #else
  426.     #define __PYX_EXTERN_C extern
  427.   #endif
  428. #endif
  429.  
  430. #define __PYX_HAVE__definir_tipo_dato
  431. #define __PYX_HAVE_API__definir_tipo_dato
  432. #ifdef _OPENMP
  433. #include <omp.h>
  434. #endif /* _OPENMP */
  435.  
  436. #ifdef PYREX_WITHOUT_ASSERTIONS
  437. #define CYTHON_WITHOUT_ASSERTIONS
  438. #endif
  439.  
  440. typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
  441.                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
  442.  
  443. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  444. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  445. #define __PYX_DEFAULT_STRING_ENCODING ""
  446. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  447. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  448. #define __Pyx_uchar_cast(c) ((unsigned char)c)
  449. #define __Pyx_long_cast(x) ((long)x)
  450. #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
  451.     (sizeof(type) < sizeof(Py_ssize_t))  ||\
  452.     (sizeof(type) > sizeof(Py_ssize_t) &&\
  453.           likely(v < (type)PY_SSIZE_T_MAX ||\
  454.                  v == (type)PY_SSIZE_T_MAX)  &&\
  455.           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
  456.                                 v == (type)PY_SSIZE_T_MIN)))  ||\
  457.     (sizeof(type) == sizeof(Py_ssize_t) &&\
  458.           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
  459.                                v == (type)PY_SSIZE_T_MAX)))  )
  460. #if defined (__cplusplus) && __cplusplus >= 201103L
  461.     #include <cstdlib>
  462.     #define __Pyx_sst_abs(value) std::abs(value)
  463. #elif SIZEOF_INT >= SIZEOF_SIZE_T
  464.     #define __Pyx_sst_abs(value) abs(value)
  465. #elif SIZEOF_LONG >= SIZEOF_SIZE_T
  466.     #define __Pyx_sst_abs(value) labs(value)
  467. #elif defined (_MSC_VER) && defined (_M_X64)
  468.     #define __Pyx_sst_abs(value) _abs64(value)
  469. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  470.     #define __Pyx_sst_abs(value) llabs(value)
  471. #elif defined (__GNUC__)
  472.     #define __Pyx_sst_abs(value) __builtin_llabs(value)
  473. #else
  474.     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
  475. #endif
  476. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
  477. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  478. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  479. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  480. #define __Pyx_PyBytes_FromString        PyBytes_FromString
  481. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  482. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  483. #if PY_MAJOR_VERSION < 3
  484.     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
  485.     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  486. #else
  487.     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
  488.     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  489. #endif
  490. #define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
  491. #define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
  492. #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
  493. #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
  494. #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
  495. #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
  496. #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
  497. #if PY_MAJOR_VERSION < 3
  498. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  499. {
  500.     const Py_UNICODE *u_end = u;
  501.     while (*u_end++) ;
  502.     return (size_t)(u_end - u - 1);
  503. }
  504. #else
  505. #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
  506. #endif
  507. #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  508. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  509. #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
  510. #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
  511. #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
  512. #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
  513. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  514. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
  515. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  516. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  517. #if CYTHON_ASSUME_SAFE_MACROS
  518. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  519. #else
  520. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  521. #endif
  522. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  523. #if PY_MAJOR_VERSION >= 3
  524. #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
  525. #else
  526. #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
  527. #endif
  528. #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
  529. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  530. static int __Pyx_sys_getdefaultencoding_not_ascii;
  531. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  532.     PyObject* sys;
  533.     PyObject* default_encoding = NULL;
  534.     PyObject* ascii_chars_u = NULL;
  535.     PyObject* ascii_chars_b = NULL;
  536.     const char* default_encoding_c;
  537.     sys = PyImport_ImportModule("sys");
  538.     if (!sys) goto bad;
  539.     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
  540.     Py_DECREF(sys);
  541.     if (!default_encoding) goto bad;
  542.     default_encoding_c = PyBytes_AsString(default_encoding);
  543.     if (!default_encoding_c) goto bad;
  544.     if (strcmp(default_encoding_c, "ascii") == 0) {
  545.         __Pyx_sys_getdefaultencoding_not_ascii = 0;
  546.     } else {
  547.         char ascii_chars[128];
  548.         int c;
  549.         for (c = 0; c < 128; c++) {
  550.             ascii_chars[c] = c;
  551.         }
  552.         __Pyx_sys_getdefaultencoding_not_ascii = 1;
  553.         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  554.         if (!ascii_chars_u) goto bad;
  555.         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  556.         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  557.             PyErr_Format(
  558.                 PyExc_ValueError,
  559.                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  560.                 default_encoding_c);
  561.             goto bad;
  562.         }
  563.         Py_DECREF(ascii_chars_u);
  564.         Py_DECREF(ascii_chars_b);
  565.     }
  566.     Py_DECREF(default_encoding);
  567.     return 0;
  568. bad:
  569.     Py_XDECREF(default_encoding);
  570.     Py_XDECREF(ascii_chars_u);
  571.     Py_XDECREF(ascii_chars_b);
  572.     return -1;
  573. }
  574. #endif
  575. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  576. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  577. #else
  578. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  579. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  580. static char* __PYX_DEFAULT_STRING_ENCODING;
  581. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  582.     PyObject* sys;
  583.     PyObject* default_encoding = NULL;
  584.     char* default_encoding_c;
  585.     sys = PyImport_ImportModule("sys");
  586.     if (!sys) goto bad;
  587.     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  588.     Py_DECREF(sys);
  589.     if (!default_encoding) goto bad;
  590.     default_encoding_c = PyBytes_AsString(default_encoding);
  591.     if (!default_encoding_c) goto bad;
  592.     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  593.     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
  594.     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  595.     Py_DECREF(default_encoding);
  596.     return 0;
  597. bad:
  598.     Py_XDECREF(default_encoding);
  599.     return -1;
  600. }
  601. #endif
  602. #endif
  603.  
  604.  
  605. /* Test for GCC > 2.95 */
  606. #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  607.   #define likely(x)   __builtin_expect(!!(x), 1)
  608.   #define unlikely(x) __builtin_expect(!!(x), 0)
  609. #else /* !__GNUC__ or GCC < 2.95 */
  610.   #define likely(x)   (x)
  611.   #define unlikely(x) (x)
  612. #endif /* __GNUC__ */
  613.  
  614. static PyObject *__pyx_m;
  615. static PyObject *__pyx_d;
  616. static PyObject *__pyx_b;
  617. static PyObject *__pyx_empty_tuple;
  618. static PyObject *__pyx_empty_bytes;
  619. static PyObject *__pyx_empty_unicode;
  620. static int __pyx_lineno;
  621. static int __pyx_clineno = 0;
  622. static const char * __pyx_cfilenm= __FILE__;
  623. static const char *__pyx_filename;
  624.  
  625.  
  626. static const char *__pyx_f[] = {
  627.   "definir_tipo_dato.pyx",
  628. };
  629.  
  630. /*--- Type declarations ---*/
  631.  
  632. /* --- Runtime support code (head) --- */
  633. /* Refnanny.proto */
  634. #ifndef CYTHON_REFNANNY
  635.   #define CYTHON_REFNANNY 0
  636. #endif
  637. #if CYTHON_REFNANNY
  638.   typedef struct {
  639.     void (*INCREF)(void*, PyObject*, int);
  640.     void (*DECREF)(void*, PyObject*, int);
  641.     void (*GOTREF)(void*, PyObject*, int);
  642.     void (*GIVEREF)(void*, PyObject*, int);
  643.     void* (*SetupContext)(const char*, int, const char*);
  644.     void (*FinishContext)(void**);
  645.   } __Pyx_RefNannyAPIStruct;
  646.   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  647.   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  648.   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  649. #ifdef WITH_THREAD
  650.   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  651.           if (acquire_gil) {\
  652.               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  653.               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  654.               PyGILState_Release(__pyx_gilstate_save);\
  655.           } else {\
  656.               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  657.           }
  658. #else
  659.   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  660.           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  661. #endif
  662.   #define __Pyx_RefNannyFinishContext()\
  663.           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  664.   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  665.   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  666.   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  667.   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  668.   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  669.   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  670.   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  671.   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  672. #else
  673.   #define __Pyx_RefNannyDeclarations
  674.   #define __Pyx_RefNannySetupContext(name, acquire_gil)
  675.   #define __Pyx_RefNannyFinishContext()
  676.   #define __Pyx_INCREF(r) Py_INCREF(r)
  677.   #define __Pyx_DECREF(r) Py_DECREF(r)
  678.   #define __Pyx_GOTREF(r)
  679.   #define __Pyx_GIVEREF(r)
  680.   #define __Pyx_XINCREF(r) Py_XINCREF(r)
  681.   #define __Pyx_XDECREF(r) Py_XDECREF(r)
  682.   #define __Pyx_XGOTREF(r)
  683.   #define __Pyx_XGIVEREF(r)
  684. #endif
  685. #define __Pyx_XDECREF_SET(r, v) do {\
  686.         PyObject *tmp = (PyObject *) r;\
  687.         r = v; __Pyx_XDECREF(tmp);\
  688.     } while (0)
  689. #define __Pyx_DECREF_SET(r, v) do {\
  690.         PyObject *tmp = (PyObject *) r;\
  691.         r = v; __Pyx_DECREF(tmp);\
  692.     } while (0)
  693. #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  694. #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  695.  
  696. /* PyObjectGetAttrStr.proto */
  697. #if CYTHON_USE_TYPE_SLOTS
  698. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  699.     PyTypeObject* tp = Py_TYPE(obj);
  700.     if (likely(tp->tp_getattro))
  701.         return tp->tp_getattro(obj, attr_name);
  702. #if PY_MAJOR_VERSION < 3
  703.     if (likely(tp->tp_getattr))
  704.         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  705. #endif
  706.     return PyObject_GetAttr(obj, attr_name);
  707. }
  708. #else
  709. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  710. #endif
  711.  
  712. /* GetBuiltinName.proto */
  713. static PyObject *__Pyx_GetBuiltinName(PyObject *name);
  714.  
  715. /* RaiseArgTupleInvalid.proto */
  716. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  717.     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
  718.  
  719. /* RaiseDoubleKeywords.proto */
  720. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
  721.  
  722. /* ParseKeywords.proto */
  723. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
  724.     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
  725.     const char* function_name);
  726.  
  727. /* GetModuleGlobalName.proto */
  728. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
  729.  
  730. /* PyCFunctionFastCall.proto */
  731. #if CYTHON_FAST_PYCCALL
  732. static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
  733. #else
  734. #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
  735. #endif
  736.  
  737. /* PyFunctionFastCall.proto */
  738. #if CYTHON_FAST_PYCALL
  739. #define __Pyx_PyFunction_FastCall(func, args, nargs)\
  740.     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
  741. #if 1 || PY_VERSION_HEX < 0x030600B1
  742. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
  743. #else
  744. #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
  745. #endif
  746. #endif
  747.  
  748. /* PyObjectCall.proto */
  749. #if CYTHON_COMPILING_IN_CPYTHON
  750. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
  751. #else
  752. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  753. #endif
  754.  
  755. /* PyObjectCallMethO.proto */
  756. #if CYTHON_COMPILING_IN_CPYTHON
  757. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
  758. #endif
  759.  
  760. /* PyObjectCallOneArg.proto */
  761. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
  762.  
  763. /* CodeObjectCache.proto */
  764. typedef struct {
  765.     PyCodeObject* code_object;
  766.     int code_line;
  767. } __Pyx_CodeObjectCacheEntry;
  768. struct __Pyx_CodeObjectCache {
  769.     int count;
  770.     int max_count;
  771.     __Pyx_CodeObjectCacheEntry* entries;
  772. };
  773. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  774. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  775. static PyCodeObject *__pyx_find_code_object(int code_line);
  776. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  777.  
  778. /* AddTraceback.proto */
  779. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  780.                                int py_line, const char *filename);
  781.  
  782. /* CIntToPy.proto */
  783. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  784.  
  785. /* CIntFromPy.proto */
  786. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  787.  
  788. /* CIntToPy.proto */
  789. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  790.  
  791. /* CIntFromPy.proto */
  792. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  793.  
  794. /* CheckBinaryVersion.proto */
  795. static int __Pyx_check_binary_version(void);
  796.  
  797. /* InitStrings.proto */
  798. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
  799.  
  800.  
  801. /* Module declarations from 'definir_tipo_dato' */
  802. #define __Pyx_MODULE_NAME "definir_tipo_dato"
  803. int __pyx_module_is_main_definir_tipo_dato = 0;
  804.  
  805. /* Implementation of 'definir_tipo_dato' */
  806. static PyObject *__pyx_builtin_range;
  807. static const char __pyx_k_N[] = "N";
  808. static const char __pyx_k_i[] = "i";
  809. static const char __pyx_k_s[] = "s";
  810. static const char __pyx_k_x[] = "x";
  811. static const char __pyx_k_dx[] = "dx";
  812. static const char __pyx_k_main[] = "__main__";
  813. static const char __pyx_k_test[] = "__test__";
  814. static const char __pyx_k_range[] = "range";
  815. static const char __pyx_k_funcion[] = "funcion";
  816. static const char __pyx_k_limite_inferior[] = "limite_inferior";
  817. static const char __pyx_k_limite_superior[] = "limite_superior";
  818. static const char __pyx_k_integrar_funcion[] = "integrar_funcion";
  819. static const char __pyx_k_definir_tipo_dato[] = "definir_tipo_dato";
  820. static const char __pyx_k_F_Dropbox_Lib_Docs_Backups_Recet[] = "F:\\Dropbox\\Lib\\Docs\\Backups\\Recetas\\Python\\definir_tipo_dato.pyx";
  821. static PyObject *__pyx_kp_s_F_Dropbox_Lib_Docs_Backups_Recet;
  822. static PyObject *__pyx_n_s_N;
  823. static PyObject *__pyx_n_s_definir_tipo_dato;
  824. static PyObject *__pyx_n_s_dx;
  825. static PyObject *__pyx_n_s_funcion;
  826. static PyObject *__pyx_n_s_i;
  827. static PyObject *__pyx_n_s_integrar_funcion;
  828. static PyObject *__pyx_n_s_limite_inferior;
  829. static PyObject *__pyx_n_s_limite_superior;
  830. static PyObject *__pyx_n_s_main;
  831. static PyObject *__pyx_n_s_range;
  832. static PyObject *__pyx_n_s_s;
  833. static PyObject *__pyx_n_s_test;
  834. static PyObject *__pyx_n_s_x;
  835. static PyObject *__pyx_pf_17definir_tipo_dato_funcion(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x); /* proto */
  836. static PyObject *__pyx_pf_17definir_tipo_dato_2integrar_funcion(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_limite_inferior, double __pyx_v_limite_superior, int __pyx_v_N); /* proto */
  837. static PyObject *__pyx_tuple_;
  838. static PyObject *__pyx_tuple__3;
  839. static PyObject *__pyx_codeobj__2;
  840. static PyObject *__pyx_codeobj__4;
  841.  
  842. /* "definir_tipo_dato.pyx":1
  843.  * def funcion(double x):             # <<<<<<<<<<<<<<
  844.  *  return x**2 - 42;
  845.  *
  846.  */
  847.  
  848. /* Python wrapper */
  849. static PyObject *__pyx_pw_17definir_tipo_dato_1funcion(PyObject *__pyx_self, PyObject *__pyx_arg_x); /*proto*/
  850. static PyMethodDef __pyx_mdef_17definir_tipo_dato_1funcion = {"funcion", (PyCFunction)__pyx_pw_17definir_tipo_dato_1funcion, METH_O, 0};
  851. static PyObject *__pyx_pw_17definir_tipo_dato_1funcion(PyObject *__pyx_self, PyObject *__pyx_arg_x) {
  852.   double __pyx_v_x;
  853.   PyObject *__pyx_r = 0;
  854.   __Pyx_RefNannyDeclarations
  855.   __Pyx_RefNannySetupContext("funcion (wrapper)", 0);
  856.   assert(__pyx_arg_x); {
  857.     __pyx_v_x = __pyx_PyFloat_AsDouble(__pyx_arg_x); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
  858.   }
  859.   goto __pyx_L4_argument_unpacking_done;
  860.   __pyx_L3_error:;
  861.   __Pyx_AddTraceback("definir_tipo_dato.funcion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  862.   __Pyx_RefNannyFinishContext();
  863.   return NULL;
  864.   __pyx_L4_argument_unpacking_done:;
  865.   __pyx_r = __pyx_pf_17definir_tipo_dato_funcion(__pyx_self, ((double)__pyx_v_x));
  866.  
  867.   /* function exit code */
  868.   __Pyx_RefNannyFinishContext();
  869.   return __pyx_r;
  870. }
  871.  
  872. static PyObject *__pyx_pf_17definir_tipo_dato_funcion(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x) {
  873.   PyObject *__pyx_r = NULL;
  874.   __Pyx_RefNannyDeclarations
  875.   PyObject *__pyx_t_1 = NULL;
  876.   __Pyx_RefNannySetupContext("funcion", 0);
  877.  
  878.   /* "definir_tipo_dato.pyx":2
  879.  * def funcion(double x):
  880.  *  return x**2 - 42;             # <<<<<<<<<<<<<<
  881.  *
  882.  *
  883.  */
  884.   __Pyx_XDECREF(__pyx_r);
  885.   __pyx_t_1 = PyFloat_FromDouble((pow(__pyx_v_x, 2.0) - 42.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  886.   __Pyx_GOTREF(__pyx_t_1);
  887.   __pyx_r = __pyx_t_1;
  888.   __pyx_t_1 = 0;
  889.   goto __pyx_L0;
  890.  
  891.   /* "definir_tipo_dato.pyx":1
  892.  * def funcion(double x):             # <<<<<<<<<<<<<<
  893.  *  return x**2 - 42;
  894.  *
  895.  */
  896.  
  897.   /* function exit code */
  898.   __pyx_L1_error:;
  899.   __Pyx_XDECREF(__pyx_t_1);
  900.   __Pyx_AddTraceback("definir_tipo_dato.funcion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  901.   __pyx_r = NULL;
  902.   __pyx_L0:;
  903.   __Pyx_XGIVEREF(__pyx_r);
  904.   __Pyx_RefNannyFinishContext();
  905.   return __pyx_r;
  906. }
  907.  
  908. /* "definir_tipo_dato.pyx":5
  909.  *
  910.  *
  911.  * def integrar_funcion(double limite_inferior, double limite_superior, int N):             # <<<<<<<<<<<<<<
  912.  *  cdef int i
  913.  *  cdef double s, dx
  914.  */
  915.  
  916. /* Python wrapper */
  917. static PyObject *__pyx_pw_17definir_tipo_dato_3integrar_funcion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  918. static PyMethodDef __pyx_mdef_17definir_tipo_dato_3integrar_funcion = {"integrar_funcion", (PyCFunction)__pyx_pw_17definir_tipo_dato_3integrar_funcion, METH_VARARGS|METH_KEYWORDS, 0};
  919. static PyObject *__pyx_pw_17definir_tipo_dato_3integrar_funcion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  920.   double __pyx_v_limite_inferior;
  921.   double __pyx_v_limite_superior;
  922.   int __pyx_v_N;
  923.   PyObject *__pyx_r = 0;
  924.   __Pyx_RefNannyDeclarations
  925.   __Pyx_RefNannySetupContext("integrar_funcion (wrapper)", 0);
  926.   {
  927.     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_limite_inferior,&__pyx_n_s_limite_superior,&__pyx_n_s_N,0};
  928.     PyObject* values[3] = {0,0,0};
  929.     if (unlikely(__pyx_kwds)) {
  930.       Py_ssize_t kw_args;
  931.       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  932.       switch (pos_args) {
  933.         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  934.         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  935.         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  936.         case  0: break;
  937.         default: goto __pyx_L5_argtuple_error;
  938.       }
  939.       kw_args = PyDict_Size(__pyx_kwds);
  940.       switch (pos_args) {
  941.         case  0:
  942.         if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limite_inferior)) != 0)) kw_args--;
  943.         else goto __pyx_L5_argtuple_error;
  944.         case  1:
  945.         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limite_superior)) != 0)) kw_args--;
  946.         else {
  947.           __Pyx_RaiseArgtupleInvalid("integrar_funcion", 1, 3, 3, 1); __PYX_ERR(0, 5, __pyx_L3_error)
  948.         }
  949.         case  2:
  950.         if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
  951.         else {
  952.           __Pyx_RaiseArgtupleInvalid("integrar_funcion", 1, 3, 3, 2); __PYX_ERR(0, 5, __pyx_L3_error)
  953.         }
  954.       }
  955.       if (unlikely(kw_args > 0)) {
  956.         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "integrar_funcion") < 0)) __PYX_ERR(0, 5, __pyx_L3_error)
  957.       }
  958.     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  959.       goto __pyx_L5_argtuple_error;
  960.     } else {
  961.       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  962.       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  963.       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  964.     }
  965.     __pyx_v_limite_inferior = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_limite_inferior == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5, __pyx_L3_error)
  966.     __pyx_v_limite_superior = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_limite_superior == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 5, __pyx_L3_error)
  967.     __pyx_v_N = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 5, __pyx_L3_error)
  968.   }
  969.   goto __pyx_L4_argument_unpacking_done;
  970.   __pyx_L5_argtuple_error:;
  971.   __Pyx_RaiseArgtupleInvalid("integrar_funcion", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 5, __pyx_L3_error)
  972.   __pyx_L3_error:;
  973.   __Pyx_AddTraceback("definir_tipo_dato.integrar_funcion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  974.   __Pyx_RefNannyFinishContext();
  975.   return NULL;
  976.   __pyx_L4_argument_unpacking_done:;
  977.   __pyx_r = __pyx_pf_17definir_tipo_dato_2integrar_funcion(__pyx_self, __pyx_v_limite_inferior, __pyx_v_limite_superior, __pyx_v_N);
  978.  
  979.   /* function exit code */
  980.   __Pyx_RefNannyFinishContext();
  981.   return __pyx_r;
  982. }
  983.  
  984. static PyObject *__pyx_pf_17definir_tipo_dato_2integrar_funcion(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_limite_inferior, double __pyx_v_limite_superior, int __pyx_v_N) {
  985.   int __pyx_v_i;
  986.   double __pyx_v_s;
  987.   double __pyx_v_dx;
  988.   PyObject *__pyx_r = NULL;
  989.   __Pyx_RefNannyDeclarations
  990.   double __pyx_t_1;
  991.   int __pyx_t_2;
  992.   int __pyx_t_3;
  993.   PyObject *__pyx_t_4 = NULL;
  994.   PyObject *__pyx_t_5 = NULL;
  995.   PyObject *__pyx_t_6 = NULL;
  996.   PyObject *__pyx_t_7 = NULL;
  997.   PyObject *__pyx_t_8 = NULL;
  998.   PyObject *__pyx_t_9 = NULL;
  999.   __Pyx_RefNannySetupContext("integrar_funcion", 0);
  1000.  
  1001.   /* "definir_tipo_dato.pyx":9
  1002.  *  cdef double s, dx
  1003.  *
  1004.  *  s = 0             # <<<<<<<<<<<<<<
  1005.  *  dx = (limite_superior - limite_inferior) / N
  1006.  *
  1007.  */
  1008.   __pyx_v_s = 0.0;
  1009.  
  1010.   /* "definir_tipo_dato.pyx":10
  1011.  *
  1012.  *  s = 0
  1013.  *  dx = (limite_superior - limite_inferior) / N             # <<<<<<<<<<<<<<
  1014.  *
  1015.  *  for i in range(N):
  1016.  */
  1017.   __pyx_t_1 = (__pyx_v_limite_superior - __pyx_v_limite_inferior);
  1018.   if (unlikely(__pyx_v_N == 0)) {
  1019.     PyErr_SetString(PyExc_ZeroDivisionError, "float division");
  1020.     __PYX_ERR(0, 10, __pyx_L1_error)
  1021.   }
  1022.   __pyx_v_dx = (__pyx_t_1 / __pyx_v_N);
  1023.  
  1024.   /* "definir_tipo_dato.pyx":12
  1025.  *  dx = (limite_superior - limite_inferior) / N
  1026.  *
  1027.  *  for i in range(N):             # <<<<<<<<<<<<<<
  1028.  *      s  += funcion(limite_inferior + i * dx)
  1029.  *
  1030.  */
  1031.   __pyx_t_2 = __pyx_v_N;
  1032.   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
  1033.     __pyx_v_i = __pyx_t_3;
  1034.  
  1035.     /* "definir_tipo_dato.pyx":13
  1036.  *
  1037.  *  for i in range(N):
  1038.  *      s  += funcion(limite_inferior + i * dx)             # <<<<<<<<<<<<<<
  1039.  *
  1040.  *  return s * dx
  1041.  */
  1042.     __pyx_t_4 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
  1043.     __Pyx_GOTREF(__pyx_t_4);
  1044.     __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_funcion); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 13, __pyx_L1_error)
  1045.     __Pyx_GOTREF(__pyx_t_6);
  1046.     __pyx_t_7 = PyFloat_FromDouble((__pyx_v_limite_inferior + (__pyx_v_i * __pyx_v_dx))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 13, __pyx_L1_error)
  1047.     __Pyx_GOTREF(__pyx_t_7);
  1048.     __pyx_t_8 = NULL;
  1049.     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  1050.       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
  1051.       if (likely(__pyx_t_8)) {
  1052.         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  1053.         __Pyx_INCREF(__pyx_t_8);
  1054.         __Pyx_INCREF(function);
  1055.         __Pyx_DECREF_SET(__pyx_t_6, function);
  1056.       }
  1057.     }
  1058.     if (!__pyx_t_8) {
  1059.       __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
  1060.       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1061.       __Pyx_GOTREF(__pyx_t_5);
  1062.     } else {
  1063.       #if CYTHON_FAST_PYCALL
  1064.       if (PyFunction_Check(__pyx_t_6)) {
  1065.         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
  1066.         __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
  1067.         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  1068.         __Pyx_GOTREF(__pyx_t_5);
  1069.         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1070.       } else
  1071.       #endif
  1072.       #if CYTHON_FAST_PYCCALL
  1073.       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  1074.         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
  1075.         __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
  1076.         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  1077.         __Pyx_GOTREF(__pyx_t_5);
  1078.         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1079.       } else
  1080.       #endif
  1081.       {
  1082.         __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 13, __pyx_L1_error)
  1083.         __Pyx_GOTREF(__pyx_t_9);
  1084.         __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
  1085.         __Pyx_GIVEREF(__pyx_t_7);
  1086.         PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
  1087.         __pyx_t_7 = 0;
  1088.         __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
  1089.         __Pyx_GOTREF(__pyx_t_5);
  1090.         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  1091.       }
  1092.     }
  1093.     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1094.     __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 13, __pyx_L1_error)
  1095.     __Pyx_GOTREF(__pyx_t_6);
  1096.     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1097.     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1098.     __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 13, __pyx_L1_error)
  1099.     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1100.     __pyx_v_s = __pyx_t_1;
  1101.   }
  1102.  
  1103.   /* "definir_tipo_dato.pyx":15
  1104.  *      s  += funcion(limite_inferior + i * dx)
  1105.  *
  1106.  *  return s * dx             # <<<<<<<<<<<<<<
  1107.  */
  1108.   __Pyx_XDECREF(__pyx_r);
  1109.   __pyx_t_6 = PyFloat_FromDouble((__pyx_v_s * __pyx_v_dx)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 15, __pyx_L1_error)
  1110.   __Pyx_GOTREF(__pyx_t_6);
  1111.   __pyx_r = __pyx_t_6;
  1112.   __pyx_t_6 = 0;
  1113.   goto __pyx_L0;
  1114.  
  1115.   /* "definir_tipo_dato.pyx":5
  1116.  *
  1117.  *
  1118.  * def integrar_funcion(double limite_inferior, double limite_superior, int N):             # <<<<<<<<<<<<<<
  1119.  *  cdef int i
  1120.  *  cdef double s, dx
  1121.  */
  1122.  
  1123.   /* function exit code */
  1124.   __pyx_L1_error:;
  1125.   __Pyx_XDECREF(__pyx_t_4);
  1126.   __Pyx_XDECREF(__pyx_t_5);
  1127.   __Pyx_XDECREF(__pyx_t_6);
  1128.   __Pyx_XDECREF(__pyx_t_7);
  1129.   __Pyx_XDECREF(__pyx_t_8);
  1130.   __Pyx_XDECREF(__pyx_t_9);
  1131.   __Pyx_AddTraceback("definir_tipo_dato.integrar_funcion", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1132.   __pyx_r = NULL;
  1133.   __pyx_L0:;
  1134.   __Pyx_XGIVEREF(__pyx_r);
  1135.   __Pyx_RefNannyFinishContext();
  1136.   return __pyx_r;
  1137. }
  1138.  
  1139. static PyMethodDef __pyx_methods[] = {
  1140.   {0, 0, 0, 0}
  1141. };
  1142.  
  1143. #if PY_MAJOR_VERSION >= 3
  1144. static struct PyModuleDef __pyx_moduledef = {
  1145.   #if PY_VERSION_HEX < 0x03020000
  1146.     { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  1147.   #else
  1148.     PyModuleDef_HEAD_INIT,
  1149.   #endif
  1150.     "definir_tipo_dato",
  1151.     0, /* m_doc */
  1152.     -1, /* m_size */
  1153.     __pyx_methods /* m_methods */,
  1154.     NULL, /* m_reload */
  1155.     NULL, /* m_traverse */
  1156.     NULL, /* m_clear */
  1157.     NULL /* m_free */
  1158. };
  1159. #endif
  1160.  
  1161. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  1162.   {&__pyx_kp_s_F_Dropbox_Lib_Docs_Backups_Recet, __pyx_k_F_Dropbox_Lib_Docs_Backups_Recet, sizeof(__pyx_k_F_Dropbox_Lib_Docs_Backups_Recet), 0, 0, 1, 0},
  1163.   {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
  1164.   {&__pyx_n_s_definir_tipo_dato, __pyx_k_definir_tipo_dato, sizeof(__pyx_k_definir_tipo_dato), 0, 0, 1, 1},
  1165.   {&__pyx_n_s_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 0, 0, 1, 1},
  1166.   {&__pyx_n_s_funcion, __pyx_k_funcion, sizeof(__pyx_k_funcion), 0, 0, 1, 1},
  1167.   {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  1168.   {&__pyx_n_s_integrar_funcion, __pyx_k_integrar_funcion, sizeof(__pyx_k_integrar_funcion), 0, 0, 1, 1},
  1169.   {&__pyx_n_s_limite_inferior, __pyx_k_limite_inferior, sizeof(__pyx_k_limite_inferior), 0, 0, 1, 1},
  1170.   {&__pyx_n_s_limite_superior, __pyx_k_limite_superior, sizeof(__pyx_k_limite_superior), 0, 0, 1, 1},
  1171.   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  1172.   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  1173.   {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  1174.   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  1175.   {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  1176.   {0, 0, 0, 0, 0, 0, 0}
  1177. };
  1178. static int __Pyx_InitCachedBuiltins(void) {
  1179.   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 12, __pyx_L1_error)
  1180.   return 0;
  1181.   __pyx_L1_error:;
  1182.   return -1;
  1183. }
  1184.  
  1185. static int __Pyx_InitCachedConstants(void) {
  1186.   __Pyx_RefNannyDeclarations
  1187.   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  1188.  
  1189.   /* "definir_tipo_dato.pyx":1
  1190.  * def funcion(double x):             # <<<<<<<<<<<<<<
  1191.  *  return x**2 - 42;
  1192.  *
  1193.  */
  1194.   __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_x); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 1, __pyx_L1_error)
  1195.   __Pyx_GOTREF(__pyx_tuple_);
  1196.   __Pyx_GIVEREF(__pyx_tuple_);
  1197.   __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_F_Dropbox_Lib_Docs_Backups_Recet, __pyx_n_s_funcion, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 1, __pyx_L1_error)
  1198.  
  1199.   /* "definir_tipo_dato.pyx":5
  1200.  *
  1201.  *
  1202.  * def integrar_funcion(double limite_inferior, double limite_superior, int N):             # <<<<<<<<<<<<<<
  1203.  *  cdef int i
  1204.  *  cdef double s, dx
  1205.  */
  1206.   __pyx_tuple__3 = PyTuple_Pack(6, __pyx_n_s_limite_inferior, __pyx_n_s_limite_superior, __pyx_n_s_N, __pyx_n_s_i, __pyx_n_s_s, __pyx_n_s_dx); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 5, __pyx_L1_error)
  1207.   __Pyx_GOTREF(__pyx_tuple__3);
  1208.   __Pyx_GIVEREF(__pyx_tuple__3);
  1209.   __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_F_Dropbox_Lib_Docs_Backups_Recet, __pyx_n_s_integrar_funcion, 5, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 5, __pyx_L1_error)
  1210.   __Pyx_RefNannyFinishContext();
  1211.   return 0;
  1212.   __pyx_L1_error:;
  1213.   __Pyx_RefNannyFinishContext();
  1214.   return -1;
  1215. }
  1216.  
  1217. static int __Pyx_InitGlobals(void) {
  1218.   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  1219.   return 0;
  1220.   __pyx_L1_error:;
  1221.   return -1;
  1222. }
  1223.  
  1224. #if PY_MAJOR_VERSION < 3
  1225. PyMODINIT_FUNC initdefinir_tipo_dato(void); /*proto*/
  1226. PyMODINIT_FUNC initdefinir_tipo_dato(void)
  1227. #else
  1228. PyMODINIT_FUNC PyInit_definir_tipo_dato(void); /*proto*/
  1229. PyMODINIT_FUNC PyInit_definir_tipo_dato(void)
  1230. #endif
  1231. {
  1232.   PyObject *__pyx_t_1 = NULL;
  1233.   __Pyx_RefNannyDeclarations
  1234.   #if CYTHON_REFNANNY
  1235.   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  1236.   if (!__Pyx_RefNanny) {
  1237.       PyErr_Clear();
  1238.       __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  1239.       if (!__Pyx_RefNanny)
  1240.           Py_FatalError("failed to import 'refnanny' module");
  1241.   }
  1242.   #endif
  1243.   __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_definir_tipo_dato(void)", 0);
  1244.   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1245.   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  1246.   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  1247.   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  1248.   #ifdef __Pyx_CyFunction_USED
  1249.   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1250.   #endif
  1251.   #ifdef __Pyx_FusedFunction_USED
  1252.   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1253.   #endif
  1254.   #ifdef __Pyx_Coroutine_USED
  1255.   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1256.   #endif
  1257.   #ifdef __Pyx_Generator_USED
  1258.   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1259.   #endif
  1260.   #ifdef __Pyx_StopAsyncIteration_USED
  1261.   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1262.   #endif
  1263.   /*--- Library function declarations ---*/
  1264.   /*--- Threads initialization code ---*/
  1265.   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  1266.   #ifdef WITH_THREAD /* Python build with threading support? */
  1267.   PyEval_InitThreads();
  1268.   #endif
  1269.   #endif
  1270.   /*--- Module creation code ---*/
  1271.   #if PY_MAJOR_VERSION < 3
  1272.   __pyx_m = Py_InitModule4("definir_tipo_dato", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  1273.   #else
  1274.   __pyx_m = PyModule_Create(&__pyx_moduledef);
  1275.   #endif
  1276.   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  1277.   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  1278.   Py_INCREF(__pyx_d);
  1279.   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  1280.   #if CYTHON_COMPILING_IN_PYPY
  1281.   Py_INCREF(__pyx_b);
  1282.   #endif
  1283.   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  1284.   /*--- Initialize various global constants etc. ---*/
  1285.   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1286.   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  1287.   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1288.   #endif
  1289.   if (__pyx_module_is_main_definir_tipo_dato) {
  1290.     if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1291.   }
  1292.   #if PY_MAJOR_VERSION >= 3
  1293.   {
  1294.     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  1295.     if (!PyDict_GetItemString(modules, "definir_tipo_dato")) {
  1296.       if (unlikely(PyDict_SetItemString(modules, "definir_tipo_dato", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  1297.     }
  1298.   }
  1299.   #endif
  1300.   /*--- Builtin init code ---*/
  1301.   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1302.   /*--- Constants init code ---*/
  1303.   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1304.   /*--- Global init code ---*/
  1305.   /*--- Variable export code ---*/
  1306.   /*--- Function export code ---*/
  1307.   /*--- Type init code ---*/
  1308.   /*--- Type import code ---*/
  1309.   /*--- Variable import code ---*/
  1310.   /*--- Function import code ---*/
  1311.   /*--- Execution code ---*/
  1312.   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  1313.   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1314.   #endif
  1315.  
  1316.   /* "definir_tipo_dato.pyx":1
  1317.  * def funcion(double x):             # <<<<<<<<<<<<<<
  1318.  *  return x**2 - 42;
  1319.  *
  1320.  */
  1321.   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_17definir_tipo_dato_1funcion, NULL, __pyx_n_s_definir_tipo_dato); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  1322.   __Pyx_GOTREF(__pyx_t_1);
  1323.   if (PyDict_SetItem(__pyx_d, __pyx_n_s_funcion, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1324.   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1325.  
  1326.   /* "definir_tipo_dato.pyx":5
  1327.  *
  1328.  *
  1329.  * def integrar_funcion(double limite_inferior, double limite_superior, int N):             # <<<<<<<<<<<<<<
  1330.  *  cdef int i
  1331.  *  cdef double s, dx
  1332.  */
  1333.   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_17definir_tipo_dato_3integrar_funcion, NULL, __pyx_n_s_definir_tipo_dato); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
  1334.   __Pyx_GOTREF(__pyx_t_1);
  1335.   if (PyDict_SetItem(__pyx_d, __pyx_n_s_integrar_funcion, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
  1336.   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1337.  
  1338.   /* "definir_tipo_dato.pyx":1
  1339.  * def funcion(double x):             # <<<<<<<<<<<<<<
  1340.  *  return x**2 - 42;
  1341.  *
  1342.  */
  1343.   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  1344.   __Pyx_GOTREF(__pyx_t_1);
  1345.   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  1346.   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1347.  
  1348.   /*--- Wrapped vars code ---*/
  1349.  
  1350.   goto __pyx_L0;
  1351.   __pyx_L1_error:;
  1352.   __Pyx_XDECREF(__pyx_t_1);
  1353.   if (__pyx_m) {
  1354.     if (__pyx_d) {
  1355.       __Pyx_AddTraceback("init definir_tipo_dato", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1356.     }
  1357.     Py_DECREF(__pyx_m); __pyx_m = 0;
  1358.   } else if (!PyErr_Occurred()) {
  1359.     PyErr_SetString(PyExc_ImportError, "init definir_tipo_dato");
  1360.   }
  1361.   __pyx_L0:;
  1362.   __Pyx_RefNannyFinishContext();
  1363.   #if PY_MAJOR_VERSION < 3
  1364.   return;
  1365.   #else
  1366.   return __pyx_m;
  1367.   #endif
  1368. }
  1369.  
  1370. /* --- Runtime support code --- */
  1371. /* Refnanny */
  1372. #if CYTHON_REFNANNY
  1373. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  1374.     PyObject *m = NULL, *p = NULL;
  1375.     void *r = NULL;
  1376.     m = PyImport_ImportModule((char *)modname);
  1377.     if (!m) goto end;
  1378.     p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  1379.     if (!p) goto end;
  1380.     r = PyLong_AsVoidPtr(p);
  1381. end:
  1382.     Py_XDECREF(p);
  1383.     Py_XDECREF(m);
  1384.     return (__Pyx_RefNannyAPIStruct *)r;
  1385. }
  1386. #endif
  1387.  
  1388. /* GetBuiltinName */
  1389. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  1390.     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  1391.     if (unlikely(!result)) {
  1392.         PyErr_Format(PyExc_NameError,
  1393. #if PY_MAJOR_VERSION >= 3
  1394.             "name '%U' is not defined", name);
  1395. #else
  1396.             "name '%.200s' is not defined", PyString_AS_STRING(name));
  1397. #endif
  1398.     }
  1399.     return result;
  1400. }
  1401.  
  1402. /* RaiseArgTupleInvalid */
  1403. static void __Pyx_RaiseArgtupleInvalid(
  1404.     const char* func_name,
  1405.     int exact,
  1406.     Py_ssize_t num_min,
  1407.     Py_ssize_t num_max,
  1408.     Py_ssize_t num_found)
  1409. {
  1410.     Py_ssize_t num_expected;
  1411.     const char *more_or_less;
  1412.     if (num_found < num_min) {
  1413.         num_expected = num_min;
  1414.         more_or_less = "at least";
  1415.     } else {
  1416.         num_expected = num_max;
  1417.         more_or_less = "at most";
  1418.     }
  1419.     if (exact) {
  1420.         more_or_less = "exactly";
  1421.     }
  1422.     PyErr_Format(PyExc_TypeError,
  1423.                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  1424.                  func_name, more_or_less, num_expected,
  1425.                  (num_expected == 1) ? "" : "s", num_found);
  1426. }
  1427.  
  1428. /* RaiseDoubleKeywords */
  1429. static void __Pyx_RaiseDoubleKeywordsError(
  1430.     const char* func_name,
  1431.     PyObject* kw_name)
  1432. {
  1433.     PyErr_Format(PyExc_TypeError,
  1434.         #if PY_MAJOR_VERSION >= 3
  1435.         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  1436.         #else
  1437.         "%s() got multiple values for keyword argument '%s'", func_name,
  1438.         PyString_AsString(kw_name));
  1439.         #endif
  1440. }
  1441.  
  1442. /* ParseKeywords */
  1443. static int __Pyx_ParseOptionalKeywords(
  1444.     PyObject *kwds,
  1445.     PyObject **argnames[],
  1446.     PyObject *kwds2,
  1447.     PyObject *values[],
  1448.     Py_ssize_t num_pos_args,
  1449.     const char* function_name)
  1450. {
  1451.     PyObject *key = 0, *value = 0;
  1452.     Py_ssize_t pos = 0;
  1453.     PyObject*** name;
  1454.     PyObject*** first_kw_arg = argnames + num_pos_args;
  1455.     while (PyDict_Next(kwds, &pos, &key, &value)) {
  1456.         name = first_kw_arg;
  1457.         while (*name && (**name != key)) name++;
  1458.         if (*name) {
  1459.             values[name-argnames] = value;
  1460.             continue;
  1461.         }
  1462.         name = first_kw_arg;
  1463.         #if PY_MAJOR_VERSION < 3
  1464.         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  1465.             while (*name) {
  1466.                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  1467.                         && _PyString_Eq(**name, key)) {
  1468.                     values[name-argnames] = value;
  1469.                     break;
  1470.                 }
  1471.                 name++;
  1472.             }
  1473.             if (*name) continue;
  1474.             else {
  1475.                 PyObject*** argname = argnames;
  1476.                 while (argname != first_kw_arg) {
  1477.                     if ((**argname == key) || (
  1478.                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  1479.                              && _PyString_Eq(**argname, key))) {
  1480.                         goto arg_passed_twice;
  1481.                     }
  1482.                     argname++;
  1483.                 }
  1484.             }
  1485.         } else
  1486.         #endif
  1487.         if (likely(PyUnicode_Check(key))) {
  1488.             while (*name) {
  1489.                 int cmp = (**name == key) ? 0 :
  1490.                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  1491.                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  1492.                 #endif
  1493.                     PyUnicode_Compare(**name, key);
  1494.                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  1495.                 if (cmp == 0) {
  1496.                     values[name-argnames] = value;
  1497.                     break;
  1498.                 }
  1499.                 name++;
  1500.             }
  1501.             if (*name) continue;
  1502.             else {
  1503.                 PyObject*** argname = argnames;
  1504.                 while (argname != first_kw_arg) {
  1505.                     int cmp = (**argname == key) ? 0 :
  1506.                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  1507.                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  1508.                     #endif
  1509.                         PyUnicode_Compare(**argname, key);
  1510.                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  1511.                     if (cmp == 0) goto arg_passed_twice;
  1512.                     argname++;
  1513.                 }
  1514.             }
  1515.         } else
  1516.             goto invalid_keyword_type;
  1517.         if (kwds2) {
  1518.             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  1519.         } else {
  1520.             goto invalid_keyword;
  1521.         }
  1522.     }
  1523.     return 0;
  1524. arg_passed_twice:
  1525.     __Pyx_RaiseDoubleKeywordsError(function_name, key);
  1526.     goto bad;
  1527. invalid_keyword_type:
  1528.     PyErr_Format(PyExc_TypeError,
  1529.         "%.200s() keywords must be strings", function_name);
  1530.     goto bad;
  1531. invalid_keyword:
  1532.     PyErr_Format(PyExc_TypeError,
  1533.     #if PY_MAJOR_VERSION < 3
  1534.         "%.200s() got an unexpected keyword argument '%.200s'",
  1535.         function_name, PyString_AsString(key));
  1536.     #else
  1537.         "%s() got an unexpected keyword argument '%U'",
  1538.         function_name, key);
  1539.     #endif
  1540. bad:
  1541.     return -1;
  1542. }
  1543.  
  1544. /* GetModuleGlobalName */
  1545. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  1546.     PyObject *result;
  1547. #if !CYTHON_AVOID_BORROWED_REFS
  1548.     result = PyDict_GetItem(__pyx_d, name);
  1549.     if (likely(result)) {
  1550.         Py_INCREF(result);
  1551.     } else {
  1552. #else
  1553.     result = PyObject_GetItem(__pyx_d, name);
  1554.     if (!result) {
  1555.         PyErr_Clear();
  1556. #endif
  1557.         result = __Pyx_GetBuiltinName(name);
  1558.     }
  1559.     return result;
  1560. }
  1561.  
  1562. /* PyCFunctionFastCall */
  1563.   #if CYTHON_FAST_PYCCALL
  1564. static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
  1565.     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
  1566.     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  1567.     PyObject *self = PyCFunction_GET_SELF(func);
  1568.     assert(PyCFunction_Check(func));
  1569.     assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
  1570.     assert(nargs >= 0);
  1571.     assert(nargs == 0 || args != NULL);
  1572.     /* _PyCFunction_FastCallDict() must not be called with an exception set,
  1573.        because it may clear it (directly or indirectly) and so the
  1574.        caller loses its exception */
  1575.     assert(!PyErr_Occurred());
  1576.     return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
  1577. }
  1578. #endif  // CYTHON_FAST_PYCCALL
  1579.  
  1580. /* PyFunctionFastCall */
  1581.   #if CYTHON_FAST_PYCALL
  1582. #include "frameobject.h"
  1583. static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
  1584.                                                PyObject *globals) {
  1585.     PyFrameObject *f;
  1586.     PyThreadState *tstate = PyThreadState_GET();
  1587.     PyObject **fastlocals;
  1588.     Py_ssize_t i;
  1589.     PyObject *result;
  1590.     assert(globals != NULL);
  1591.     /* XXX Perhaps we should create a specialized
  1592.        PyFrame_New() that doesn't take locals, but does
  1593.        take builtins without sanity checking them.
  1594.        */
  1595.     assert(tstate != NULL);
  1596.     f = PyFrame_New(tstate, co, globals, NULL);
  1597.     if (f == NULL) {
  1598.         return NULL;
  1599.     }
  1600.     fastlocals = f->f_localsplus;
  1601.     for (i = 0; i < na; i++) {
  1602.         Py_INCREF(*args);
  1603.         fastlocals[i] = *args++;
  1604.     }
  1605.     result = PyEval_EvalFrameEx(f,0);
  1606.     ++tstate->recursion_depth;
  1607.     Py_DECREF(f);
  1608.     --tstate->recursion_depth;
  1609.     return result;
  1610. }
  1611. #if 1 || PY_VERSION_HEX < 0x030600B1
  1612. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
  1613.     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
  1614.     PyObject *globals = PyFunction_GET_GLOBALS(func);
  1615.     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
  1616.     PyObject *closure;
  1617. #if PY_MAJOR_VERSION >= 3
  1618.     PyObject *kwdefs;
  1619. #endif
  1620.     PyObject *kwtuple, **k;
  1621.     PyObject **d;
  1622.     Py_ssize_t nd;
  1623.     Py_ssize_t nk;
  1624.     PyObject *result;
  1625.     assert(kwargs == NULL || PyDict_Check(kwargs));
  1626.     nk = kwargs ? PyDict_Size(kwargs) : 0;
  1627.     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
  1628.         return NULL;
  1629.     }
  1630.     if (
  1631. #if PY_MAJOR_VERSION >= 3
  1632.             co->co_kwonlyargcount == 0 &&
  1633. #endif
  1634.             likely(kwargs == NULL || nk == 0) &&
  1635.             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  1636.         if (argdefs == NULL && co->co_argcount == nargs) {
  1637.             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  1638.             goto done;
  1639.         }
  1640.         else if (nargs == 0 && argdefs != NULL
  1641.                  && co->co_argcount == Py_SIZE(argdefs)) {
  1642.             /* function called with no arguments, but all parameters have
  1643.                a default value: use default values as arguments .*/
  1644.             args = &PyTuple_GET_ITEM(argdefs, 0);
  1645.             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
  1646.             goto done;
  1647.         }
  1648.     }
  1649.     if (kwargs != NULL) {
  1650.         Py_ssize_t pos, i;
  1651.         kwtuple = PyTuple_New(2 * nk);
  1652.         if (kwtuple == NULL) {
  1653.             result = NULL;
  1654.             goto done;
  1655.         }
  1656.         k = &PyTuple_GET_ITEM(kwtuple, 0);
  1657.         pos = i = 0;
  1658.         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
  1659.             Py_INCREF(k[i]);
  1660.             Py_INCREF(k[i+1]);
  1661.             i += 2;
  1662.         }
  1663.         nk = i / 2;
  1664.     }
  1665.     else {
  1666.         kwtuple = NULL;
  1667.         k = NULL;
  1668.     }
  1669.     closure = PyFunction_GET_CLOSURE(func);
  1670. #if PY_MAJOR_VERSION >= 3
  1671.     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
  1672. #endif
  1673.     if (argdefs != NULL) {
  1674.         d = &PyTuple_GET_ITEM(argdefs, 0);
  1675.         nd = Py_SIZE(argdefs);
  1676.     }
  1677.     else {
  1678.         d = NULL;
  1679.         nd = 0;
  1680.     }
  1681. #if PY_MAJOR_VERSION >= 3
  1682.     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
  1683.                                args, nargs,
  1684.                                k, (int)nk,
  1685.                                d, (int)nd, kwdefs, closure);
  1686. #else
  1687.     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
  1688.                                args, nargs,
  1689.                                k, (int)nk,
  1690.                                d, (int)nd, closure);
  1691. #endif
  1692.     Py_XDECREF(kwtuple);
  1693. done:
  1694.     Py_LeaveRecursiveCall();
  1695.     return result;
  1696. }
  1697. #endif  // CPython < 3.6
  1698. #endif  // CYTHON_FAST_PYCALL
  1699.  
  1700. /* PyObjectCall */
  1701.   #if CYTHON_COMPILING_IN_CPYTHON
  1702. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  1703.     PyObject *result;
  1704.     ternaryfunc call = func->ob_type->tp_call;
  1705.     if (unlikely(!call))
  1706.         return PyObject_Call(func, arg, kw);
  1707.     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  1708.         return NULL;
  1709.     result = (*call)(func, arg, kw);
  1710.     Py_LeaveRecursiveCall();
  1711.     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  1712.         PyErr_SetString(
  1713.             PyExc_SystemError,
  1714.             "NULL result without error in PyObject_Call");
  1715.     }
  1716.     return result;
  1717. }
  1718. #endif
  1719.  
  1720. /* PyObjectCallMethO */
  1721.   #if CYTHON_COMPILING_IN_CPYTHON
  1722. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  1723.     PyObject *self, *result;
  1724.     PyCFunction cfunc;
  1725.     cfunc = PyCFunction_GET_FUNCTION(func);
  1726.     self = PyCFunction_GET_SELF(func);
  1727.     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  1728.         return NULL;
  1729.     result = cfunc(self, arg);
  1730.     Py_LeaveRecursiveCall();
  1731.     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  1732.         PyErr_SetString(
  1733.             PyExc_SystemError,
  1734.             "NULL result without error in PyObject_Call");
  1735.     }
  1736.     return result;
  1737. }
  1738. #endif
  1739.  
  1740. /* PyObjectCallOneArg */
  1741.   #if CYTHON_COMPILING_IN_CPYTHON
  1742. static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  1743.     PyObject *result;
  1744.     PyObject *args = PyTuple_New(1);
  1745.     if (unlikely(!args)) return NULL;
  1746.     Py_INCREF(arg);
  1747.     PyTuple_SET_ITEM(args, 0, arg);
  1748.     result = __Pyx_PyObject_Call(func, args, NULL);
  1749.     Py_DECREF(args);
  1750.     return result;
  1751. }
  1752. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  1753. #if CYTHON_FAST_PYCALL
  1754.     if (PyFunction_Check(func)) {
  1755.         return __Pyx_PyFunction_FastCall(func, &arg, 1);
  1756.     }
  1757. #endif
  1758. #ifdef __Pyx_CyFunction_USED
  1759.     if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
  1760. #else
  1761.     if (likely(PyCFunction_Check(func))) {
  1762. #endif
  1763.         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
  1764.             return __Pyx_PyObject_CallMethO(func, arg);
  1765. #if CYTHON_FAST_PYCCALL
  1766.         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
  1767.             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
  1768. #endif
  1769.         }
  1770.     }
  1771.     return __Pyx__PyObject_CallOneArg(func, arg);
  1772. }
  1773. #else
  1774. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  1775.     PyObject *result;
  1776.     PyObject *args = PyTuple_Pack(1, arg);
  1777.     if (unlikely(!args)) return NULL;
  1778.     result = __Pyx_PyObject_Call(func, args, NULL);
  1779.     Py_DECREF(args);
  1780.     return result;
  1781. }
  1782. #endif
  1783.  
  1784. /* CodeObjectCache */
  1785.     static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  1786.     int start = 0, mid = 0, end = count - 1;
  1787.     if (end >= 0 && code_line > entries[end].code_line) {
  1788.         return count;
  1789.     }
  1790.     while (start < end) {
  1791.         mid = start + (end - start) / 2;
  1792.         if (code_line < entries[mid].code_line) {
  1793.             end = mid;
  1794.         } else if (code_line > entries[mid].code_line) {
  1795.              start = mid + 1;
  1796.         } else {
  1797.             return mid;
  1798.         }
  1799.     }
  1800.     if (code_line <= entries[mid].code_line) {
  1801.         return mid;
  1802.     } else {
  1803.         return mid + 1;
  1804.     }
  1805. }
  1806. static PyCodeObject *__pyx_find_code_object(int code_line) {
  1807.     PyCodeObject* code_object;
  1808.     int pos;
  1809.     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  1810.         return NULL;
  1811.     }
  1812.     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  1813.     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  1814.         return NULL;
  1815.     }
  1816.     code_object = __pyx_code_cache.entries[pos].code_object;
  1817.     Py_INCREF(code_object);
  1818.     return code_object;
  1819. }
  1820. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  1821.     int pos, i;
  1822.     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  1823.     if (unlikely(!code_line)) {
  1824.         return;
  1825.     }
  1826.     if (unlikely(!entries)) {
  1827.         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  1828.         if (likely(entries)) {
  1829.             __pyx_code_cache.entries = entries;
  1830.             __pyx_code_cache.max_count = 64;
  1831.             __pyx_code_cache.count = 1;
  1832.             entries[0].code_line = code_line;
  1833.             entries[0].code_object = code_object;
  1834.             Py_INCREF(code_object);
  1835.         }
  1836.         return;
  1837.     }
  1838.     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  1839.     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  1840.         PyCodeObject* tmp = entries[pos].code_object;
  1841.         entries[pos].code_object = code_object;
  1842.         Py_DECREF(tmp);
  1843.         return;
  1844.     }
  1845.     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  1846.         int new_max = __pyx_code_cache.max_count + 64;
  1847.         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  1848.             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  1849.         if (unlikely(!entries)) {
  1850.             return;
  1851.         }
  1852.         __pyx_code_cache.entries = entries;
  1853.         __pyx_code_cache.max_count = new_max;
  1854.     }
  1855.     for (i=__pyx_code_cache.count; i>pos; i--) {
  1856.         entries[i] = entries[i-1];
  1857.     }
  1858.     entries[pos].code_line = code_line;
  1859.     entries[pos].code_object = code_object;
  1860.     __pyx_code_cache.count++;
  1861.     Py_INCREF(code_object);
  1862. }
  1863.  
  1864. /* AddTraceback */
  1865.     #include "compile.h"
  1866. #include "frameobject.h"
  1867. #include "traceback.h"
  1868. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  1869.             const char *funcname, int c_line,
  1870.             int py_line, const char *filename) {
  1871.     PyCodeObject *py_code = 0;
  1872.     PyObject *py_srcfile = 0;
  1873.     PyObject *py_funcname = 0;
  1874.     #if PY_MAJOR_VERSION < 3
  1875.     py_srcfile = PyString_FromString(filename);
  1876.     #else
  1877.     py_srcfile = PyUnicode_FromString(filename);
  1878.     #endif
  1879.     if (!py_srcfile) goto bad;
  1880.     if (c_line) {
  1881.         #if PY_MAJOR_VERSION < 3
  1882.         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  1883.         #else
  1884.         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  1885.         #endif
  1886.     }
  1887.     else {
  1888.         #if PY_MAJOR_VERSION < 3
  1889.         py_funcname = PyString_FromString(funcname);
  1890.         #else
  1891.         py_funcname = PyUnicode_FromString(funcname);
  1892.         #endif
  1893.     }
  1894.     if (!py_funcname) goto bad;
  1895.     py_code = __Pyx_PyCode_New(
  1896.         0,
  1897.         0,
  1898.         0,
  1899.         0,
  1900.         0,
  1901.         __pyx_empty_bytes, /*PyObject *code,*/
  1902.         __pyx_empty_tuple, /*PyObject *consts,*/
  1903.         __pyx_empty_tuple, /*PyObject *names,*/
  1904.         __pyx_empty_tuple, /*PyObject *varnames,*/
  1905.         __pyx_empty_tuple, /*PyObject *freevars,*/
  1906.         __pyx_empty_tuple, /*PyObject *cellvars,*/
  1907.         py_srcfile,   /*PyObject *filename,*/
  1908.         py_funcname,  /*PyObject *name,*/
  1909.         py_line,
  1910.         __pyx_empty_bytes  /*PyObject *lnotab*/
  1911.     );
  1912.     Py_DECREF(py_srcfile);
  1913.     Py_DECREF(py_funcname);
  1914.     return py_code;
  1915. bad:
  1916.     Py_XDECREF(py_srcfile);
  1917.     Py_XDECREF(py_funcname);
  1918.     return NULL;
  1919. }
  1920. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1921.                                int py_line, const char *filename) {
  1922.     PyCodeObject *py_code = 0;
  1923.     PyFrameObject *py_frame = 0;
  1924.     py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  1925.     if (!py_code) {
  1926.         py_code = __Pyx_CreateCodeObjectForTraceback(
  1927.             funcname, c_line, py_line, filename);
  1928.         if (!py_code) goto bad;
  1929.         __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  1930.     }
  1931.     py_frame = PyFrame_New(
  1932.         PyThreadState_GET(), /*PyThreadState *tstate,*/
  1933.         py_code,             /*PyCodeObject *code,*/
  1934.         __pyx_d,      /*PyObject *globals,*/
  1935.         0                    /*PyObject *locals*/
  1936.     );
  1937.     if (!py_frame) goto bad;
  1938.     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  1939.     PyTraceBack_Here(py_frame);
  1940. bad:
  1941.     Py_XDECREF(py_code);
  1942.     Py_XDECREF(py_frame);
  1943. }
  1944.  
  1945. /* CIntFromPyVerify */
  1946.     #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  1947.     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  1948. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  1949.     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  1950. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  1951.     {\
  1952.         func_type value = func_value;\
  1953.         if (sizeof(target_type) < sizeof(func_type)) {\
  1954.             if (unlikely(value != (func_type) (target_type) value)) {\
  1955.                 func_type zero = 0;\
  1956.                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  1957.                     return (target_type) -1;\
  1958.                 if (is_unsigned && unlikely(value < zero))\
  1959.                     goto raise_neg_overflow;\
  1960.                 else\
  1961.                     goto raise_overflow;\
  1962.             }\
  1963.         }\
  1964.         return (target_type) value;\
  1965.     }
  1966.  
  1967. /* CIntToPy */
  1968.     static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  1969.     const int neg_one = (int) -1, const_zero = (int) 0;
  1970.     const int is_unsigned = neg_one > const_zero;
  1971.     if (is_unsigned) {
  1972.         if (sizeof(int) < sizeof(long)) {
  1973.             return PyInt_FromLong((long) value);
  1974.         } else if (sizeof(int) <= sizeof(unsigned long)) {
  1975.             return PyLong_FromUnsignedLong((unsigned long) value);
  1976. #ifdef HAVE_LONG_LONG
  1977.         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  1978.             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  1979. #endif
  1980.         }
  1981.     } else {
  1982.         if (sizeof(int) <= sizeof(long)) {
  1983.             return PyInt_FromLong((long) value);
  1984. #ifdef HAVE_LONG_LONG
  1985.         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  1986.             return PyLong_FromLongLong((PY_LONG_LONG) value);
  1987. #endif
  1988.         }
  1989.     }
  1990.     {
  1991.         int one = 1; int little = (int)*(unsigned char *)&one;
  1992.         unsigned char *bytes = (unsigned char *)&value;
  1993.         return _PyLong_FromByteArray(bytes, sizeof(int),
  1994.                                      little, !is_unsigned);
  1995.     }
  1996. }
  1997.  
  1998. /* CIntFromPy */
  1999.     static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  2000.     const int neg_one = (int) -1, const_zero = (int) 0;
  2001.     const int is_unsigned = neg_one > const_zero;
  2002. #if PY_MAJOR_VERSION < 3
  2003.     if (likely(PyInt_Check(x))) {
  2004.         if (sizeof(int) < sizeof(long)) {
  2005.             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  2006.         } else {
  2007.             long val = PyInt_AS_LONG(x);
  2008.             if (is_unsigned && unlikely(val < 0)) {
  2009.                 goto raise_neg_overflow;
  2010.             }
  2011.             return (int) val;
  2012.         }
  2013.     } else
  2014. #endif
  2015.     if (likely(PyLong_Check(x))) {
  2016.         if (is_unsigned) {
  2017. #if CYTHON_USE_PYLONG_INTERNALS
  2018.             const digit* digits = ((PyLongObject*)x)->ob_digit;
  2019.             switch (Py_SIZE(x)) {
  2020.                 case  0: return (int) 0;
  2021.                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
  2022.                 case 2:
  2023.                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  2024.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  2025.                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2026.                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
  2027.                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  2028.                         }
  2029.                     }
  2030.                     break;
  2031.                 case 3:
  2032.                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  2033.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  2034.                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2035.                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
  2036.                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  2037.                         }
  2038.                     }
  2039.                     break;
  2040.                 case 4:
  2041.                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  2042.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  2043.                             __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])))
  2044.                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
  2045.                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  2046.                         }
  2047.                     }
  2048.                     break;
  2049.             }
  2050. #endif
  2051. #if CYTHON_COMPILING_IN_CPYTHON
  2052.             if (unlikely(Py_SIZE(x) < 0)) {
  2053.                 goto raise_neg_overflow;
  2054.             }
  2055. #else
  2056.             {
  2057.                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  2058.                 if (unlikely(result < 0))
  2059.                     return (int) -1;
  2060.                 if (unlikely(result == 1))
  2061.                     goto raise_neg_overflow;
  2062.             }
  2063. #endif
  2064.             if (sizeof(int) <= sizeof(unsigned long)) {
  2065.                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  2066. #ifdef HAVE_LONG_LONG
  2067.             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  2068.                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  2069. #endif
  2070.             }
  2071.         } else {
  2072. #if CYTHON_USE_PYLONG_INTERNALS
  2073.             const digit* digits = ((PyLongObject*)x)->ob_digit;
  2074.             switch (Py_SIZE(x)) {
  2075.                 case  0: return (int) 0;
  2076.                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
  2077.                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
  2078.                 case -2:
  2079.                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
  2080.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  2081.                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2082.                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  2083.                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  2084.                         }
  2085.                     }
  2086.                     break;
  2087.                 case 2:
  2088.                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  2089.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  2090.                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2091.                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  2092.                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  2093.                         }
  2094.                     }
  2095.                     break;
  2096.                 case -3:
  2097.                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  2098.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  2099.                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2100.                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  2101.                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  2102.                         }
  2103.                     }
  2104.                     break;
  2105.                 case 3:
  2106.                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  2107.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  2108.                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2109.                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  2110.                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  2111.                         }
  2112.                     }
  2113.                     break;
  2114.                 case -4:
  2115.                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  2116.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  2117.                             __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])))
  2118.                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  2119.                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  2120.                         }
  2121.                     }
  2122.                     break;
  2123.                 case 4:
  2124.                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  2125.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  2126.                             __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])))
  2127.                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  2128.                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  2129.                         }
  2130.                     }
  2131.                     break;
  2132.             }
  2133. #endif
  2134.             if (sizeof(int) <= sizeof(long)) {
  2135.                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  2136. #ifdef HAVE_LONG_LONG
  2137.             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  2138.                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  2139. #endif
  2140.             }
  2141.         }
  2142.         {
  2143. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  2144.             PyErr_SetString(PyExc_RuntimeError,
  2145.                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  2146. #else
  2147.             int val;
  2148.             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  2149.  #if PY_MAJOR_VERSION < 3
  2150.             if (likely(v) && !PyLong_Check(v)) {
  2151.                 PyObject *tmp = v;
  2152.                 v = PyNumber_Long(tmp);
  2153.                 Py_DECREF(tmp);
  2154.             }
  2155.  #endif
  2156.             if (likely(v)) {
  2157.                 int one = 1; int is_little = (int)*(unsigned char *)&one;
  2158.                 unsigned char *bytes = (unsigned char *)&val;
  2159.                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
  2160.                                               bytes, sizeof(val),
  2161.                                               is_little, !is_unsigned);
  2162.                 Py_DECREF(v);
  2163.                 if (likely(!ret))
  2164.                     return val;
  2165.             }
  2166. #endif
  2167.             return (int) -1;
  2168.         }
  2169.     } else {
  2170.         int val;
  2171.         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  2172.         if (!tmp) return (int) -1;
  2173.         val = __Pyx_PyInt_As_int(tmp);
  2174.         Py_DECREF(tmp);
  2175.         return val;
  2176.     }
  2177. raise_overflow:
  2178.     PyErr_SetString(PyExc_OverflowError,
  2179.         "value too large to convert to int");
  2180.     return (int) -1;
  2181. raise_neg_overflow:
  2182.     PyErr_SetString(PyExc_OverflowError,
  2183.         "can't convert negative value to int");
  2184.     return (int) -1;
  2185. }
  2186.  
  2187. /* CIntToPy */
  2188.     static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  2189.     const long neg_one = (long) -1, const_zero = (long) 0;
  2190.     const int is_unsigned = neg_one > const_zero;
  2191.     if (is_unsigned) {
  2192.         if (sizeof(long) < sizeof(long)) {
  2193.             return PyInt_FromLong((long) value);
  2194.         } else if (sizeof(long) <= sizeof(unsigned long)) {
  2195.             return PyLong_FromUnsignedLong((unsigned long) value);
  2196. #ifdef HAVE_LONG_LONG
  2197.         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  2198.             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  2199. #endif
  2200.         }
  2201.     } else {
  2202.         if (sizeof(long) <= sizeof(long)) {
  2203.             return PyInt_FromLong((long) value);
  2204. #ifdef HAVE_LONG_LONG
  2205.         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  2206.             return PyLong_FromLongLong((PY_LONG_LONG) value);
  2207. #endif
  2208.         }
  2209.     }
  2210.     {
  2211.         int one = 1; int little = (int)*(unsigned char *)&one;
  2212.         unsigned char *bytes = (unsigned char *)&value;
  2213.         return _PyLong_FromByteArray(bytes, sizeof(long),
  2214.                                      little, !is_unsigned);
  2215.     }
  2216. }
  2217.  
  2218. /* CIntFromPy */
  2219.     static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  2220.     const long neg_one = (long) -1, const_zero = (long) 0;
  2221.     const int is_unsigned = neg_one > const_zero;
  2222. #if PY_MAJOR_VERSION < 3
  2223.     if (likely(PyInt_Check(x))) {
  2224.         if (sizeof(long) < sizeof(long)) {
  2225.             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  2226.         } else {
  2227.             long val = PyInt_AS_LONG(x);
  2228.             if (is_unsigned && unlikely(val < 0)) {
  2229.                 goto raise_neg_overflow;
  2230.             }
  2231.             return (long) val;
  2232.         }
  2233.     } else
  2234. #endif
  2235.     if (likely(PyLong_Check(x))) {
  2236.         if (is_unsigned) {
  2237. #if CYTHON_USE_PYLONG_INTERNALS
  2238.             const digit* digits = ((PyLongObject*)x)->ob_digit;
  2239.             switch (Py_SIZE(x)) {
  2240.                 case  0: return (long) 0;
  2241.                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
  2242.                 case 2:
  2243.                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  2244.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  2245.                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2246.                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
  2247.                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  2248.                         }
  2249.                     }
  2250.                     break;
  2251.                 case 3:
  2252.                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  2253.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  2254.                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2255.                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
  2256.                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  2257.                         }
  2258.                     }
  2259.                     break;
  2260.                 case 4:
  2261.                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  2262.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  2263.                             __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])))
  2264.                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
  2265.                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  2266.                         }
  2267.                     }
  2268.                     break;
  2269.             }
  2270. #endif
  2271. #if CYTHON_COMPILING_IN_CPYTHON
  2272.             if (unlikely(Py_SIZE(x) < 0)) {
  2273.                 goto raise_neg_overflow;
  2274.             }
  2275. #else
  2276.             {
  2277.                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  2278.                 if (unlikely(result < 0))
  2279.                     return (long) -1;
  2280.                 if (unlikely(result == 1))
  2281.                     goto raise_neg_overflow;
  2282.             }
  2283. #endif
  2284.             if (sizeof(long) <= sizeof(unsigned long)) {
  2285.                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  2286. #ifdef HAVE_LONG_LONG
  2287.             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  2288.                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  2289. #endif
  2290.             }
  2291.         } else {
  2292. #if CYTHON_USE_PYLONG_INTERNALS
  2293.             const digit* digits = ((PyLongObject*)x)->ob_digit;
  2294.             switch (Py_SIZE(x)) {
  2295.                 case  0: return (long) 0;
  2296.                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
  2297.                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
  2298.                 case -2:
  2299.                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
  2300.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  2301.                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2302.                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  2303.                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  2304.                         }
  2305.                     }
  2306.                     break;
  2307.                 case 2:
  2308.                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  2309.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  2310.                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2311.                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  2312.                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  2313.                         }
  2314.                     }
  2315.                     break;
  2316.                 case -3:
  2317.                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  2318.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  2319.                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2320.                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  2321.                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  2322.                         }
  2323.                     }
  2324.                     break;
  2325.                 case 3:
  2326.                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  2327.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  2328.                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  2329.                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  2330.                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  2331.                         }
  2332.                     }
  2333.                     break;
  2334.                 case -4:
  2335.                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  2336.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  2337.                             __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])))
  2338.                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  2339.                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  2340.                         }
  2341.                     }
  2342.                     break;
  2343.                 case 4:
  2344.                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  2345.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  2346.                             __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])))
  2347.                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  2348.                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  2349.                         }
  2350.                     }
  2351.                     break;
  2352.             }
  2353. #endif
  2354.             if (sizeof(long) <= sizeof(long)) {
  2355.                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  2356. #ifdef HAVE_LONG_LONG
  2357.             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  2358.                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  2359. #endif
  2360.             }
  2361.         }
  2362.         {
  2363. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  2364.             PyErr_SetString(PyExc_RuntimeError,
  2365.                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  2366. #else
  2367.             long val;
  2368.             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  2369.  #if PY_MAJOR_VERSION < 3
  2370.             if (likely(v) && !PyLong_Check(v)) {
  2371.                 PyObject *tmp = v;
  2372.                 v = PyNumber_Long(tmp);
  2373.                 Py_DECREF(tmp);
  2374.             }
  2375.  #endif
  2376.             if (likely(v)) {
  2377.                 int one = 1; int is_little = (int)*(unsigned char *)&one;
  2378.                 unsigned char *bytes = (unsigned char *)&val;
  2379.                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
  2380.                                               bytes, sizeof(val),
  2381.                                               is_little, !is_unsigned);
  2382.                 Py_DECREF(v);
  2383.                 if (likely(!ret))
  2384.                     return val;
  2385.             }
  2386. #endif
  2387.             return (long) -1;
  2388.         }
  2389.     } else {
  2390.         long val;
  2391.         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  2392.         if (!tmp) return (long) -1;
  2393.         val = __Pyx_PyInt_As_long(tmp);
  2394.         Py_DECREF(tmp);
  2395.         return val;
  2396.     }
  2397. raise_overflow:
  2398.     PyErr_SetString(PyExc_OverflowError,
  2399.         "value too large to convert to long");
  2400.     return (long) -1;
  2401. raise_neg_overflow:
  2402.     PyErr_SetString(PyExc_OverflowError,
  2403.         "can't convert negative value to long");
  2404.     return (long) -1;
  2405. }
  2406.  
  2407. /* CheckBinaryVersion */
  2408.     static int __Pyx_check_binary_version(void) {
  2409.     char ctversion[4], rtversion[4];
  2410.     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  2411.     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  2412.     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  2413.         char message[200];
  2414.         PyOS_snprintf(message, sizeof(message),
  2415.                       "compiletime version %s of module '%.100s' "
  2416.                       "does not match runtime version %s",
  2417.                       ctversion, __Pyx_MODULE_NAME, rtversion);
  2418.         return PyErr_WarnEx(NULL, message, 1);
  2419.     }
  2420.     return 0;
  2421. }
  2422.  
  2423. /* InitStrings */
  2424.     static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  2425.     while (t->p) {
  2426.         #if PY_MAJOR_VERSION < 3
  2427.         if (t->is_unicode) {
  2428.             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  2429.         } else if (t->intern) {
  2430.             *t->p = PyString_InternFromString(t->s);
  2431.         } else {
  2432.             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  2433.         }
  2434.         #else
  2435.         if (t->is_unicode | t->is_str) {
  2436.             if (t->intern) {
  2437.                 *t->p = PyUnicode_InternFromString(t->s);
  2438.             } else if (t->encoding) {
  2439.                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  2440.             } else {
  2441.                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  2442.             }
  2443.         } else {
  2444.             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  2445.         }
  2446.         #endif
  2447.         if (!*t->p)
  2448.             return -1;
  2449.         ++t;
  2450.     }
  2451.     return 0;
  2452. }
  2453.  
  2454. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  2455.     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
  2456. }
  2457. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  2458.     Py_ssize_t ignore;
  2459.     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  2460. }
  2461. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  2462. #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  2463.     if (
  2464. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  2465.             __Pyx_sys_getdefaultencoding_not_ascii &&
  2466. #endif
  2467.             PyUnicode_Check(o)) {
  2468. #if PY_VERSION_HEX < 0x03030000
  2469.         char* defenc_c;
  2470.         PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  2471.         if (!defenc) return NULL;
  2472.         defenc_c = PyBytes_AS_STRING(defenc);
  2473. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  2474.         {
  2475.             char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  2476.             char* c;
  2477.             for (c = defenc_c; c < end; c++) {
  2478.                 if ((unsigned char) (*c) >= 128) {
  2479.                     PyUnicode_AsASCIIString(o);
  2480.                     return NULL;
  2481.                 }
  2482.             }
  2483.         }
  2484. #endif
  2485.         *length = PyBytes_GET_SIZE(defenc);
  2486.         return defenc_c;
  2487. #else
  2488.         if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
  2489. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  2490.         if (PyUnicode_IS_ASCII(o)) {
  2491.             *length = PyUnicode_GET_LENGTH(o);
  2492.             return PyUnicode_AsUTF8(o);
  2493.         } else {
  2494.             PyUnicode_AsASCIIString(o);
  2495.             return NULL;
  2496.         }
  2497. #else
  2498.         return PyUnicode_AsUTF8AndSize(o, length);
  2499. #endif
  2500. #endif
  2501.     } else
  2502. #endif
  2503. #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  2504.     if (PyByteArray_Check(o)) {
  2505.         *length = PyByteArray_GET_SIZE(o);
  2506.         return PyByteArray_AS_STRING(o);
  2507.     } else
  2508. #endif
  2509.     {
  2510.         char* result;
  2511.         int r = PyBytes_AsStringAndSize(o, &result, length);
  2512.         if (unlikely(r < 0)) {
  2513.             return NULL;
  2514.         } else {
  2515.             return result;
  2516.         }
  2517.     }
  2518. }
  2519. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  2520.    int is_true = x == Py_True;
  2521.    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  2522.    else return PyObject_IsTrue(x);
  2523. }
  2524. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  2525. #if CYTHON_USE_TYPE_SLOTS
  2526.   PyNumberMethods *m;
  2527. #endif
  2528.   const char *name = NULL;
  2529.   PyObject *res = NULL;
  2530. #if PY_MAJOR_VERSION < 3
  2531.   if (PyInt_Check(x) || PyLong_Check(x))
  2532. #else
  2533.   if (PyLong_Check(x))
  2534. #endif
  2535.     return __Pyx_NewRef(x);
  2536. #if CYTHON_USE_TYPE_SLOTS
  2537.   m = Py_TYPE(x)->tp_as_number;
  2538.   #if PY_MAJOR_VERSION < 3
  2539.   if (m && m->nb_int) {
  2540.     name = "int";
  2541.     res = PyNumber_Int(x);
  2542.   }
  2543.   else if (m && m->nb_long) {
  2544.     name = "long";
  2545.     res = PyNumber_Long(x);
  2546.   }
  2547.   #else
  2548.   if (m && m->nb_int) {
  2549.     name = "int";
  2550.     res = PyNumber_Long(x);
  2551.   }
  2552.   #endif
  2553. #else
  2554.   res = PyNumber_Int(x);
  2555. #endif
  2556.   if (res) {
  2557. #if PY_MAJOR_VERSION < 3
  2558.     if (!PyInt_Check(res) && !PyLong_Check(res)) {
  2559. #else
  2560.     if (!PyLong_Check(res)) {
  2561. #endif
  2562.       PyErr_Format(PyExc_TypeError,
  2563.                    "__%.4s__ returned non-%.4s (type %.200s)",
  2564.                    name, name, Py_TYPE(res)->tp_name);
  2565.       Py_DECREF(res);
  2566.       return NULL;
  2567.     }
  2568.   }
  2569.   else if (!PyErr_Occurred()) {
  2570.     PyErr_SetString(PyExc_TypeError,
  2571.                     "an integer is required");
  2572.   }
  2573.   return res;
  2574. }
  2575. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  2576.   Py_ssize_t ival;
  2577.   PyObject *x;
  2578. #if PY_MAJOR_VERSION < 3
  2579.   if (likely(PyInt_CheckExact(b))) {
  2580.     if (sizeof(Py_ssize_t) >= sizeof(long))
  2581.         return PyInt_AS_LONG(b);
  2582.     else
  2583.         return PyInt_AsSsize_t(x);
  2584.   }
  2585. #endif
  2586.   if (likely(PyLong_CheckExact(b))) {
  2587.     #if CYTHON_USE_PYLONG_INTERNALS
  2588.     const digit* digits = ((PyLongObject*)b)->ob_digit;
  2589.     const Py_ssize_t size = Py_SIZE(b);
  2590.     if (likely(__Pyx_sst_abs(size) <= 1)) {
  2591.         ival = likely(size) ? digits[0] : 0;
  2592.         if (size == -1) ival = -ival;
  2593.         return ival;
  2594.     } else {
  2595.       switch (size) {
  2596.          case 2:
  2597.            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  2598.              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  2599.            }
  2600.            break;
  2601.          case -2:
  2602.            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  2603.              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  2604.            }
  2605.            break;
  2606.          case 3:
  2607.            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  2608.              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  2609.            }
  2610.            break;
  2611.          case -3:
  2612.            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  2613.              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  2614.            }
  2615.            break;
  2616.          case 4:
  2617.            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  2618.              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]));
  2619.            }
  2620.            break;
  2621.          case -4:
  2622.            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  2623.              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]));
  2624.            }
  2625.            break;
  2626.       }
  2627.     }
  2628.     #endif
  2629.     return PyLong_AsSsize_t(b);
  2630.   }
  2631.   x = PyNumber_Index(b);
  2632.   if (!x) return -1;
  2633.   ival = PyInt_AsSsize_t(x);
  2634.   Py_DECREF(x);
  2635.   return ival;
  2636. }
  2637. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  2638.     return PyInt_FromSize_t(ival);
  2639. }
  2640.  
  2641.  
  2642. #endif /* Py_PYTHON_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement