Advertisement
Guest User

wtf.c

a guest
Nov 12th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 56.22 KB | None | 0 0
  1. /* Generated by Cython 0.17.1 on Sun Nov 11 23:39:45 2012 */
  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 < 0x02040000
  8.     #error Cython requires Python 2.4+.
  9. #else
  10. #include <stddef.h> /* For offsetof */
  11. #ifndef offsetof
  12. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  13. #endif
  14. #if !defined(WIN32) && !defined(MS_WINDOWS)
  15.   #ifndef __stdcall
  16.     #define __stdcall
  17.   #endif
  18.   #ifndef __cdecl
  19.     #define __cdecl
  20.   #endif
  21.   #ifndef __fastcall
  22.     #define __fastcall
  23.   #endif
  24. #endif
  25. #ifndef DL_IMPORT
  26.   #define DL_IMPORT(t) t
  27. #endif
  28. #ifndef DL_EXPORT
  29.   #define DL_EXPORT(t) t
  30. #endif
  31. #ifndef PY_LONG_LONG
  32.   #define PY_LONG_LONG LONG_LONG
  33. #endif
  34. #ifndef Py_HUGE_VAL
  35.   #define Py_HUGE_VAL HUGE_VAL
  36. #endif
  37. #ifdef PYPY_VERSION
  38. #define CYTHON_COMPILING_IN_PYPY 1
  39. #define CYTHON_COMPILING_IN_CPYTHON 0
  40. #else
  41. #define CYTHON_COMPILING_IN_PYPY 0
  42. #define CYTHON_COMPILING_IN_CPYTHON 1
  43. #endif
  44. #if PY_VERSION_HEX < 0x02050000
  45.   typedef int Py_ssize_t;
  46.   #define PY_SSIZE_T_MAX INT_MAX
  47.   #define PY_SSIZE_T_MIN INT_MIN
  48.   #define PY_FORMAT_SIZE_T ""
  49.   #define CYTHON_FORMAT_SSIZE_T ""
  50.   #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  51.   #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  52.   #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
  53.                                 (PyErr_Format(PyExc_TypeError, \
  54.                                               "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
  55.                                  (PyObject*)0))
  56.   #define PyIndex_Check(o)     (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o))
  57.   #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  58.   #define __PYX_BUILD_PY_SSIZE_T "i"
  59. #else
  60.   #define __PYX_BUILD_PY_SSIZE_T "n"
  61.   #define CYTHON_FORMAT_SSIZE_T "z"
  62. #endif
  63. #if PY_VERSION_HEX < 0x02060000
  64.   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  65.   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  66.   #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  67.   #define PyVarObject_HEAD_INIT(type, size) \
  68.           PyObject_HEAD_INIT(type) size,
  69.   #define PyType_Modified(t)
  70.   typedef struct {
  71.      void *buf;
  72.      PyObject *obj;
  73.      Py_ssize_t len;
  74.      Py_ssize_t itemsize;
  75.      int readonly;
  76.      int ndim;
  77.      char *format;
  78.      Py_ssize_t *shape;
  79.      Py_ssize_t *strides;
  80.      Py_ssize_t *suboffsets;
  81.      void *internal;
  82.   } Py_buffer;
  83.   #define PyBUF_SIMPLE 0
  84.   #define PyBUF_WRITABLE 0x0001
  85.   #define PyBUF_FORMAT 0x0004
  86.   #define PyBUF_ND 0x0008
  87.   #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  88.   #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  89.   #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  90.   #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  91.   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  92.   #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  93.   #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  94.   typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  95.   typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
  96. #endif
  97. #if PY_MAJOR_VERSION < 3
  98.   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  99.   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  100.           PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  101. #else
  102.   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  103.   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  104.           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  105. #endif
  106. #if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  107.   #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
  108. #endif
  109. #if PY_MAJOR_VERSION >= 3
  110.   #define Py_TPFLAGS_CHECKTYPES 0
  111.   #define Py_TPFLAGS_HAVE_INDEX 0
  112. #endif
  113. #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  114.   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  115. #endif
  116. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  117.   #define CYTHON_PEP393_ENABLED 1
  118.   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
  119.                                               0 : _PyUnicode_Ready((PyObject *)(op)))
  120.   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  121.   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  122.   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  123. #else
  124.   #define CYTHON_PEP393_ENABLED 0
  125.   #define __Pyx_PyUnicode_READY(op)       (0)
  126.   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  127.   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  128.   #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  129. #endif
  130. #if PY_MAJOR_VERSION >= 3
  131.   #define PyBaseString_Type            PyUnicode_Type
  132.   #define PyStringObject               PyUnicodeObject
  133.   #define PyString_Type                PyUnicode_Type
  134.   #define PyString_Check               PyUnicode_Check
  135.   #define PyString_CheckExact          PyUnicode_CheckExact
  136. #endif
  137. #if PY_VERSION_HEX < 0x02060000
  138.   #define PyBytesObject                PyStringObject
  139.   #define PyBytes_Type                 PyString_Type
  140.   #define PyBytes_Check                PyString_Check
  141.   #define PyBytes_CheckExact           PyString_CheckExact
  142.   #define PyBytes_FromString           PyString_FromString
  143.   #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  144.   #define PyBytes_FromFormat           PyString_FromFormat
  145.   #define PyBytes_DecodeEscape         PyString_DecodeEscape
  146.   #define PyBytes_AsString             PyString_AsString
  147.   #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  148.   #define PyBytes_Size                 PyString_Size
  149.   #define PyBytes_AS_STRING            PyString_AS_STRING
  150.   #define PyBytes_GET_SIZE             PyString_GET_SIZE
  151.   #define PyBytes_Repr                 PyString_Repr
  152.   #define PyBytes_Concat               PyString_Concat
  153.   #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
  154. #endif
  155. #if PY_VERSION_HEX < 0x02060000
  156.   #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  157.   #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
  158. #endif
  159. #ifndef PySet_CheckExact
  160.   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
  161. #endif
  162. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  163. #if PY_MAJOR_VERSION >= 3
  164.   #define PyIntObject                  PyLongObject
  165.   #define PyInt_Type                   PyLong_Type
  166.   #define PyInt_Check(op)              PyLong_Check(op)
  167.   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  168.   #define PyInt_FromString             PyLong_FromString
  169.   #define PyInt_FromUnicode            PyLong_FromUnicode
  170.   #define PyInt_FromLong               PyLong_FromLong
  171.   #define PyInt_FromSize_t             PyLong_FromSize_t
  172.   #define PyInt_FromSsize_t            PyLong_FromSsize_t
  173.   #define PyInt_AsLong                 PyLong_AsLong
  174.   #define PyInt_AS_LONG                PyLong_AS_LONG
  175.   #define PyInt_AsSsize_t              PyLong_AsSsize_t
  176.   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  177.   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  178. #endif
  179. #if PY_MAJOR_VERSION >= 3
  180.   #define PyBoolObject                 PyLongObject
  181. #endif
  182. #if PY_VERSION_HEX < 0x03020000
  183.   typedef long Py_hash_t;
  184.   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  185.   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
  186. #else
  187.   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  188.   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
  189. #endif
  190. #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  191.   #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  192.   #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  193.   #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
  194. #else
  195.   #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
  196.         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
  197.         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
  198.             (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  199.   #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
  200.         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  201.         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
  202.             (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  203.   #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
  204.         (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  205.         (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
  206.             (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
  207. #endif
  208. #if PY_MAJOR_VERSION >= 3
  209.   #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
  210. #endif
  211. #if PY_VERSION_HEX < 0x02050000
  212.   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  213.   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  214.   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
  215. #else
  216.   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  217.   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  218.   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
  219. #endif
  220. #if PY_VERSION_HEX < 0x02050000
  221.   #define __Pyx_NAMESTR(n) ((char *)(n))
  222.   #define __Pyx_DOCSTR(n)  ((char *)(n))
  223. #else
  224.   #define __Pyx_NAMESTR(n) (n)
  225.   #define __Pyx_DOCSTR(n)  (n)
  226. #endif
  227.  
  228.  
  229. #if PY_MAJOR_VERSION >= 3
  230.   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  231.   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
  232. #else
  233.   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  234.   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
  235. #endif
  236.  
  237. #ifndef __PYX_EXTERN_C
  238.   #ifdef __cplusplus
  239.     #define __PYX_EXTERN_C extern "C"
  240.   #else
  241.     #define __PYX_EXTERN_C extern
  242.   #endif
  243. #endif
  244.  
  245. #if defined(WIN32) || defined(MS_WINDOWS)
  246. #define _USE_MATH_DEFINES
  247. #endif
  248. #include <math.h>
  249. #define __PYX_HAVE__wtf
  250. #define __PYX_HAVE_API__wtf
  251. #ifdef _OPENMP
  252. #include <omp.h>
  253. #endif /* _OPENMP */
  254.  
  255. #ifdef PYREX_WITHOUT_ASSERTIONS
  256. #define CYTHON_WITHOUT_ASSERTIONS
  257. #endif
  258.  
  259.  
  260. /* inline attribute */
  261. #ifndef CYTHON_INLINE
  262.   #if defined(__GNUC__)
  263.     #define CYTHON_INLINE __inline__
  264.   #elif defined(_MSC_VER)
  265.     #define CYTHON_INLINE __inline
  266.   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  267.     #define CYTHON_INLINE inline
  268.   #else
  269.     #define CYTHON_INLINE
  270.   #endif
  271. #endif
  272.  
  273. /* unused attribute */
  274. #ifndef CYTHON_UNUSED
  275. # if defined(__GNUC__)
  276. #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  277. #     define CYTHON_UNUSED __attribute__ ((__unused__))
  278. #   else
  279. #     define CYTHON_UNUSED
  280. #   endif
  281. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  282. #   define CYTHON_UNUSED __attribute__ ((__unused__))
  283. # else
  284. #   define CYTHON_UNUSED
  285. # endif
  286. #endif
  287.  
  288. typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
  289.  
  290.  
  291. /* Type Conversion Predeclarations */
  292.  
  293. #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
  294. #define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
  295.  
  296. #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
  297. #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
  298. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  299. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
  300.  
  301. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  302. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  303. static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
  304.  
  305. #if CYTHON_COMPILING_IN_CPYTHON
  306. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  307. #else
  308. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  309. #endif
  310. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  311.  
  312. #ifdef __GNUC__
  313.   /* Test for GCC > 2.95 */
  314.   #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
  315.     #define likely(x)   __builtin_expect(!!(x), 1)
  316.     #define unlikely(x) __builtin_expect(!!(x), 0)
  317.   #else /* __GNUC__ > 2 ... */
  318.     #define likely(x)   (x)
  319.     #define unlikely(x) (x)
  320.   #endif /* __GNUC__ > 2 ... */
  321. #else /* __GNUC__ */
  322.   #define likely(x)   (x)
  323.   #define unlikely(x) (x)
  324. #endif /* __GNUC__ */
  325.    
  326. static PyObject *__pyx_m;
  327. static PyObject *__pyx_b;
  328. static PyObject *__pyx_empty_tuple;
  329. static PyObject *__pyx_empty_bytes;
  330. static int __pyx_lineno;
  331. static int __pyx_clineno = 0;
  332. static const char * __pyx_cfilenm= __FILE__;
  333. static const char *__pyx_filename;
  334.  
  335.  
  336. static const char *__pyx_f[] = {
  337.   "wtf.pyx",
  338. };
  339.  
  340. /*--- Type declarations ---*/
  341. #ifndef CYTHON_REFNANNY
  342.   #define CYTHON_REFNANNY 0
  343. #endif
  344. #if CYTHON_REFNANNY
  345.   typedef struct {
  346.     void (*INCREF)(void*, PyObject*, int);
  347.     void (*DECREF)(void*, PyObject*, int);
  348.     void (*GOTREF)(void*, PyObject*, int);
  349.     void (*GIVEREF)(void*, PyObject*, int);
  350.     void* (*SetupContext)(const char*, int, const char*);
  351.     void (*FinishContext)(void**);
  352.   } __Pyx_RefNannyAPIStruct;
  353.   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  354.   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  355.   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  356. #ifdef WITH_THREAD
  357.   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  358.           if (acquire_gil) { \
  359.               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
  360.               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  361.               PyGILState_Release(__pyx_gilstate_save); \
  362.           } else { \
  363.               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  364.           }
  365. #else
  366.   #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  367.           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  368. #endif
  369.   #define __Pyx_RefNannyFinishContext() \
  370.           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  371.   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  372.   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  373.   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  374.   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  375.   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  376.   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  377.   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  378.   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  379. #else
  380.   #define __Pyx_RefNannyDeclarations
  381.   #define __Pyx_RefNannySetupContext(name, acquire_gil)
  382.   #define __Pyx_RefNannyFinishContext()
  383.   #define __Pyx_INCREF(r) Py_INCREF(r)
  384.   #define __Pyx_DECREF(r) Py_DECREF(r)
  385.   #define __Pyx_GOTREF(r)
  386.   #define __Pyx_GIVEREF(r)
  387.   #define __Pyx_XINCREF(r) Py_XINCREF(r)
  388.   #define __Pyx_XDECREF(r) Py_XDECREF(r)
  389.   #define __Pyx_XGOTREF(r)
  390.   #define __Pyx_XGIVEREF(r)
  391. #endif /* CYTHON_REFNANNY */
  392. #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  393. #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  394.  
  395. static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
  396.  
  397. static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
  398.     if (likely(PyList_CheckExact(L))) {
  399.         if (unlikely(PyList_Append(L, x) < 0)) return NULL;
  400.         Py_INCREF(Py_None);
  401.         return Py_None; /* this is just to have an accurate signature */
  402.     } else {
  403.         PyObject *r, *m;
  404.         m = __Pyx_GetAttrString(L, "append");
  405.         if (!m) return NULL;
  406.         r = PyObject_CallFunctionObjArgs(m, x, NULL);
  407.         Py_DECREF(m);
  408.         return r;
  409.     }
  410. }
  411.  
  412. static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
  413.  
  414. static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
  415.  
  416. static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
  417.  
  418. static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
  419.  
  420. static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
  421.  
  422. static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
  423.  
  424. static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
  425.  
  426. static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
  427.  
  428. static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
  429.  
  430. static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
  431.  
  432. static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
  433.  
  434. static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
  435.  
  436. static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
  437.  
  438. static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
  439.  
  440. static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
  441.  
  442. static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
  443.  
  444. static int __Pyx_check_binary_version(void);
  445.  
  446. typedef struct {
  447.     int code_line;
  448.     PyCodeObject* code_object;
  449. } __Pyx_CodeObjectCacheEntry;
  450. struct __Pyx_CodeObjectCache {
  451.     int count;
  452.     int max_count;
  453.     __Pyx_CodeObjectCacheEntry* entries;
  454. };
  455. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  456. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  457. static PyCodeObject *__pyx_find_code_object(int code_line);
  458. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  459.  
  460. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  461.                                int py_line, const char *filename); /*proto*/
  462.  
  463. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
  464.  
  465.  
  466. /* Module declarations from 'wtf' */
  467. #define __Pyx_MODULE_NAME "wtf"
  468. int __pyx_module_is_main_wtf = 0;
  469.  
  470. /* Implementation of 'wtf' */
  471. static char __pyx_k__1[] = "1";
  472. static char __pyx_k__2[] = "2";
  473. static char __pyx_k__3[] = "3";
  474. static char __pyx_k__l[] = "l";
  475. static char __pyx_k__l2[] = "l2";
  476. static char __pyx_k__item[] = "item";
  477. static char __pyx_k____main__[] = "__main__";
  478. static char __pyx_k____test__[] = "__test__";
  479. static PyObject *__pyx_kp_s__1;
  480. static PyObject *__pyx_kp_s__2;
  481. static PyObject *__pyx_kp_s__3;
  482. static PyObject *__pyx_n_s____main__;
  483. static PyObject *__pyx_n_s____test__;
  484. static PyObject *__pyx_n_s__item;
  485. static PyObject *__pyx_n_s__l;
  486. static PyObject *__pyx_n_s__l2;
  487.  
  488. static PyMethodDef __pyx_methods[] = {
  489.   {0, 0, 0, 0}
  490. };
  491.  
  492. #if PY_MAJOR_VERSION >= 3
  493. static struct PyModuleDef __pyx_moduledef = {
  494.     PyModuleDef_HEAD_INIT,
  495.     __Pyx_NAMESTR("wtf"),
  496.     0, /* m_doc */
  497.     -1, /* m_size */
  498.     __pyx_methods /* m_methods */,
  499.     NULL, /* m_reload */
  500.     NULL, /* m_traverse */
  501.     NULL, /* m_clear */
  502.     NULL /* m_free */
  503. };
  504. #endif
  505.  
  506. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  507.   {&__pyx_kp_s__1, __pyx_k__1, sizeof(__pyx_k__1), 0, 0, 1, 0},
  508.   {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
  509.   {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
  510.   {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  511.   {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  512.   {&__pyx_n_s__item, __pyx_k__item, sizeof(__pyx_k__item), 0, 0, 1, 1},
  513.   {&__pyx_n_s__l, __pyx_k__l, sizeof(__pyx_k__l), 0, 0, 1, 1},
  514.   {&__pyx_n_s__l2, __pyx_k__l2, sizeof(__pyx_k__l2), 0, 0, 1, 1},
  515.   {0, 0, 0, 0, 0, 0, 0}
  516. };
  517. static int __Pyx_InitCachedBuiltins(void) {
  518.   return 0;
  519. }
  520.  
  521. static int __Pyx_InitCachedConstants(void) {
  522.   __Pyx_RefNannyDeclarations
  523.   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  524.   __Pyx_RefNannyFinishContext();
  525.   return 0;
  526. }
  527.  
  528. static int __Pyx_InitGlobals(void) {
  529.   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  530.   return 0;
  531.   __pyx_L1_error:;
  532.   return -1;
  533. }
  534.  
  535. #if PY_MAJOR_VERSION < 3
  536. PyMODINIT_FUNC initwtf(void); /*proto*/
  537. PyMODINIT_FUNC initwtf(void)
  538. #else
  539. PyMODINIT_FUNC PyInit_wtf(void); /*proto*/
  540. PyMODINIT_FUNC PyInit_wtf(void)
  541. #endif
  542. {
  543.   PyObject *__pyx_t_1 = NULL;
  544.   PyObject *__pyx_t_2 = NULL;
  545.   Py_ssize_t __pyx_t_3;
  546.   PyObject *(*__pyx_t_4)(PyObject *);
  547.   PyObject *__pyx_t_5 = NULL;
  548.   __Pyx_RefNannyDeclarations
  549.   #if CYTHON_REFNANNY
  550.   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  551.   if (!__Pyx_RefNanny) {
  552.       PyErr_Clear();
  553.       __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  554.       if (!__Pyx_RefNanny)
  555.           Py_FatalError("failed to import 'refnanny' module");
  556.   }
  557.   #endif
  558.   __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_wtf(void)", 0);
  559.   if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  560.   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  561.   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  562.   #ifdef __Pyx_CyFunction_USED
  563.   if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  564.   #endif
  565.   #ifdef __Pyx_FusedFunction_USED
  566.   if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  567.   #endif
  568.   #ifdef __Pyx_Generator_USED
  569.   if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  570.   #endif
  571.   /*--- Library function declarations ---*/
  572.   /*--- Threads initialization code ---*/
  573.   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  574.   #ifdef WITH_THREAD /* Python build with threading support? */
  575.   PyEval_InitThreads();
  576.   #endif
  577.   #endif
  578.   /*--- Module creation code ---*/
  579.   #if PY_MAJOR_VERSION < 3
  580.   __pyx_m = Py_InitModule4(__Pyx_NAMESTR("wtf"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  581.   #else
  582.   __pyx_m = PyModule_Create(&__pyx_moduledef);
  583.   #endif
  584.   if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  585.   __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  586.   #if CYTHON_COMPILING_IN_PYPY
  587.   Py_INCREF(__pyx_b);
  588.   #endif
  589.   if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  590.   /*--- Initialize various global constants etc. ---*/
  591.   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  592.   if (__pyx_module_is_main_wtf) {
  593.     if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  594.   }
  595.   /*--- Builtin init code ---*/
  596.   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  597.   /*--- Constants init code ---*/
  598.   if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  599.   /*--- Global init code ---*/
  600.   /*--- Variable export code ---*/
  601.   /*--- Function export code ---*/
  602.   /*--- Type init code ---*/
  603.   /*--- Type import code ---*/
  604.   /*--- Variable import code ---*/
  605.   /*--- Function import code ---*/
  606.   /*--- Execution code ---*/
  607.  
  608.   /* "wtf.pyx":1
  609.  * l = ['1', '2', '3']             # <<<<<<<<<<<<<<
  610.  * l2 = []
  611.  *
  612.  */
  613.   __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  614.   __Pyx_GOTREF(__pyx_t_1);
  615.   __Pyx_INCREF(((PyObject *)__pyx_kp_s__1));
  616.   PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s__1));
  617.   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s__1));
  618.   __Pyx_INCREF(((PyObject *)__pyx_kp_s__2));
  619.   PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s__2));
  620.   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s__2));
  621.   __Pyx_INCREF(((PyObject *)__pyx_kp_s__3));
  622.   PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_kp_s__3));
  623.   __Pyx_GIVEREF(((PyObject *)__pyx_kp_s__3));
  624.   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__l, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  625.   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  626.  
  627.   /* "wtf.pyx":2
  628.  * l = ['1', '2', '3']
  629.  * l2 = []             # <<<<<<<<<<<<<<
  630.  *
  631.  * for item in l:
  632.  */
  633.   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  634.   __Pyx_GOTREF(__pyx_t_1);
  635.   if (PyObject_SetAttr(__pyx_m, __pyx_n_s__l2, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  636.   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  637.  
  638.   /* "wtf.pyx":4
  639.  * l2 = []
  640.  *
  641.  * for item in l:             # <<<<<<<<<<<<<<
  642.  *     pass
  643.  * l2.append(item)
  644.  */
  645.   __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  646.   __Pyx_GOTREF(__pyx_t_1);
  647.   if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
  648.     __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  649.     __pyx_t_4 = NULL;
  650.   } else {
  651.     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  652.     __Pyx_GOTREF(__pyx_t_2);
  653.     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  654.   }
  655.   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  656.   for (;;) {
  657.     if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
  658.       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  659.       #if CYTHON_COMPILING_IN_CPYTHON
  660.       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  661.       #else
  662.       __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  663.       #endif
  664.     } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
  665.       if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  666.       #if CYTHON_COMPILING_IN_CPYTHON
  667.       __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  668.       #else
  669.       __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  670.       #endif
  671.     } else {
  672.       __pyx_t_1 = __pyx_t_4(__pyx_t_2);
  673.       if (unlikely(!__pyx_t_1)) {
  674.         if (PyErr_Occurred()) {
  675.           if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
  676.           else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  677.         }
  678.         break;
  679.       }
  680.       __Pyx_GOTREF(__pyx_t_1);
  681.     }
  682.     if (PyObject_SetAttr(__pyx_m, __pyx_n_s__item, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  683.     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  684.   }
  685.   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  686.  
  687.   /* "wtf.pyx":6
  688.  * for item in l:
  689.  *     pass
  690.  * l2.append(item)             # <<<<<<<<<<<<<<
  691.  *
  692.  */
  693.   __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__l2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  694.   __Pyx_GOTREF(__pyx_t_2);
  695.   __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  696.   __Pyx_GOTREF(__pyx_t_1);
  697.   __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  698.   __Pyx_GOTREF(__pyx_t_5);
  699.   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  700.   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  701.   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  702.  
  703.   /* "wtf.pyx":1
  704.  * l = ['1', '2', '3']             # <<<<<<<<<<<<<<
  705.  * l2 = []
  706.  *
  707.  */
  708.   __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  709.   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  710.   if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  711.   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  712.   goto __pyx_L0;
  713.   __pyx_L1_error:;
  714.   __Pyx_XDECREF(__pyx_t_1);
  715.   __Pyx_XDECREF(__pyx_t_2);
  716.   __Pyx_XDECREF(__pyx_t_5);
  717.   if (__pyx_m) {
  718.     __Pyx_AddTraceback("init wtf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  719.     Py_DECREF(__pyx_m); __pyx_m = 0;
  720.   } else if (!PyErr_Occurred()) {
  721.     PyErr_SetString(PyExc_ImportError, "init wtf");
  722.   }
  723.   __pyx_L0:;
  724.   __Pyx_RefNannyFinishContext();
  725.   #if PY_MAJOR_VERSION < 3
  726.   return;
  727.   #else
  728.   return __pyx_m;
  729.   #endif
  730. }
  731.  
  732. /* Runtime support code */
  733. #if CYTHON_REFNANNY
  734. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  735.     PyObject *m = NULL, *p = NULL;
  736.     void *r = NULL;
  737.     m = PyImport_ImportModule((char *)modname);
  738.     if (!m) goto end;
  739.     p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  740.     if (!p) goto end;
  741.     r = PyLong_AsVoidPtr(p);
  742. end:
  743.     Py_XDECREF(p);
  744.     Py_XDECREF(m);
  745.     return (__Pyx_RefNannyAPIStruct *)r;
  746. }
  747. #endif /* CYTHON_REFNANNY */
  748.  
  749. static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
  750.     PyObject *result;
  751.     result = PyObject_GetAttr(dict, name);
  752.     if (!result) {
  753.         if (dict != __pyx_b) {
  754.             PyErr_Clear();
  755.             result = PyObject_GetAttr(__pyx_b, name);
  756.         }
  757.         if (!result) {
  758.             PyErr_SetObject(PyExc_NameError, name);
  759.         }
  760.     }
  761.     return result;
  762. }
  763.  
  764. static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
  765.     const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
  766.     const int is_unsigned = neg_one > const_zero;
  767.     if (sizeof(unsigned char) < sizeof(long)) {
  768.         long val = __Pyx_PyInt_AsLong(x);
  769.         if (unlikely(val != (long)(unsigned char)val)) {
  770.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  771.                 PyErr_SetString(PyExc_OverflowError,
  772.                     (is_unsigned && unlikely(val < 0)) ?
  773.                     "can't convert negative value to unsigned char" :
  774.                     "value too large to convert to unsigned char");
  775.             }
  776.             return (unsigned char)-1;
  777.         }
  778.         return (unsigned char)val;
  779.     }
  780.     return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
  781. }
  782.  
  783. static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
  784.     const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
  785.     const int is_unsigned = neg_one > const_zero;
  786.     if (sizeof(unsigned short) < sizeof(long)) {
  787.         long val = __Pyx_PyInt_AsLong(x);
  788.         if (unlikely(val != (long)(unsigned short)val)) {
  789.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  790.                 PyErr_SetString(PyExc_OverflowError,
  791.                     (is_unsigned && unlikely(val < 0)) ?
  792.                     "can't convert negative value to unsigned short" :
  793.                     "value too large to convert to unsigned short");
  794.             }
  795.             return (unsigned short)-1;
  796.         }
  797.         return (unsigned short)val;
  798.     }
  799.     return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
  800. }
  801.  
  802. static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
  803.     const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
  804.     const int is_unsigned = neg_one > const_zero;
  805.     if (sizeof(unsigned int) < sizeof(long)) {
  806.         long val = __Pyx_PyInt_AsLong(x);
  807.         if (unlikely(val != (long)(unsigned int)val)) {
  808.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  809.                 PyErr_SetString(PyExc_OverflowError,
  810.                     (is_unsigned && unlikely(val < 0)) ?
  811.                     "can't convert negative value to unsigned int" :
  812.                     "value too large to convert to unsigned int");
  813.             }
  814.             return (unsigned int)-1;
  815.         }
  816.         return (unsigned int)val;
  817.     }
  818.     return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
  819. }
  820.  
  821. static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
  822.     const char neg_one = (char)-1, const_zero = 0;
  823.     const int is_unsigned = neg_one > const_zero;
  824.     if (sizeof(char) < sizeof(long)) {
  825.         long val = __Pyx_PyInt_AsLong(x);
  826.         if (unlikely(val != (long)(char)val)) {
  827.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  828.                 PyErr_SetString(PyExc_OverflowError,
  829.                     (is_unsigned && unlikely(val < 0)) ?
  830.                     "can't convert negative value to char" :
  831.                     "value too large to convert to char");
  832.             }
  833.             return (char)-1;
  834.         }
  835.         return (char)val;
  836.     }
  837.     return (char)__Pyx_PyInt_AsLong(x);
  838. }
  839.  
  840. static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
  841.     const short neg_one = (short)-1, const_zero = 0;
  842.     const int is_unsigned = neg_one > const_zero;
  843.     if (sizeof(short) < sizeof(long)) {
  844.         long val = __Pyx_PyInt_AsLong(x);
  845.         if (unlikely(val != (long)(short)val)) {
  846.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  847.                 PyErr_SetString(PyExc_OverflowError,
  848.                     (is_unsigned && unlikely(val < 0)) ?
  849.                     "can't convert negative value to short" :
  850.                     "value too large to convert to short");
  851.             }
  852.             return (short)-1;
  853.         }
  854.         return (short)val;
  855.     }
  856.     return (short)__Pyx_PyInt_AsLong(x);
  857. }
  858.  
  859. static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
  860.     const int neg_one = (int)-1, const_zero = 0;
  861.     const int is_unsigned = neg_one > const_zero;
  862.     if (sizeof(int) < sizeof(long)) {
  863.         long val = __Pyx_PyInt_AsLong(x);
  864.         if (unlikely(val != (long)(int)val)) {
  865.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  866.                 PyErr_SetString(PyExc_OverflowError,
  867.                     (is_unsigned && unlikely(val < 0)) ?
  868.                     "can't convert negative value to int" :
  869.                     "value too large to convert to int");
  870.             }
  871.             return (int)-1;
  872.         }
  873.         return (int)val;
  874.     }
  875.     return (int)__Pyx_PyInt_AsLong(x);
  876. }
  877.  
  878. static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
  879.     const signed char neg_one = (signed char)-1, const_zero = 0;
  880.     const int is_unsigned = neg_one > const_zero;
  881.     if (sizeof(signed char) < sizeof(long)) {
  882.         long val = __Pyx_PyInt_AsLong(x);
  883.         if (unlikely(val != (long)(signed char)val)) {
  884.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  885.                 PyErr_SetString(PyExc_OverflowError,
  886.                     (is_unsigned && unlikely(val < 0)) ?
  887.                     "can't convert negative value to signed char" :
  888.                     "value too large to convert to signed char");
  889.             }
  890.             return (signed char)-1;
  891.         }
  892.         return (signed char)val;
  893.     }
  894.     return (signed char)__Pyx_PyInt_AsSignedLong(x);
  895. }
  896.  
  897. static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
  898.     const signed short neg_one = (signed short)-1, const_zero = 0;
  899.     const int is_unsigned = neg_one > const_zero;
  900.     if (sizeof(signed short) < sizeof(long)) {
  901.         long val = __Pyx_PyInt_AsLong(x);
  902.         if (unlikely(val != (long)(signed short)val)) {
  903.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  904.                 PyErr_SetString(PyExc_OverflowError,
  905.                     (is_unsigned && unlikely(val < 0)) ?
  906.                     "can't convert negative value to signed short" :
  907.                     "value too large to convert to signed short");
  908.             }
  909.             return (signed short)-1;
  910.         }
  911.         return (signed short)val;
  912.     }
  913.     return (signed short)__Pyx_PyInt_AsSignedLong(x);
  914. }
  915.  
  916. static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
  917.     const signed int neg_one = (signed int)-1, const_zero = 0;
  918.     const int is_unsigned = neg_one > const_zero;
  919.     if (sizeof(signed int) < sizeof(long)) {
  920.         long val = __Pyx_PyInt_AsLong(x);
  921.         if (unlikely(val != (long)(signed int)val)) {
  922.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  923.                 PyErr_SetString(PyExc_OverflowError,
  924.                     (is_unsigned && unlikely(val < 0)) ?
  925.                     "can't convert negative value to signed int" :
  926.                     "value too large to convert to signed int");
  927.             }
  928.             return (signed int)-1;
  929.         }
  930.         return (signed int)val;
  931.     }
  932.     return (signed int)__Pyx_PyInt_AsSignedLong(x);
  933. }
  934.  
  935. static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
  936.     const int neg_one = (int)-1, const_zero = 0;
  937.     const int is_unsigned = neg_one > const_zero;
  938.     if (sizeof(int) < sizeof(long)) {
  939.         long val = __Pyx_PyInt_AsLong(x);
  940.         if (unlikely(val != (long)(int)val)) {
  941.             if (!unlikely(val == -1 && PyErr_Occurred())) {
  942.                 PyErr_SetString(PyExc_OverflowError,
  943.                     (is_unsigned && unlikely(val < 0)) ?
  944.                     "can't convert negative value to int" :
  945.                     "value too large to convert to int");
  946.             }
  947.             return (int)-1;
  948.         }
  949.         return (int)val;
  950.     }
  951.     return (int)__Pyx_PyInt_AsLong(x);
  952. }
  953.  
  954. static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
  955.     const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
  956.     const int is_unsigned = neg_one > const_zero;
  957. #if PY_VERSION_HEX < 0x03000000
  958.     if (likely(PyInt_Check(x))) {
  959.         long val = PyInt_AS_LONG(x);
  960.         if (is_unsigned && unlikely(val < 0)) {
  961.             PyErr_SetString(PyExc_OverflowError,
  962.                             "can't convert negative value to unsigned long");
  963.             return (unsigned long)-1;
  964.         }
  965.         return (unsigned long)val;
  966.     } else
  967. #endif
  968.     if (likely(PyLong_Check(x))) {
  969.         if (is_unsigned) {
  970.             if (unlikely(Py_SIZE(x) < 0)) {
  971.                 PyErr_SetString(PyExc_OverflowError,
  972.                                 "can't convert negative value to unsigned long");
  973.                 return (unsigned long)-1;
  974.             }
  975.             return (unsigned long)PyLong_AsUnsignedLong(x);
  976.         } else {
  977.             return (unsigned long)PyLong_AsLong(x);
  978.         }
  979.     } else {
  980.         unsigned long val;
  981.         PyObject *tmp = __Pyx_PyNumber_Int(x);
  982.         if (!tmp) return (unsigned long)-1;
  983.         val = __Pyx_PyInt_AsUnsignedLong(tmp);
  984.         Py_DECREF(tmp);
  985.         return val;
  986.     }
  987. }
  988.  
  989. static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
  990.     const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
  991.     const int is_unsigned = neg_one > const_zero;
  992. #if PY_VERSION_HEX < 0x03000000
  993.     if (likely(PyInt_Check(x))) {
  994.         long val = PyInt_AS_LONG(x);
  995.         if (is_unsigned && unlikely(val < 0)) {
  996.             PyErr_SetString(PyExc_OverflowError,
  997.                             "can't convert negative value to unsigned PY_LONG_LONG");
  998.             return (unsigned PY_LONG_LONG)-1;
  999.         }
  1000.         return (unsigned PY_LONG_LONG)val;
  1001.     } else
  1002. #endif
  1003.     if (likely(PyLong_Check(x))) {
  1004.         if (is_unsigned) {
  1005.             if (unlikely(Py_SIZE(x) < 0)) {
  1006.                 PyErr_SetString(PyExc_OverflowError,
  1007.                                 "can't convert negative value to unsigned PY_LONG_LONG");
  1008.                 return (unsigned PY_LONG_LONG)-1;
  1009.             }
  1010.             return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
  1011.         } else {
  1012.             return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
  1013.         }
  1014.     } else {
  1015.         unsigned PY_LONG_LONG val;
  1016.         PyObject *tmp = __Pyx_PyNumber_Int(x);
  1017.         if (!tmp) return (unsigned PY_LONG_LONG)-1;
  1018.         val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
  1019.         Py_DECREF(tmp);
  1020.         return val;
  1021.     }
  1022. }
  1023.  
  1024. static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
  1025.     const long neg_one = (long)-1, const_zero = 0;
  1026.     const int is_unsigned = neg_one > const_zero;
  1027. #if PY_VERSION_HEX < 0x03000000
  1028.     if (likely(PyInt_Check(x))) {
  1029.         long val = PyInt_AS_LONG(x);
  1030.         if (is_unsigned && unlikely(val < 0)) {
  1031.             PyErr_SetString(PyExc_OverflowError,
  1032.                             "can't convert negative value to long");
  1033.             return (long)-1;
  1034.         }
  1035.         return (long)val;
  1036.     } else
  1037. #endif
  1038.     if (likely(PyLong_Check(x))) {
  1039.         if (is_unsigned) {
  1040.             if (unlikely(Py_SIZE(x) < 0)) {
  1041.                 PyErr_SetString(PyExc_OverflowError,
  1042.                                 "can't convert negative value to long");
  1043.                 return (long)-1;
  1044.             }
  1045.             return (long)PyLong_AsUnsignedLong(x);
  1046.         } else {
  1047.             return (long)PyLong_AsLong(x);
  1048.         }
  1049.     } else {
  1050.         long val;
  1051.         PyObject *tmp = __Pyx_PyNumber_Int(x);
  1052.         if (!tmp) return (long)-1;
  1053.         val = __Pyx_PyInt_AsLong(tmp);
  1054.         Py_DECREF(tmp);
  1055.         return val;
  1056.     }
  1057. }
  1058.  
  1059. static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
  1060.     const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
  1061.     const int is_unsigned = neg_one > const_zero;
  1062. #if PY_VERSION_HEX < 0x03000000
  1063.     if (likely(PyInt_Check(x))) {
  1064.         long val = PyInt_AS_LONG(x);
  1065.         if (is_unsigned && unlikely(val < 0)) {
  1066.             PyErr_SetString(PyExc_OverflowError,
  1067.                             "can't convert negative value to PY_LONG_LONG");
  1068.             return (PY_LONG_LONG)-1;
  1069.         }
  1070.         return (PY_LONG_LONG)val;
  1071.     } else
  1072. #endif
  1073.     if (likely(PyLong_Check(x))) {
  1074.         if (is_unsigned) {
  1075.             if (unlikely(Py_SIZE(x) < 0)) {
  1076.                 PyErr_SetString(PyExc_OverflowError,
  1077.                                 "can't convert negative value to PY_LONG_LONG");
  1078.                 return (PY_LONG_LONG)-1;
  1079.             }
  1080.             return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
  1081.         } else {
  1082.             return (PY_LONG_LONG)PyLong_AsLongLong(x);
  1083.         }
  1084.     } else {
  1085.         PY_LONG_LONG val;
  1086.         PyObject *tmp = __Pyx_PyNumber_Int(x);
  1087.         if (!tmp) return (PY_LONG_LONG)-1;
  1088.         val = __Pyx_PyInt_AsLongLong(tmp);
  1089.         Py_DECREF(tmp);
  1090.         return val;
  1091.     }
  1092. }
  1093.  
  1094. static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
  1095.     const signed long neg_one = (signed long)-1, const_zero = 0;
  1096.     const int is_unsigned = neg_one > const_zero;
  1097. #if PY_VERSION_HEX < 0x03000000
  1098.     if (likely(PyInt_Check(x))) {
  1099.         long val = PyInt_AS_LONG(x);
  1100.         if (is_unsigned && unlikely(val < 0)) {
  1101.             PyErr_SetString(PyExc_OverflowError,
  1102.                             "can't convert negative value to signed long");
  1103.             return (signed long)-1;
  1104.         }
  1105.         return (signed long)val;
  1106.     } else
  1107. #endif
  1108.     if (likely(PyLong_Check(x))) {
  1109.         if (is_unsigned) {
  1110.             if (unlikely(Py_SIZE(x) < 0)) {
  1111.                 PyErr_SetString(PyExc_OverflowError,
  1112.                                 "can't convert negative value to signed long");
  1113.                 return (signed long)-1;
  1114.             }
  1115.             return (signed long)PyLong_AsUnsignedLong(x);
  1116.         } else {
  1117.             return (signed long)PyLong_AsLong(x);
  1118.         }
  1119.     } else {
  1120.         signed long val;
  1121.         PyObject *tmp = __Pyx_PyNumber_Int(x);
  1122.         if (!tmp) return (signed long)-1;
  1123.         val = __Pyx_PyInt_AsSignedLong(tmp);
  1124.         Py_DECREF(tmp);
  1125.         return val;
  1126.     }
  1127. }
  1128.  
  1129. static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
  1130.     const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
  1131.     const int is_unsigned = neg_one > const_zero;
  1132. #if PY_VERSION_HEX < 0x03000000
  1133.     if (likely(PyInt_Check(x))) {
  1134.         long val = PyInt_AS_LONG(x);
  1135.         if (is_unsigned && unlikely(val < 0)) {
  1136.             PyErr_SetString(PyExc_OverflowError,
  1137.                             "can't convert negative value to signed PY_LONG_LONG");
  1138.             return (signed PY_LONG_LONG)-1;
  1139.         }
  1140.         return (signed PY_LONG_LONG)val;
  1141.     } else
  1142. #endif
  1143.     if (likely(PyLong_Check(x))) {
  1144.         if (is_unsigned) {
  1145.             if (unlikely(Py_SIZE(x) < 0)) {
  1146.                 PyErr_SetString(PyExc_OverflowError,
  1147.                                 "can't convert negative value to signed PY_LONG_LONG");
  1148.                 return (signed PY_LONG_LONG)-1;
  1149.             }
  1150.             return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
  1151.         } else {
  1152.             return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
  1153.         }
  1154.     } else {
  1155.         signed PY_LONG_LONG val;
  1156.         PyObject *tmp = __Pyx_PyNumber_Int(x);
  1157.         if (!tmp) return (signed PY_LONG_LONG)-1;
  1158.         val = __Pyx_PyInt_AsSignedLongLong(tmp);
  1159.         Py_DECREF(tmp);
  1160.         return val;
  1161.     }
  1162. }
  1163.  
  1164. static int __Pyx_check_binary_version(void) {
  1165.     char ctversion[4], rtversion[4];
  1166.     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  1167.     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  1168.     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  1169.         char message[200];
  1170.         PyOS_snprintf(message, sizeof(message),
  1171.                       "compiletime version %s of module '%.100s' "
  1172.                       "does not match runtime version %s",
  1173.                       ctversion, __Pyx_MODULE_NAME, rtversion);
  1174.         #if PY_VERSION_HEX < 0x02050000
  1175.         return PyErr_Warn(NULL, message);
  1176.         #else
  1177.         return PyErr_WarnEx(NULL, message, 1);
  1178.         #endif
  1179.     }
  1180.     return 0;
  1181. }
  1182.  
  1183. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  1184.     int start = 0, mid = 0, end = count - 1;
  1185.     if (end >= 0 && code_line > entries[end].code_line) {
  1186.         return count;
  1187.     }
  1188.     while (start < end) {
  1189.         mid = (start + end) / 2;
  1190.         if (code_line < entries[mid].code_line) {
  1191.             end = mid;
  1192.         } else if (code_line > entries[mid].code_line) {
  1193.              start = mid + 1;
  1194.         } else {
  1195.             return mid;
  1196.         }
  1197.     }
  1198.     if (code_line <= entries[mid].code_line) {
  1199.         return mid;
  1200.     } else {
  1201.         return mid + 1;
  1202.     }
  1203. }
  1204. static PyCodeObject *__pyx_find_code_object(int code_line) {
  1205.     PyCodeObject* code_object;
  1206.     int pos;
  1207.     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  1208.         return NULL;
  1209.     }
  1210.     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  1211.     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  1212.         return NULL;
  1213.     }
  1214.     code_object = __pyx_code_cache.entries[pos].code_object;
  1215.     Py_INCREF(code_object);
  1216.     return code_object;
  1217. }
  1218. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  1219.     int pos, i;
  1220.     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  1221.     if (unlikely(!code_line)) {
  1222.         return;
  1223.     }
  1224.     if (unlikely(!entries)) {
  1225.         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  1226.         if (likely(entries)) {
  1227.             __pyx_code_cache.entries = entries;
  1228.             __pyx_code_cache.max_count = 64;
  1229.             __pyx_code_cache.count = 1;
  1230.             entries[0].code_line = code_line;
  1231.             entries[0].code_object = code_object;
  1232.             Py_INCREF(code_object);
  1233.         }
  1234.         return;
  1235.     }
  1236.     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  1237.     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  1238.         PyCodeObject* tmp = entries[pos].code_object;
  1239.         entries[pos].code_object = code_object;
  1240.         Py_DECREF(tmp);
  1241.         return;
  1242.     }
  1243.     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  1244.         int new_max = __pyx_code_cache.max_count + 64;
  1245.         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  1246.             __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  1247.         if (unlikely(!entries)) {
  1248.             return;
  1249.         }
  1250.         __pyx_code_cache.entries = entries;
  1251.         __pyx_code_cache.max_count = new_max;
  1252.     }
  1253.     for (i=__pyx_code_cache.count; i>pos; i--) {
  1254.         entries[i] = entries[i-1];
  1255.     }
  1256.     entries[pos].code_line = code_line;
  1257.     entries[pos].code_object = code_object;
  1258.     __pyx_code_cache.count++;
  1259.     Py_INCREF(code_object);
  1260. }
  1261.  
  1262. #include "compile.h"
  1263. #include "frameobject.h"
  1264. #include "traceback.h"
  1265. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  1266.             const char *funcname, int c_line,
  1267.             int py_line, const char *filename) {
  1268.     PyCodeObject *py_code = 0;
  1269.     PyObject *py_srcfile = 0;
  1270.     PyObject *py_funcname = 0;
  1271.     #if PY_MAJOR_VERSION < 3
  1272.     py_srcfile = PyString_FromString(filename);
  1273.     #else
  1274.     py_srcfile = PyUnicode_FromString(filename);
  1275.     #endif
  1276.     if (!py_srcfile) goto bad;
  1277.     if (c_line) {
  1278.         #if PY_MAJOR_VERSION < 3
  1279.         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  1280.         #else
  1281.         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  1282.         #endif
  1283.     }
  1284.     else {
  1285.         #if PY_MAJOR_VERSION < 3
  1286.         py_funcname = PyString_FromString(funcname);
  1287.         #else
  1288.         py_funcname = PyUnicode_FromString(funcname);
  1289.         #endif
  1290.     }
  1291.     if (!py_funcname) goto bad;
  1292.     py_code = __Pyx_PyCode_New(
  1293.         0,            /*int argcount,*/
  1294.         0,            /*int kwonlyargcount,*/
  1295.         0,            /*int nlocals,*/
  1296.         0,            /*int stacksize,*/
  1297.         0,            /*int flags,*/
  1298.         __pyx_empty_bytes, /*PyObject *code,*/
  1299.         __pyx_empty_tuple, /*PyObject *consts,*/
  1300.         __pyx_empty_tuple, /*PyObject *names,*/
  1301.         __pyx_empty_tuple, /*PyObject *varnames,*/
  1302.         __pyx_empty_tuple, /*PyObject *freevars,*/
  1303.         __pyx_empty_tuple, /*PyObject *cellvars,*/
  1304.         py_srcfile,   /*PyObject *filename,*/
  1305.         py_funcname,  /*PyObject *name,*/
  1306.         py_line,      /*int firstlineno,*/
  1307.         __pyx_empty_bytes  /*PyObject *lnotab*/
  1308.     );
  1309.     Py_DECREF(py_srcfile);
  1310.     Py_DECREF(py_funcname);
  1311.     return py_code;
  1312. bad:
  1313.     Py_XDECREF(py_srcfile);
  1314.     Py_XDECREF(py_funcname);
  1315.     return NULL;
  1316. }
  1317. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1318.                                int py_line, const char *filename) {
  1319.     PyCodeObject *py_code = 0;
  1320.     PyObject *py_globals = 0;
  1321.     PyFrameObject *py_frame = 0;
  1322.     py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  1323.     if (!py_code) {
  1324.         py_code = __Pyx_CreateCodeObjectForTraceback(
  1325.             funcname, c_line, py_line, filename);
  1326.         if (!py_code) goto bad;
  1327.         __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  1328.     }
  1329.     py_globals = PyModule_GetDict(__pyx_m);
  1330.     if (!py_globals) goto bad;
  1331.     py_frame = PyFrame_New(
  1332.         PyThreadState_GET(), /*PyThreadState *tstate,*/
  1333.         py_code,             /*PyCodeObject *code,*/
  1334.         py_globals,          /*PyObject *globals,*/
  1335.         0                    /*PyObject *locals*/
  1336.     );
  1337.     if (!py_frame) goto bad;
  1338.     py_frame->f_lineno = py_line;
  1339.     PyTraceBack_Here(py_frame);
  1340. bad:
  1341.     Py_XDECREF(py_code);
  1342.     Py_XDECREF(py_frame);
  1343. }
  1344.  
  1345. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  1346.     while (t->p) {
  1347.         #if PY_MAJOR_VERSION < 3
  1348.         if (t->is_unicode) {
  1349.             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  1350.         } else if (t->intern) {
  1351.             *t->p = PyString_InternFromString(t->s);
  1352.         } else {
  1353.             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  1354.         }
  1355.         #else  /* Python 3+ has unicode identifiers */
  1356.         if (t->is_unicode | t->is_str) {
  1357.             if (t->intern) {
  1358.                 *t->p = PyUnicode_InternFromString(t->s);
  1359.             } else if (t->encoding) {
  1360.                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  1361.             } else {
  1362.                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  1363.             }
  1364.         } else {
  1365.             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  1366.         }
  1367.         #endif
  1368.         if (!*t->p)
  1369.             return -1;
  1370.         ++t;
  1371.     }
  1372.     return 0;
  1373. }
  1374.  
  1375.  
  1376. /* Type Conversion Functions */
  1377.  
  1378. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  1379.    int is_true = x == Py_True;
  1380.    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  1381.    else return PyObject_IsTrue(x);
  1382. }
  1383.  
  1384. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  1385.   PyNumberMethods *m;
  1386.   const char *name = NULL;
  1387.   PyObject *res = NULL;
  1388. #if PY_VERSION_HEX < 0x03000000
  1389.   if (PyInt_Check(x) || PyLong_Check(x))
  1390. #else
  1391.   if (PyLong_Check(x))
  1392. #endif
  1393.     return Py_INCREF(x), x;
  1394.   m = Py_TYPE(x)->tp_as_number;
  1395. #if PY_VERSION_HEX < 0x03000000
  1396.   if (m && m->nb_int) {
  1397.     name = "int";
  1398.     res = PyNumber_Int(x);
  1399.   }
  1400.   else if (m && m->nb_long) {
  1401.     name = "long";
  1402.     res = PyNumber_Long(x);
  1403.   }
  1404. #else
  1405.   if (m && m->nb_int) {
  1406.     name = "int";
  1407.     res = PyNumber_Long(x);
  1408.   }
  1409. #endif
  1410.   if (res) {
  1411. #if PY_VERSION_HEX < 0x03000000
  1412.     if (!PyInt_Check(res) && !PyLong_Check(res)) {
  1413. #else
  1414.     if (!PyLong_Check(res)) {
  1415. #endif
  1416.       PyErr_Format(PyExc_TypeError,
  1417.                    "__%s__ returned non-%s (type %.200s)",
  1418.                    name, name, Py_TYPE(res)->tp_name);
  1419.       Py_DECREF(res);
  1420.       return NULL;
  1421.     }
  1422.   }
  1423.   else if (!PyErr_Occurred()) {
  1424.     PyErr_SetString(PyExc_TypeError,
  1425.                     "an integer is required");
  1426.   }
  1427.   return res;
  1428. }
  1429.  
  1430. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  1431.   Py_ssize_t ival;
  1432.   PyObject* x = PyNumber_Index(b);
  1433.   if (!x) return -1;
  1434.   ival = PyInt_AsSsize_t(x);
  1435.   Py_DECREF(x);
  1436.   return ival;
  1437. }
  1438.  
  1439. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  1440. #if PY_VERSION_HEX < 0x02050000
  1441.    if (ival <= LONG_MAX)
  1442.        return PyInt_FromLong((long)ival);
  1443.    else {
  1444.        unsigned char *bytes = (unsigned char *) &ival;
  1445.        int one = 1; int little = (int)*(unsigned char*)&one;
  1446.        return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
  1447.    }
  1448. #else
  1449.    return PyInt_FromSize_t(ival);
  1450. #endif
  1451. }
  1452.  
  1453. static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
  1454.    unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
  1455.    if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
  1456.        return (size_t)-1;
  1457.    } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
  1458.        PyErr_SetString(PyExc_OverflowError,
  1459.                        "value too large to convert to size_t");
  1460.        return (size_t)-1;
  1461.    }
  1462.    return (size_t)val;
  1463. }
  1464.  
  1465.  
  1466. #endif /* Py_PYTHON_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement