Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 77.99 KB | None | 0 0
  1. /* Generated by Cython 0.24.1 */
  2.  
  3. /* BEGIN: Cython Metadata
  4. {
  5.     "distutils": {},
  6.     "module_name": "hello"
  7. }
  8. END: Cython Metadata */
  9.  
  10. #define PY_SSIZE_T_CLEAN
  11. #include "Python.h"
  12. #ifndef Py_PYTHON_H
  13.     #error Python headers needed to compile C extensions, please install development version of Python.
  14. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
  15.     #error Cython requires Python 2.6+ or Python 3.2+.
  16. #else
  17. #define CYTHON_ABI "0_24_1"
  18. #include <stddef.h>
  19. #ifndef offsetof
  20.   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  21. #endif
  22. #if !defined(WIN32) && !defined(MS_WINDOWS)
  23.   #ifndef __stdcall
  24.     #define __stdcall
  25.   #endif
  26.   #ifndef __cdecl
  27.     #define __cdecl
  28.   #endif
  29.   #ifndef __fastcall
  30.     #define __fastcall
  31.   #endif
  32. #endif
  33. #ifndef DL_IMPORT
  34.   #define DL_IMPORT(t) t
  35. #endif
  36. #ifndef DL_EXPORT
  37.   #define DL_EXPORT(t) t
  38. #endif
  39. #ifndef PY_LONG_LONG
  40.   #define PY_LONG_LONG LONG_LONG
  41. #endif
  42. #ifndef Py_HUGE_VAL
  43.   #define Py_HUGE_VAL HUGE_VAL
  44. #endif
  45. #ifdef PYPY_VERSION
  46.   #define CYTHON_COMPILING_IN_PYPY 1
  47.   #define CYTHON_COMPILING_IN_CPYTHON 0
  48. #else
  49.   #define CYTHON_COMPILING_IN_PYPY 0
  50.   #define CYTHON_COMPILING_IN_CPYTHON 1
  51. #endif
  52. #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
  53.   #define CYTHON_USE_PYLONG_INTERNALS 1
  54. #endif
  55. #if CYTHON_USE_PYLONG_INTERNALS
  56.   #include "longintrepr.h"
  57.   #undef SHIFT
  58.   #undef BASE
  59.   #undef MASK
  60. #endif
  61. #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  62.   #define Py_OptimizeFlag 0
  63. #endif
  64. #define __PYX_BUILD_PY_SSIZE_T "n"
  65. #define CYTHON_FORMAT_SSIZE_T "z"
  66. #if PY_MAJOR_VERSION < 3
  67.   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  68.   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  69.           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  70.   #define __Pyx_DefaultClassType PyClass_Type
  71. #else
  72.   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  73.   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  74.           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  75.   #define __Pyx_DefaultClassType PyType_Type
  76. #endif
  77. #ifndef Py_TPFLAGS_CHECKTYPES
  78.   #define Py_TPFLAGS_CHECKTYPES 0
  79. #endif
  80. #ifndef Py_TPFLAGS_HAVE_INDEX
  81.   #define Py_TPFLAGS_HAVE_INDEX 0
  82. #endif
  83. #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  84.   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  85. #endif
  86. #ifndef Py_TPFLAGS_HAVE_FINALIZE
  87.   #define Py_TPFLAGS_HAVE_FINALIZE 0
  88. #endif
  89. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  90.   #define CYTHON_PEP393_ENABLED 1
  91.   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
  92.                                               0 : _PyUnicode_Ready((PyObject *)(op)))
  93.   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  94.   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  95.   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  96.   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  97.   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  98.   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  99. #else
  100.   #define CYTHON_PEP393_ENABLED 0
  101.   #define __Pyx_PyUnicode_READY(op)       (0)
  102.   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  103.   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  104.   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  105.   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  106.   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  107.   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
  108. #endif
  109. #if CYTHON_COMPILING_IN_PYPY
  110.   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  111.   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
  112. #else
  113.   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  114.   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
  115.       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  116. #endif
  117. #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  118.   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  119. #endif
  120. #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  121.   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  122. #endif
  123. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  124.   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  125. #endif
  126. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  127.   #define PyObject_Malloc(s)   PyMem_Malloc(s)
  128.   #define PyObject_Free(p)     PyMem_Free(p)
  129.   #define PyObject_Realloc(p)  PyMem_Realloc(p)
  130. #endif
  131. #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  132. #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  133. #if PY_MAJOR_VERSION >= 3
  134.   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
  135. #else
  136.   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
  137. #endif
  138. #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  139.   #define PyObject_ASCII(o)            PyObject_Repr(o)
  140. #endif
  141. #if PY_MAJOR_VERSION >= 3
  142.   #define PyBaseString_Type            PyUnicode_Type
  143.   #define PyStringObject               PyUnicodeObject
  144.   #define PyString_Type                PyUnicode_Type
  145.   #define PyString_Check               PyUnicode_Check
  146.   #define PyString_CheckExact          PyUnicode_CheckExact
  147. #endif
  148. #if PY_MAJOR_VERSION >= 3
  149.   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  150.   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  151. #else
  152.   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  153.   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  154. #endif
  155. #ifndef PySet_CheckExact
  156.   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
  157. #endif
  158. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  159. #if PY_MAJOR_VERSION >= 3
  160.   #define PyIntObject                  PyLongObject
  161.   #define PyInt_Type                   PyLong_Type
  162.   #define PyInt_Check(op)              PyLong_Check(op)
  163.   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  164.   #define PyInt_FromString             PyLong_FromString
  165.   #define PyInt_FromUnicode            PyLong_FromUnicode
  166.   #define PyInt_FromLong               PyLong_FromLong
  167.   #define PyInt_FromSize_t             PyLong_FromSize_t
  168.   #define PyInt_FromSsize_t            PyLong_FromSsize_t
  169.   #define PyInt_AsLong                 PyLong_AsLong
  170.   #define PyInt_AS_LONG                PyLong_AS_LONG
  171.   #define PyInt_AsSsize_t              PyLong_AsSsize_t
  172.   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  173.   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  174.   #define PyNumber_Int                 PyNumber_Long
  175. #endif
  176. #if PY_MAJOR_VERSION >= 3
  177.   #define PyBoolObject                 PyLongObject
  178. #endif
  179. #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  180.   #ifndef PyUnicode_InternFromString
  181.     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  182.   #endif
  183. #endif
  184. #if PY_VERSION_HEX < 0x030200A4
  185.   typedef long Py_hash_t;
  186.   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  187.   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
  188. #else
  189.   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  190.   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
  191. #endif
  192. #if PY_MAJOR_VERSION >= 3
  193.   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
  194. #else
  195.   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
  196. #endif
  197. #if PY_VERSION_HEX >= 0x030500B1
  198. #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
  199. #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  200. #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  201. typedef struct {
  202.     unaryfunc am_await;
  203.     unaryfunc am_aiter;
  204.     unaryfunc am_anext;
  205. } __Pyx_PyAsyncMethodsStruct;
  206. #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  207. #else
  208. #define __Pyx_PyType_AsAsync(obj) NULL
  209. #endif
  210. #ifndef CYTHON_RESTRICT
  211.   #if defined(__GNUC__)
  212.     #define CYTHON_RESTRICT __restrict__
  213.   #elif defined(_MSC_VER) && _MSC_VER >= 1400
  214.     #define CYTHON_RESTRICT __restrict
  215.   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  216.     #define CYTHON_RESTRICT restrict
  217.   #else
  218.     #define CYTHON_RESTRICT
  219.   #endif
  220. #endif
  221. #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
  222.  
  223. #ifndef CYTHON_INLINE
  224.   #if defined(__GNUC__)
  225.     #define CYTHON_INLINE __inline__
  226.   #elif defined(_MSC_VER)
  227.     #define CYTHON_INLINE __inline
  228.   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  229.     #define CYTHON_INLINE inline
  230.   #else
  231.     #define CYTHON_INLINE
  232.   #endif
  233. #endif
  234.  
  235. #if defined(WIN32) || defined(MS_WINDOWS)
  236.   #define _USE_MATH_DEFINES
  237. #endif
  238. #include <math.h>
  239. #ifdef NAN
  240. #define __PYX_NAN() ((float) NAN)
  241. #else
  242. static CYTHON_INLINE float __PYX_NAN() {
  243.   float value;
  244.   memset(&value, 0xFF, sizeof(value));
  245.   return value;
  246. }
  247. #endif
  248. #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
  249. #define __Pyx_truncl trunc
  250. #else
  251. #define __Pyx_truncl truncl
  252. #endif
  253.  
  254.  
  255. #define __PYX_ERR(f_index, lineno, Ln_error) \
  256. { \
  257.   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
  258. }
  259.  
  260. #if PY_MAJOR_VERSION >= 3
  261.   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  262.   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
  263. #else
  264.   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  265.   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
  266. #endif
  267.  
  268. #ifndef __PYX_EXTERN_C
  269.   #ifdef __cplusplus
  270.     #define __PYX_EXTERN_C extern "C"
  271.   #else
  272.     #define __PYX_EXTERN_C extern
  273.   #endif
  274. #endif
  275.  
  276. #define __PYX_HAVE__hello
  277. #define __PYX_HAVE_API__hello
  278. #ifdef _OPENMP
  279. #include <omp.h>
  280. #endif /* _OPENMP */
  281.  
  282. #ifdef PYREX_WITHOUT_ASSERTIONS
  283. #define CYTHON_WITHOUT_ASSERTIONS
  284. #endif
  285.  
  286. #ifndef CYTHON_UNUSED
  287. # if defined(__GNUC__)
  288. #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  289. #     define CYTHON_UNUSED __attribute__ ((__unused__))
  290. #   else
  291. #     define CYTHON_UNUSED
  292. #   endif
  293. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  294. #   define CYTHON_UNUSED __attribute__ ((__unused__))
  295. # else
  296. #   define CYTHON_UNUSED
  297. # endif
  298. #endif
  299. #ifndef CYTHON_NCP_UNUSED
  300. # if CYTHON_COMPILING_IN_CPYTHON
  301. #  define CYTHON_NCP_UNUSED
  302. # else
  303. #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
  304. # endif
  305. #endif
  306. typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
  307.                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
  308.  
  309. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  310. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  311. #define __PYX_DEFAULT_STRING_ENCODING ""
  312. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  313. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  314. #define __Pyx_uchar_cast(c) ((unsigned char)c)
  315. #define __Pyx_long_cast(x) ((long)x)
  316. #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
  317.     (sizeof(type) < sizeof(Py_ssize_t))  ||\
  318.     (sizeof(type) > sizeof(Py_ssize_t) &&\
  319.           likely(v < (type)PY_SSIZE_T_MAX ||\
  320.                  v == (type)PY_SSIZE_T_MAX)  &&\
  321.           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
  322.                                 v == (type)PY_SSIZE_T_MIN)))  ||\
  323.     (sizeof(type) == sizeof(Py_ssize_t) &&\
  324.           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
  325.                                v == (type)PY_SSIZE_T_MAX)))  )
  326. #if defined (__cplusplus) && __cplusplus >= 201103L
  327.     #include <cstdlib>
  328.     #define __Pyx_sst_abs(value) std::abs(value)
  329. #elif SIZEOF_INT >= SIZEOF_SIZE_T
  330.     #define __Pyx_sst_abs(value) abs(value)
  331. #elif SIZEOF_LONG >= SIZEOF_SIZE_T
  332.     #define __Pyx_sst_abs(value) labs(value)
  333. #elif defined (_MSC_VER) && defined (_M_X64)
  334.     #define __Pyx_sst_abs(value) _abs64(value)
  335. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  336.     #define __Pyx_sst_abs(value) llabs(value)
  337. #elif defined (__GNUC__)
  338.     #define __Pyx_sst_abs(value) __builtin_llabs(value)
  339. #else
  340.     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
  341. #endif
  342. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
  343. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  344. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  345. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  346. #define __Pyx_PyBytes_FromString        PyBytes_FromString
  347. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  348. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  349. #if PY_MAJOR_VERSION < 3
  350.     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
  351.     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  352. #else
  353.     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
  354.     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  355. #endif
  356. #define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
  357. #define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
  358. #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
  359. #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
  360. #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
  361. #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
  362. #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
  363. #if PY_MAJOR_VERSION < 3
  364. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  365. {
  366.     const Py_UNICODE *u_end = u;
  367.     while (*u_end++) ;
  368.     return (size_t)(u_end - u - 1);
  369. }
  370. #else
  371. #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
  372. #endif
  373. #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  374. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  375. #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
  376. #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
  377. #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
  378. #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
  379. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  380. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
  381. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  382. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  383. #if CYTHON_COMPILING_IN_CPYTHON
  384. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  385. #else
  386. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  387. #endif
  388. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  389. #if PY_MAJOR_VERSION >= 3
  390. #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
  391. #else
  392. #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
  393. #endif
  394. #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
  395. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  396. static int __Pyx_sys_getdefaultencoding_not_ascii;
  397. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  398.     PyObject* sys;
  399.     PyObject* default_encoding = NULL;
  400.     PyObject* ascii_chars_u = NULL;
  401.     PyObject* ascii_chars_b = NULL;
  402.     const char* default_encoding_c;
  403.     sys = PyImport_ImportModule("sys");
  404.     if (!sys) goto bad;
  405.     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
  406.     Py_DECREF(sys);
  407.     if (!default_encoding) goto bad;
  408.     default_encoding_c = PyBytes_AsString(default_encoding);
  409.     if (!default_encoding_c) goto bad;
  410.     if (strcmp(default_encoding_c, "ascii") == 0) {
  411.         __Pyx_sys_getdefaultencoding_not_ascii = 0;
  412.     } else {
  413.         char ascii_chars[128];
  414.         int c;
  415.         for (c = 0; c < 128; c++) {
  416.             ascii_chars[c] = c;
  417.         }
  418.         __Pyx_sys_getdefaultencoding_not_ascii = 1;
  419.         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  420.         if (!ascii_chars_u) goto bad;
  421.         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  422.         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  423.             PyErr_Format(
  424.                 PyExc_ValueError,
  425.                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  426.                 default_encoding_c);
  427.             goto bad;
  428.         }
  429.         Py_DECREF(ascii_chars_u);
  430.         Py_DECREF(ascii_chars_b);
  431.     }
  432.     Py_DECREF(default_encoding);
  433.     return 0;
  434. bad:
  435.     Py_XDECREF(default_encoding);
  436.     Py_XDECREF(ascii_chars_u);
  437.     Py_XDECREF(ascii_chars_b);
  438.     return -1;
  439. }
  440. #endif
  441. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  442. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  443. #else
  444. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  445. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  446. static char* __PYX_DEFAULT_STRING_ENCODING;
  447. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  448.     PyObject* sys;
  449.     PyObject* default_encoding = NULL;
  450.     char* default_encoding_c;
  451.     sys = PyImport_ImportModule("sys");
  452.     if (!sys) goto bad;
  453.     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  454.     Py_DECREF(sys);
  455.     if (!default_encoding) goto bad;
  456.     default_encoding_c = PyBytes_AsString(default_encoding);
  457.     if (!default_encoding_c) goto bad;
  458.     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  459.     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
  460.     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  461.     Py_DECREF(default_encoding);
  462.     return 0;
  463. bad:
  464.     Py_XDECREF(default_encoding);
  465.     return -1;
  466. }
  467. #endif
  468. #endif
  469.  
  470.  
  471. /* Test for GCC > 2.95 */
  472. #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  473.   #define likely(x)   __builtin_expect(!!(x), 1)
  474.   #define unlikely(x) __builtin_expect(!!(x), 0)
  475. #else /* !__GNUC__ or GCC < 2.95 */
  476.   #define likely(x)   (x)
  477.   #define unlikely(x) (x)
  478. #endif /* __GNUC__ */
  479.  
  480. static PyObject *__pyx_m;
  481. static PyObject *__pyx_d;
  482. static PyObject *__pyx_b;
  483. static PyObject *__pyx_empty_tuple;
  484. static PyObject *__pyx_empty_bytes;
  485. static PyObject *__pyx_empty_unicode;
  486. static int __pyx_lineno;
  487. static int __pyx_clineno = 0;
  488. static const char * __pyx_cfilenm= __FILE__;
  489. static const char *__pyx_filename;
  490.  
  491.  
  492. static const char *__pyx_f[] = {
  493.   "hello.pyx",
  494. };
  495.  
  496. /*--- Type declarations ---*/
  497.  
  498. /* --- Runtime support code (head) --- */
  499. /* Refnanny.proto */
  500. #ifndef CYTHON_REFNANNY
  501.   #define CYTHON_REFNANNY 0
  502. #endif
  503. #if CYTHON_REFNANNY
  504.   typedef struct {
  505.     void (*INCREF)(void*, PyObject*, int);
  506.     void (*DECREF)(void*, PyObject*, int);
  507.     void (*GOTREF)(void*, PyObject*, int);
  508.     void (*GIVEREF)(void*, PyObject*, int);
  509.     void* (*SetupContext)(const char*, int, const char*);
  510.     void (*FinishContext)(void**);
  511.   } __Pyx_RefNannyAPIStruct;
  512.   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  513.   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  514.   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  515. #ifdef WITH_THREAD
  516.   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  517.           if (acquire_gil) {\
  518.               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  519.               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  520.               PyGILState_Release(__pyx_gilstate_save);\
  521.           } else {\
  522.               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  523.           }
  524. #else
  525.   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  526.           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  527. #endif
  528.   #define __Pyx_RefNannyFinishContext()\
  529.           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  530.   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  531.   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  532.   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  533.   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  534.   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  535.   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  536.   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  537.   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  538. #else
  539.   #define __Pyx_RefNannyDeclarations
  540.   #define __Pyx_RefNannySetupContext(name, acquire_gil)
  541.   #define __Pyx_RefNannyFinishContext()
  542.   #define __Pyx_INCREF(r) Py_INCREF(r)
  543.   #define __Pyx_DECREF(r) Py_DECREF(r)
  544.   #define __Pyx_GOTREF(r)
  545.   #define __Pyx_GIVEREF(r)
  546.   #define __Pyx_XINCREF(r) Py_XINCREF(r)
  547.   #define __Pyx_XDECREF(r) Py_XDECREF(r)
  548.   #define __Pyx_XGOTREF(r)
  549.   #define __Pyx_XGIVEREF(r)
  550. #endif
  551. #define __Pyx_XDECREF_SET(r, v) do {\
  552.         PyObject *tmp = (PyObject *) r;\
  553.         r = v; __Pyx_XDECREF(tmp);\
  554.     } while (0)
  555. #define __Pyx_DECREF_SET(r, v) do {\
  556.         PyObject *tmp = (PyObject *) r;\
  557.         r = v; __Pyx_DECREF(tmp);\
  558.     } while (0)
  559. #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  560. #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  561.  
  562. /* PyObjectGetAttrStr.proto */
  563. #if CYTHON_COMPILING_IN_CPYTHON
  564. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  565.     PyTypeObject* tp = Py_TYPE(obj);
  566.     if (likely(tp->tp_getattro))
  567.         return tp->tp_getattro(obj, attr_name);
  568. #if PY_MAJOR_VERSION < 3
  569.     if (likely(tp->tp_getattr))
  570.         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  571. #endif
  572.     return PyObject_GetAttr(obj, attr_name);
  573. }
  574. #else
  575. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  576. #endif
  577.  
  578. /* PyObjectCall.proto */
  579. #if CYTHON_COMPILING_IN_CPYTHON
  580. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
  581. #else
  582. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  583. #endif
  584.  
  585. /* PyObjectCallMethO.proto */
  586. #if CYTHON_COMPILING_IN_CPYTHON
  587. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
  588. #endif
  589.  
  590. /* PyObjectCallOneArg.proto */
  591. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
  592.  
  593. /* CodeObjectCache.proto */
  594. typedef struct {
  595.     PyCodeObject* code_object;
  596.     int code_line;
  597. } __Pyx_CodeObjectCacheEntry;
  598. struct __Pyx_CodeObjectCache {
  599.     int count;
  600.     int max_count;
  601.     __Pyx_CodeObjectCacheEntry* entries;
  602. };
  603. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  604. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  605. static PyCodeObject *__pyx_find_code_object(int code_line);
  606. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  607.  
  608. /* AddTraceback.proto */
  609. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  610.                                int py_line, const char *filename);
  611.  
  612. /* Print.proto */
  613. static int __Pyx_Print(PyObject*, PyObject *, int);
  614. #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
  615. static PyObject* __pyx_print = 0;
  616. static PyObject* __pyx_print_kwargs = 0;
  617. #endif
  618.  
  619. /* PrintOne.proto */
  620. static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
  621.  
  622. /* CIntToPy.proto */
  623. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  624.  
  625. /* CIntFromPy.proto */
  626. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  627.  
  628. /* CIntFromPy.proto */
  629. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  630.  
  631. /* CheckBinaryVersion.proto */
  632. static int __Pyx_check_binary_version(void);
  633.  
  634. /* InitStrings.proto */
  635. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
  636.  
  637.  
  638. /* Module declarations from 'hello' */
  639. #define __Pyx_MODULE_NAME "hello"
  640. int __pyx_module_is_main_hello = 0;
  641.  
  642. /* Implementation of 'hello' */
  643. static const char __pyx_k_Hi[] = "Hi, {}";
  644. static const char __pyx_k_end[] = "end";
  645. static const char __pyx_k_file[] = "file";
  646. static const char __pyx_k_main[] = "__main__";
  647. static const char __pyx_k_name[] = "name";
  648. static const char __pyx_k_test[] = "__test__";
  649. static const char __pyx_k_hello[] = "hello";
  650. static const char __pyx_k_print[] = "print";
  651. static const char __pyx_k_format[] = "format";
  652. static const char __pyx_k_say_hello[] = "say_hello";
  653. static const char __pyx_k_C_Users_Tom_Desktop_hello_pyx[] = "C:\\Users\\Tom\\Desktop\\hello.pyx";
  654. static PyObject *__pyx_kp_s_C_Users_Tom_Desktop_hello_pyx;
  655. static PyObject *__pyx_kp_s_Hi;
  656. static PyObject *__pyx_n_s_end;
  657. static PyObject *__pyx_n_s_file;
  658. static PyObject *__pyx_n_s_format;
  659. static PyObject *__pyx_n_s_hello;
  660. static PyObject *__pyx_n_s_main;
  661. static PyObject *__pyx_n_s_name;
  662. static PyObject *__pyx_n_s_print;
  663. static PyObject *__pyx_n_s_say_hello;
  664. static PyObject *__pyx_n_s_test;
  665. static PyObject *__pyx_pf_5hello_say_hello(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
  666. static PyObject *__pyx_tuple_;
  667. static PyObject *__pyx_codeobj__2;
  668.  
  669. /* "hello.pyx":1
  670.  * def say_hello(name):             # <<<<<<<<<<<<<<
  671.  *     print('Hi, {}'.format(name))
  672.  */
  673.  
  674. /* Python wrapper */
  675. static PyObject *__pyx_pw_5hello_1say_hello(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
  676. static PyMethodDef __pyx_mdef_5hello_1say_hello = {"say_hello", (PyCFunction)__pyx_pw_5hello_1say_hello, METH_O, 0};
  677. static PyObject *__pyx_pw_5hello_1say_hello(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  678.   PyObject *__pyx_r = 0;
  679.   __Pyx_RefNannyDeclarations
  680.   __Pyx_RefNannySetupContext("say_hello (wrapper)", 0);
  681.   __pyx_r = __pyx_pf_5hello_say_hello(__pyx_self, ((PyObject *)__pyx_v_name));
  682.  
  683.   /* function exit code */
  684.   __Pyx_RefNannyFinishContext();
  685.   return __pyx_r;
  686. }
  687.  
  688. static PyObject *__pyx_pf_5hello_say_hello(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  689.   PyObject *__pyx_r = NULL;
  690.   __Pyx_RefNannyDeclarations
  691.   PyObject *__pyx_t_1 = NULL;
  692.   PyObject *__pyx_t_2 = NULL;
  693.   PyObject *__pyx_t_3 = NULL;
  694.   PyObject *__pyx_t_4 = NULL;
  695.   __Pyx_RefNannySetupContext("say_hello", 0);
  696.  
  697.   /* "hello.pyx":2
  698.  * def say_hello(name):
  699.  *     print('Hi, {}'.format(name))             # <<<<<<<<<<<<<<
  700.  */
  701.   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Hi, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
  702.   __Pyx_GOTREF(__pyx_t_2);
  703.   __pyx_t_3 = NULL;
  704.   if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
  705.     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  706.     if (likely(__pyx_t_3)) {
  707.       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  708.       __Pyx_INCREF(__pyx_t_3);
  709.       __Pyx_INCREF(function);
  710.       __Pyx_DECREF_SET(__pyx_t_2, function);
  711.     }
  712.   }
  713.   if (!__pyx_t_3) {
  714.     __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  715.     __Pyx_GOTREF(__pyx_t_1);
  716.   } else {
  717.     __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2, __pyx_L1_error)
  718.     __Pyx_GOTREF(__pyx_t_4);
  719.     __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
  720.     __Pyx_INCREF(__pyx_v_name);
  721.     __Pyx_GIVEREF(__pyx_v_name);
  722.     PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_name);
  723.     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  724.     __Pyx_GOTREF(__pyx_t_1);
  725.     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  726.   }
  727.   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  728.   if (__Pyx_PrintOne(0, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
  729.   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  730.  
  731.   /* "hello.pyx":1
  732.  * def say_hello(name):             # <<<<<<<<<<<<<<
  733.  *     print('Hi, {}'.format(name))
  734.  */
  735.  
  736.   /* function exit code */
  737.   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  738.   goto __pyx_L0;
  739.   __pyx_L1_error:;
  740.   __Pyx_XDECREF(__pyx_t_1);
  741.   __Pyx_XDECREF(__pyx_t_2);
  742.   __Pyx_XDECREF(__pyx_t_3);
  743.   __Pyx_XDECREF(__pyx_t_4);
  744.   __Pyx_AddTraceback("hello.say_hello", __pyx_clineno, __pyx_lineno, __pyx_filename);
  745.   __pyx_r = NULL;
  746.   __pyx_L0:;
  747.   __Pyx_XGIVEREF(__pyx_r);
  748.   __Pyx_RefNannyFinishContext();
  749.   return __pyx_r;
  750. }
  751.  
  752. static PyMethodDef __pyx_methods[] = {
  753.   {0, 0, 0, 0}
  754. };
  755.  
  756. #if PY_MAJOR_VERSION >= 3
  757. static struct PyModuleDef __pyx_moduledef = {
  758.   #if PY_VERSION_HEX < 0x03020000
  759.     { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  760.   #else
  761.     PyModuleDef_HEAD_INIT,
  762.   #endif
  763.     "hello",
  764.     0, /* m_doc */
  765.     -1, /* m_size */
  766.     __pyx_methods /* m_methods */,
  767.     NULL, /* m_reload */
  768.     NULL, /* m_traverse */
  769.     NULL, /* m_clear */
  770.     NULL /* m_free */
  771. };
  772. #endif
  773.  
  774. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  775.   {&__pyx_kp_s_C_Users_Tom_Desktop_hello_pyx, __pyx_k_C_Users_Tom_Desktop_hello_pyx, sizeof(__pyx_k_C_Users_Tom_Desktop_hello_pyx), 0, 0, 1, 0},
  776.   {&__pyx_kp_s_Hi, __pyx_k_Hi, sizeof(__pyx_k_Hi), 0, 0, 1, 0},
  777.   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  778.   {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  779.   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  780.   {&__pyx_n_s_hello, __pyx_k_hello, sizeof(__pyx_k_hello), 0, 0, 1, 1},
  781.   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  782.   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  783.   {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  784.   {&__pyx_n_s_say_hello, __pyx_k_say_hello, sizeof(__pyx_k_say_hello), 0, 0, 1, 1},
  785.   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  786.   {0, 0, 0, 0, 0, 0, 0}
  787. };
  788. static int __Pyx_InitCachedBuiltins(void) {
  789.   return 0;
  790. }
  791.  
  792. static int __Pyx_InitCachedConstants(void) {
  793.   __Pyx_RefNannyDeclarations
  794.   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  795.  
  796.   /* "hello.pyx":1
  797.  * def say_hello(name):             # <<<<<<<<<<<<<<
  798.  *     print('Hi, {}'.format(name))
  799.  */
  800.   __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 1, __pyx_L1_error)
  801.   __Pyx_GOTREF(__pyx_tuple_);
  802.   __Pyx_GIVEREF(__pyx_tuple_);
  803.   __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_Users_Tom_Desktop_hello_pyx, __pyx_n_s_say_hello, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 1, __pyx_L1_error)
  804.   __Pyx_RefNannyFinishContext();
  805.   return 0;
  806.   __pyx_L1_error:;
  807.   __Pyx_RefNannyFinishContext();
  808.   return -1;
  809. }
  810.  
  811. static int __Pyx_InitGlobals(void) {
  812.   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  813.   return 0;
  814.   __pyx_L1_error:;
  815.   return -1;
  816. }
  817.  
  818. #if PY_MAJOR_VERSION < 3
  819. PyMODINIT_FUNC inithello(void); /*proto*/
  820. PyMODINIT_FUNC inithello(void)
  821. #else
  822. PyMODINIT_FUNC PyInit_hello(void); /*proto*/
  823. PyMODINIT_FUNC PyInit_hello(void)
  824. #endif
  825. {
  826.   PyObject *__pyx_t_1 = NULL;
  827.   __Pyx_RefNannyDeclarations
  828.   #if CYTHON_REFNANNY
  829.   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  830.   if (!__Pyx_RefNanny) {
  831.       PyErr_Clear();
  832.       __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  833.       if (!__Pyx_RefNanny)
  834.           Py_FatalError("failed to import 'refnanny' module");
  835.   }
  836.   #endif
  837.   __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_hello(void)", 0);
  838.   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  839.   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  840.   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  841.   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  842.   #ifdef __Pyx_CyFunction_USED
  843.   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  844.   #endif
  845.   #ifdef __Pyx_FusedFunction_USED
  846.   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  847.   #endif
  848.   #ifdef __Pyx_Coroutine_USED
  849.   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  850.   #endif
  851.   #ifdef __Pyx_Generator_USED
  852.   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  853.   #endif
  854.   #ifdef __Pyx_StopAsyncIteration_USED
  855.   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  856.   #endif
  857.   /*--- Library function declarations ---*/
  858.   /*--- Threads initialization code ---*/
  859.   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  860.   #ifdef WITH_THREAD /* Python build with threading support? */
  861.   PyEval_InitThreads();
  862.   #endif
  863.   #endif
  864.   /*--- Module creation code ---*/
  865.   #if PY_MAJOR_VERSION < 3
  866.   __pyx_m = Py_InitModule4("hello", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  867.   #else
  868.   __pyx_m = PyModule_Create(&__pyx_moduledef);
  869.   #endif
  870.   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  871.   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  872.   Py_INCREF(__pyx_d);
  873.   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  874.   #if CYTHON_COMPILING_IN_PYPY
  875.   Py_INCREF(__pyx_b);
  876.   #endif
  877.   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  878.   /*--- Initialize various global constants etc. ---*/
  879.   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  880.   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  881.   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  882.   #endif
  883.   if (__pyx_module_is_main_hello) {
  884.     if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  885.   }
  886.   #if PY_MAJOR_VERSION >= 3
  887.   {
  888.     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  889.     if (!PyDict_GetItemString(modules, "hello")) {
  890.       if (unlikely(PyDict_SetItemString(modules, "hello", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  891.     }
  892.   }
  893.   #endif
  894.   /*--- Builtin init code ---*/
  895.   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  896.   /*--- Constants init code ---*/
  897.   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  898.   /*--- Global init code ---*/
  899.   /*--- Variable export code ---*/
  900.   /*--- Function export code ---*/
  901.   /*--- Type init code ---*/
  902.   /*--- Type import code ---*/
  903.   /*--- Variable import code ---*/
  904.   /*--- Function import code ---*/
  905.   /*--- Execution code ---*/
  906.   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  907.   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  908.   #endif
  909.  
  910.   /* "hello.pyx":1
  911.  * def say_hello(name):             # <<<<<<<<<<<<<<
  912.  *     print('Hi, {}'.format(name))
  913.  */
  914.   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5hello_1say_hello, NULL, __pyx_n_s_hello); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  915.   __Pyx_GOTREF(__pyx_t_1);
  916.   if (PyDict_SetItem(__pyx_d, __pyx_n_s_say_hello, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  917.   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  918.   __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  919.   __Pyx_GOTREF(__pyx_t_1);
  920.   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  921.   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  922.  
  923.   /*--- Wrapped vars code ---*/
  924.  
  925.   goto __pyx_L0;
  926.   __pyx_L1_error:;
  927.   __Pyx_XDECREF(__pyx_t_1);
  928.   if (__pyx_m) {
  929.     if (__pyx_d) {
  930.       __Pyx_AddTraceback("init hello", __pyx_clineno, __pyx_lineno, __pyx_filename);
  931.     }
  932.     Py_DECREF(__pyx_m); __pyx_m = 0;
  933.   } else if (!PyErr_Occurred()) {
  934.     PyErr_SetString(PyExc_ImportError, "init hello");
  935.   }
  936.   __pyx_L0:;
  937.   __Pyx_RefNannyFinishContext();
  938.   #if PY_MAJOR_VERSION < 3
  939.   return;
  940.   #else
  941.   return __pyx_m;
  942.   #endif
  943. }
  944.  
  945. /* --- Runtime support code --- */
  946. /* Refnanny */
  947. #if CYTHON_REFNANNY
  948. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  949.     PyObject *m = NULL, *p = NULL;
  950.     void *r = NULL;
  951.     m = PyImport_ImportModule((char *)modname);
  952.     if (!m) goto end;
  953.     p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  954.     if (!p) goto end;
  955.     r = PyLong_AsVoidPtr(p);
  956. end:
  957.     Py_XDECREF(p);
  958.     Py_XDECREF(m);
  959.     return (__Pyx_RefNannyAPIStruct *)r;
  960. }
  961. #endif
  962.  
  963. /* PyObjectCall */
  964. #if CYTHON_COMPILING_IN_CPYTHON
  965. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  966.     PyObject *result;
  967.     ternaryfunc call = func->ob_type->tp_call;
  968.     if (unlikely(!call))
  969.         return PyObject_Call(func, arg, kw);
  970.     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  971.         return NULL;
  972.     result = (*call)(func, arg, kw);
  973.     Py_LeaveRecursiveCall();
  974.     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  975.         PyErr_SetString(
  976.             PyExc_SystemError,
  977.             "NULL result without error in PyObject_Call");
  978.     }
  979.     return result;
  980. }
  981. #endif
  982.  
  983. /* PyObjectCallMethO */
  984. #if CYTHON_COMPILING_IN_CPYTHON
  985. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  986.     PyObject *self, *result;
  987.     PyCFunction cfunc;
  988.     cfunc = PyCFunction_GET_FUNCTION(func);
  989.     self = PyCFunction_GET_SELF(func);
  990.     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  991.         return NULL;
  992.     result = cfunc(self, arg);
  993.     Py_LeaveRecursiveCall();
  994.     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  995.         PyErr_SetString(
  996.             PyExc_SystemError,
  997.             "NULL result without error in PyObject_Call");
  998.     }
  999.     return result;
  1000. }
  1001. #endif
  1002.  
  1003. /* PyObjectCallOneArg */
  1004. #if CYTHON_COMPILING_IN_CPYTHON
  1005. static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  1006.     PyObject *result;
  1007.     PyObject *args = PyTuple_New(1);
  1008.     if (unlikely(!args)) return NULL;
  1009.     Py_INCREF(arg);
  1010.     PyTuple_SET_ITEM(args, 0, arg);
  1011.     result = __Pyx_PyObject_Call(func, args, NULL);
  1012.     Py_DECREF(args);
  1013.     return result;
  1014. }
  1015. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  1016. #ifdef __Pyx_CyFunction_USED
  1017.     if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
  1018. #else
  1019.     if (likely(PyCFunction_Check(func))) {
  1020. #endif
  1021.         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
  1022.             return __Pyx_PyObject_CallMethO(func, arg);
  1023.         }
  1024.     }
  1025.     return __Pyx__PyObject_CallOneArg(func, arg);
  1026. }
  1027. #else
  1028. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  1029.     PyObject *result;
  1030.     PyObject *args = PyTuple_Pack(1, arg);
  1031.     if (unlikely(!args)) return NULL;
  1032.     result = __Pyx_PyObject_Call(func, args, NULL);
  1033.     Py_DECREF(args);
  1034.     return result;
  1035. }
  1036. #endif
  1037.  
  1038. /* CodeObjectCache */
  1039.   static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  1040.     int start = 0, mid = 0, end = count - 1;
  1041.     if (end >= 0 && code_line > entries[end].code_line) {
  1042.         return count;
  1043.     }
  1044.     while (start < end) {
  1045.         mid = start + (end - start) / 2;
  1046.         if (code_line < entries[mid].code_line) {
  1047.             end = mid;
  1048.         } else if (code_line > entries[mid].code_line) {
  1049.              start = mid + 1;
  1050.         } else {
  1051.             return mid;
  1052.         }
  1053.     }
  1054.     if (code_line <= entries[mid].code_line) {
  1055.         return mid;
  1056.     } else {
  1057.         return mid + 1;
  1058.     }
  1059. }
  1060. static PyCodeObject *__pyx_find_code_object(int code_line) {
  1061.     PyCodeObject* code_object;
  1062.     int pos;
  1063.     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  1064.         return NULL;
  1065.     }
  1066.     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  1067.     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  1068.         return NULL;
  1069.     }
  1070.     code_object = __pyx_code_cache.entries[pos].code_object;
  1071.     Py_INCREF(code_object);
  1072.     return code_object;
  1073. }
  1074. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  1075.     int pos, i;
  1076.     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  1077.     if (unlikely(!code_line)) {
  1078.         return;
  1079.     }
  1080.     if (unlikely(!entries)) {
  1081.         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  1082.         if (likely(entries)) {
  1083.             __pyx_code_cache.entries = entries;
  1084.             __pyx_code_cache.max_count = 64;
  1085.             __pyx_code_cache.count = 1;
  1086.             entries[0].code_line = code_line;
  1087.             entries[0].code_object = code_object;
  1088.             Py_INCREF(code_object);
  1089.         }
  1090.         return;
  1091.     }
  1092.     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  1093.     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  1094.         PyCodeObject* tmp = entries[pos].code_object;
  1095.         entries[pos].code_object = code_object;
  1096.         Py_DECREF(tmp);
  1097.         return;
  1098.     }
  1099.     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  1100.         int new_max = __pyx_code_cache.max_count + 64;
  1101.         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  1102.             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  1103.         if (unlikely(!entries)) {
  1104.             return;
  1105.         }
  1106.         __pyx_code_cache.entries = entries;
  1107.         __pyx_code_cache.max_count = new_max;
  1108.     }
  1109.     for (i=__pyx_code_cache.count; i>pos; i--) {
  1110.         entries[i] = entries[i-1];
  1111.     }
  1112.     entries[pos].code_line = code_line;
  1113.     entries[pos].code_object = code_object;
  1114.     __pyx_code_cache.count++;
  1115.     Py_INCREF(code_object);
  1116. }
  1117.  
  1118. /* AddTraceback */
  1119.   #include "compile.h"
  1120. #include "frameobject.h"
  1121. #include "traceback.h"
  1122. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  1123.             const char *funcname, int c_line,
  1124.             int py_line, const char *filename) {
  1125.     PyCodeObject *py_code = 0;
  1126.     PyObject *py_srcfile = 0;
  1127.     PyObject *py_funcname = 0;
  1128.     #if PY_MAJOR_VERSION < 3
  1129.     py_srcfile = PyString_FromString(filename);
  1130.     #else
  1131.     py_srcfile = PyUnicode_FromString(filename);
  1132.     #endif
  1133.     if (!py_srcfile) goto bad;
  1134.     if (c_line) {
  1135.         #if PY_MAJOR_VERSION < 3
  1136.         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  1137.         #else
  1138.         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  1139.         #endif
  1140.     }
  1141.     else {
  1142.         #if PY_MAJOR_VERSION < 3
  1143.         py_funcname = PyString_FromString(funcname);
  1144.         #else
  1145.         py_funcname = PyUnicode_FromString(funcname);
  1146.         #endif
  1147.     }
  1148.     if (!py_funcname) goto bad;
  1149.     py_code = __Pyx_PyCode_New(
  1150.         0,
  1151.         0,
  1152.         0,
  1153.         0,
  1154.         0,
  1155.         __pyx_empty_bytes, /*PyObject *code,*/
  1156.         __pyx_empty_tuple, /*PyObject *consts,*/
  1157.         __pyx_empty_tuple, /*PyObject *names,*/
  1158.         __pyx_empty_tuple, /*PyObject *varnames,*/
  1159.         __pyx_empty_tuple, /*PyObject *freevars,*/
  1160.         __pyx_empty_tuple, /*PyObject *cellvars,*/
  1161.         py_srcfile,   /*PyObject *filename,*/
  1162.         py_funcname,  /*PyObject *name,*/
  1163.         py_line,
  1164.         __pyx_empty_bytes  /*PyObject *lnotab*/
  1165.     );
  1166.     Py_DECREF(py_srcfile);
  1167.     Py_DECREF(py_funcname);
  1168.     return py_code;
  1169. bad:
  1170.     Py_XDECREF(py_srcfile);
  1171.     Py_XDECREF(py_funcname);
  1172.     return NULL;
  1173. }
  1174. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1175.                                int py_line, const char *filename) {
  1176.     PyCodeObject *py_code = 0;
  1177.     PyFrameObject *py_frame = 0;
  1178.     py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  1179.     if (!py_code) {
  1180.         py_code = __Pyx_CreateCodeObjectForTraceback(
  1181.             funcname, c_line, py_line, filename);
  1182.         if (!py_code) goto bad;
  1183.         __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  1184.     }
  1185.     py_frame = PyFrame_New(
  1186.         PyThreadState_GET(), /*PyThreadState *tstate,*/
  1187.         py_code,             /*PyCodeObject *code,*/
  1188.         __pyx_d,      /*PyObject *globals,*/
  1189.         0                    /*PyObject *locals*/
  1190.     );
  1191.     if (!py_frame) goto bad;
  1192.     py_frame->f_lineno = py_line;
  1193.     PyTraceBack_Here(py_frame);
  1194. bad:
  1195.     Py_XDECREF(py_code);
  1196.     Py_XDECREF(py_frame);
  1197. }
  1198.  
  1199. /* Print */
  1200.   #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
  1201. static PyObject *__Pyx_GetStdout(void) {
  1202.     PyObject *f = PySys_GetObject((char *)"stdout");
  1203.     if (!f) {
  1204.         PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
  1205.     }
  1206.     return f;
  1207. }
  1208. static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
  1209.     int i;
  1210.     if (!f) {
  1211.         if (!(f = __Pyx_GetStdout()))
  1212.             return -1;
  1213.     }
  1214.     Py_INCREF(f);
  1215.     for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
  1216.         PyObject* v;
  1217.         if (PyFile_SoftSpace(f, 1)) {
  1218.             if (PyFile_WriteString(" ", f) < 0)
  1219.                 goto error;
  1220.         }
  1221.         v = PyTuple_GET_ITEM(arg_tuple, i);
  1222.         if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
  1223.             goto error;
  1224.         if (PyString_Check(v)) {
  1225.             char *s = PyString_AsString(v);
  1226.             Py_ssize_t len = PyString_Size(v);
  1227.             if (len > 0) {
  1228.                 switch (s[len-1]) {
  1229.                     case ' ': break;
  1230.                     case '\f': case '\r': case '\n': case '\t': case '\v':
  1231.                         PyFile_SoftSpace(f, 0);
  1232.                         break;
  1233.                     default:  break;
  1234.                 }
  1235.             }
  1236.         }
  1237.     }
  1238.     if (newline) {
  1239.         if (PyFile_WriteString("\n", f) < 0)
  1240.             goto error;
  1241.         PyFile_SoftSpace(f, 0);
  1242.     }
  1243.     Py_DECREF(f);
  1244.     return 0;
  1245. error:
  1246.     Py_DECREF(f);
  1247.     return -1;
  1248. }
  1249. #else
  1250. static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
  1251.     PyObject* kwargs = 0;
  1252.     PyObject* result = 0;
  1253.     PyObject* end_string;
  1254.     if (unlikely(!__pyx_print)) {
  1255.         __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
  1256.         if (!__pyx_print)
  1257.             return -1;
  1258.     }
  1259.     if (stream) {
  1260.         kwargs = PyDict_New();
  1261.         if (unlikely(!kwargs))
  1262.             return -1;
  1263.         if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
  1264.             goto bad;
  1265.         if (!newline) {
  1266.             end_string = PyUnicode_FromStringAndSize(" ", 1);
  1267.             if (unlikely(!end_string))
  1268.                 goto bad;
  1269.             if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
  1270.                 Py_DECREF(end_string);
  1271.                 goto bad;
  1272.             }
  1273.             Py_DECREF(end_string);
  1274.         }
  1275.     } else if (!newline) {
  1276.         if (unlikely(!__pyx_print_kwargs)) {
  1277.             __pyx_print_kwargs = PyDict_New();
  1278.             if (unlikely(!__pyx_print_kwargs))
  1279.                 return -1;
  1280.             end_string = PyUnicode_FromStringAndSize(" ", 1);
  1281.             if (unlikely(!end_string))
  1282.                 return -1;
  1283.             if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
  1284.                 Py_DECREF(end_string);
  1285.                 return -1;
  1286.             }
  1287.             Py_DECREF(end_string);
  1288.         }
  1289.         kwargs = __pyx_print_kwargs;
  1290.     }
  1291.     result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
  1292.     if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
  1293.         Py_DECREF(kwargs);
  1294.     if (!result)
  1295.         return -1;
  1296.     Py_DECREF(result);
  1297.     return 0;
  1298. bad:
  1299.     if (kwargs != __pyx_print_kwargs)
  1300.         Py_XDECREF(kwargs);
  1301.     return -1;
  1302. }
  1303. #endif
  1304.  
  1305. /* PrintOne */
  1306.   #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
  1307. static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
  1308.     if (!f) {
  1309.         if (!(f = __Pyx_GetStdout()))
  1310.             return -1;
  1311.     }
  1312.     Py_INCREF(f);
  1313.     if (PyFile_SoftSpace(f, 0)) {
  1314.         if (PyFile_WriteString(" ", f) < 0)
  1315.             goto error;
  1316.     }
  1317.     if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
  1318.         goto error;
  1319.     if (PyFile_WriteString("\n", f) < 0)
  1320.         goto error;
  1321.     Py_DECREF(f);
  1322.     return 0;
  1323. error:
  1324.     Py_DECREF(f);
  1325.     return -1;
  1326.     /* the line below is just to avoid C compiler
  1327.      * warnings about unused functions */
  1328.     return __Pyx_Print(f, NULL, 0);
  1329. }
  1330. #else
  1331. static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
  1332.     int res;
  1333.     PyObject* arg_tuple = PyTuple_Pack(1, o);
  1334.     if (unlikely(!arg_tuple))
  1335.         return -1;
  1336.     res = __Pyx_Print(stream, arg_tuple, 1);
  1337.     Py_DECREF(arg_tuple);
  1338.     return res;
  1339. }
  1340. #endif
  1341.  
  1342. /* CIntToPy */
  1343.   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  1344.     const long neg_one = (long) -1, const_zero = (long) 0;
  1345.     const int is_unsigned = neg_one > const_zero;
  1346.     if (is_unsigned) {
  1347.         if (sizeof(long) < sizeof(long)) {
  1348.             return PyInt_FromLong((long) value);
  1349.         } else if (sizeof(long) <= sizeof(unsigned long)) {
  1350.             return PyLong_FromUnsignedLong((unsigned long) value);
  1351.         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  1352.             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  1353.         }
  1354.     } else {
  1355.         if (sizeof(long) <= sizeof(long)) {
  1356.             return PyInt_FromLong((long) value);
  1357.         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  1358.             return PyLong_FromLongLong((PY_LONG_LONG) value);
  1359.         }
  1360.     }
  1361.     {
  1362.         int one = 1; int little = (int)*(unsigned char *)&one;
  1363.         unsigned char *bytes = (unsigned char *)&value;
  1364.         return _PyLong_FromByteArray(bytes, sizeof(long),
  1365.                                      little, !is_unsigned);
  1366.     }
  1367. }
  1368.  
  1369. /* CIntFromPyVerify */
  1370.   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  1371.     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  1372. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  1373.     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  1374. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  1375.     {\
  1376.         func_type value = func_value;\
  1377.         if (sizeof(target_type) < sizeof(func_type)) {\
  1378.             if (unlikely(value != (func_type) (target_type) value)) {\
  1379.                 func_type zero = 0;\
  1380.                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  1381.                     return (target_type) -1;\
  1382.                 if (is_unsigned && unlikely(value < zero))\
  1383.                     goto raise_neg_overflow;\
  1384.                 else\
  1385.                     goto raise_overflow;\
  1386.             }\
  1387.         }\
  1388.         return (target_type) value;\
  1389.     }
  1390.  
  1391. /* CIntFromPy */
  1392.   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  1393.     const long neg_one = (long) -1, const_zero = (long) 0;
  1394.     const int is_unsigned = neg_one > const_zero;
  1395. #if PY_MAJOR_VERSION < 3
  1396.     if (likely(PyInt_Check(x))) {
  1397.         if (sizeof(long) < sizeof(long)) {
  1398.             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  1399.         } else {
  1400.             long val = PyInt_AS_LONG(x);
  1401.             if (is_unsigned && unlikely(val < 0)) {
  1402.                 goto raise_neg_overflow;
  1403.             }
  1404.             return (long) val;
  1405.         }
  1406.     } else
  1407. #endif
  1408.     if (likely(PyLong_Check(x))) {
  1409.         if (is_unsigned) {
  1410. #if CYTHON_USE_PYLONG_INTERNALS
  1411.             const digit* digits = ((PyLongObject*)x)->ob_digit;
  1412.             switch (Py_SIZE(x)) {
  1413.                 case  0: return (long) 0;
  1414.                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
  1415.                 case 2:
  1416.                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  1417.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  1418.                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1419.                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
  1420.                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  1421.                         }
  1422.                     }
  1423.                     break;
  1424.                 case 3:
  1425.                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  1426.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  1427.                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1428.                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
  1429.                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  1430.                         }
  1431.                     }
  1432.                     break;
  1433.                 case 4:
  1434.                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  1435.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  1436.                             __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])))
  1437.                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
  1438.                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  1439.                         }
  1440.                     }
  1441.                     break;
  1442.             }
  1443. #endif
  1444. #if CYTHON_COMPILING_IN_CPYTHON
  1445.             if (unlikely(Py_SIZE(x) < 0)) {
  1446.                 goto raise_neg_overflow;
  1447.             }
  1448. #else
  1449.             {
  1450.                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  1451.                 if (unlikely(result < 0))
  1452.                     return (long) -1;
  1453.                 if (unlikely(result == 1))
  1454.                     goto raise_neg_overflow;
  1455.             }
  1456. #endif
  1457.             if (sizeof(long) <= sizeof(unsigned long)) {
  1458.                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  1459.             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  1460.                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  1461.             }
  1462.         } else {
  1463. #if CYTHON_USE_PYLONG_INTERNALS
  1464.             const digit* digits = ((PyLongObject*)x)->ob_digit;
  1465.             switch (Py_SIZE(x)) {
  1466.                 case  0: return (long) 0;
  1467.                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
  1468.                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
  1469.                 case -2:
  1470.                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
  1471.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  1472.                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1473.                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  1474.                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  1475.                         }
  1476.                     }
  1477.                     break;
  1478.                 case 2:
  1479.                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  1480.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  1481.                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1482.                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  1483.                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  1484.                         }
  1485.                     }
  1486.                     break;
  1487.                 case -3:
  1488.                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  1489.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  1490.                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1491.                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  1492.                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  1493.                         }
  1494.                     }
  1495.                     break;
  1496.                 case 3:
  1497.                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  1498.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  1499.                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1500.                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  1501.                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  1502.                         }
  1503.                     }
  1504.                     break;
  1505.                 case -4:
  1506.                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  1507.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  1508.                             __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])))
  1509.                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  1510.                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  1511.                         }
  1512.                     }
  1513.                     break;
  1514.                 case 4:
  1515.                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  1516.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  1517.                             __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])))
  1518.                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  1519.                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  1520.                         }
  1521.                     }
  1522.                     break;
  1523.             }
  1524. #endif
  1525.             if (sizeof(long) <= sizeof(long)) {
  1526.                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  1527.             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  1528.                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  1529.             }
  1530.         }
  1531.         {
  1532. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  1533.             PyErr_SetString(PyExc_RuntimeError,
  1534.                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  1535. #else
  1536.             long val;
  1537.             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  1538.  #if PY_MAJOR_VERSION < 3
  1539.             if (likely(v) && !PyLong_Check(v)) {
  1540.                 PyObject *tmp = v;
  1541.                 v = PyNumber_Long(tmp);
  1542.                 Py_DECREF(tmp);
  1543.             }
  1544.  #endif
  1545.             if (likely(v)) {
  1546.                 int one = 1; int is_little = (int)*(unsigned char *)&one;
  1547.                 unsigned char *bytes = (unsigned char *)&val;
  1548.                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
  1549.                                               bytes, sizeof(val),
  1550.                                               is_little, !is_unsigned);
  1551.                 Py_DECREF(v);
  1552.                 if (likely(!ret))
  1553.                     return val;
  1554.             }
  1555. #endif
  1556.             return (long) -1;
  1557.         }
  1558.     } else {
  1559.         long val;
  1560.         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  1561.         if (!tmp) return (long) -1;
  1562.         val = __Pyx_PyInt_As_long(tmp);
  1563.         Py_DECREF(tmp);
  1564.         return val;
  1565.     }
  1566. raise_overflow:
  1567.     PyErr_SetString(PyExc_OverflowError,
  1568.         "value too large to convert to long");
  1569.     return (long) -1;
  1570. raise_neg_overflow:
  1571.     PyErr_SetString(PyExc_OverflowError,
  1572.         "can't convert negative value to long");
  1573.     return (long) -1;
  1574. }
  1575.  
  1576. /* CIntFromPy */
  1577.   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  1578.     const int neg_one = (int) -1, const_zero = (int) 0;
  1579.     const int is_unsigned = neg_one > const_zero;
  1580. #if PY_MAJOR_VERSION < 3
  1581.     if (likely(PyInt_Check(x))) {
  1582.         if (sizeof(int) < sizeof(long)) {
  1583.             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  1584.         } else {
  1585.             long val = PyInt_AS_LONG(x);
  1586.             if (is_unsigned && unlikely(val < 0)) {
  1587.                 goto raise_neg_overflow;
  1588.             }
  1589.             return (int) val;
  1590.         }
  1591.     } else
  1592. #endif
  1593.     if (likely(PyLong_Check(x))) {
  1594.         if (is_unsigned) {
  1595. #if CYTHON_USE_PYLONG_INTERNALS
  1596.             const digit* digits = ((PyLongObject*)x)->ob_digit;
  1597.             switch (Py_SIZE(x)) {
  1598.                 case  0: return (int) 0;
  1599.                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
  1600.                 case 2:
  1601.                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  1602.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  1603.                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1604.                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
  1605.                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  1606.                         }
  1607.                     }
  1608.                     break;
  1609.                 case 3:
  1610.                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  1611.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  1612.                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1613.                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
  1614.                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  1615.                         }
  1616.                     }
  1617.                     break;
  1618.                 case 4:
  1619.                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  1620.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  1621.                             __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])))
  1622.                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
  1623.                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  1624.                         }
  1625.                     }
  1626.                     break;
  1627.             }
  1628. #endif
  1629. #if CYTHON_COMPILING_IN_CPYTHON
  1630.             if (unlikely(Py_SIZE(x) < 0)) {
  1631.                 goto raise_neg_overflow;
  1632.             }
  1633. #else
  1634.             {
  1635.                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  1636.                 if (unlikely(result < 0))
  1637.                     return (int) -1;
  1638.                 if (unlikely(result == 1))
  1639.                     goto raise_neg_overflow;
  1640.             }
  1641. #endif
  1642.             if (sizeof(int) <= sizeof(unsigned long)) {
  1643.                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  1644.             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  1645.                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  1646.             }
  1647.         } else {
  1648. #if CYTHON_USE_PYLONG_INTERNALS
  1649.             const digit* digits = ((PyLongObject*)x)->ob_digit;
  1650.             switch (Py_SIZE(x)) {
  1651.                 case  0: return (int) 0;
  1652.                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
  1653.                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
  1654.                 case -2:
  1655.                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
  1656.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  1657.                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1658.                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  1659.                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  1660.                         }
  1661.                     }
  1662.                     break;
  1663.                 case 2:
  1664.                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  1665.                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  1666.                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1667.                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  1668.                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  1669.                         }
  1670.                     }
  1671.                     break;
  1672.                 case -3:
  1673.                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  1674.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  1675.                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1676.                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  1677.                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  1678.                         }
  1679.                     }
  1680.                     break;
  1681.                 case 3:
  1682.                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  1683.                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  1684.                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  1685.                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  1686.                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  1687.                         }
  1688.                     }
  1689.                     break;
  1690.                 case -4:
  1691.                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  1692.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  1693.                             __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])))
  1694.                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  1695.                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  1696.                         }
  1697.                     }
  1698.                     break;
  1699.                 case 4:
  1700.                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  1701.                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  1702.                             __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])))
  1703.                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  1704.                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  1705.                         }
  1706.                     }
  1707.                     break;
  1708.             }
  1709. #endif
  1710.             if (sizeof(int) <= sizeof(long)) {
  1711.                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  1712.             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  1713.                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  1714.             }
  1715.         }
  1716.         {
  1717. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  1718.             PyErr_SetString(PyExc_RuntimeError,
  1719.                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  1720. #else
  1721.             int val;
  1722.             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  1723.  #if PY_MAJOR_VERSION < 3
  1724.             if (likely(v) && !PyLong_Check(v)) {
  1725.                 PyObject *tmp = v;
  1726.                 v = PyNumber_Long(tmp);
  1727.                 Py_DECREF(tmp);
  1728.             }
  1729.  #endif
  1730.             if (likely(v)) {
  1731.                 int one = 1; int is_little = (int)*(unsigned char *)&one;
  1732.                 unsigned char *bytes = (unsigned char *)&val;
  1733.                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
  1734.                                               bytes, sizeof(val),
  1735.                                               is_little, !is_unsigned);
  1736.                 Py_DECREF(v);
  1737.                 if (likely(!ret))
  1738.                     return val;
  1739.             }
  1740. #endif
  1741.             return (int) -1;
  1742.         }
  1743.     } else {
  1744.         int val;
  1745.         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  1746.         if (!tmp) return (int) -1;
  1747.         val = __Pyx_PyInt_As_int(tmp);
  1748.         Py_DECREF(tmp);
  1749.         return val;
  1750.     }
  1751. raise_overflow:
  1752.     PyErr_SetString(PyExc_OverflowError,
  1753.         "value too large to convert to int");
  1754.     return (int) -1;
  1755. raise_neg_overflow:
  1756.     PyErr_SetString(PyExc_OverflowError,
  1757.         "can't convert negative value to int");
  1758.     return (int) -1;
  1759. }
  1760.  
  1761. /* CheckBinaryVersion */
  1762.   static int __Pyx_check_binary_version(void) {
  1763.     char ctversion[4], rtversion[4];
  1764.     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  1765.     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  1766.     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  1767.         char message[200];
  1768.         PyOS_snprintf(message, sizeof(message),
  1769.                       "compiletime version %s of module '%.100s' "
  1770.                       "does not match runtime version %s",
  1771.                       ctversion, __Pyx_MODULE_NAME, rtversion);
  1772.         return PyErr_WarnEx(NULL, message, 1);
  1773.     }
  1774.     return 0;
  1775. }
  1776.  
  1777. /* InitStrings */
  1778.   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  1779.     while (t->p) {
  1780.         #if PY_MAJOR_VERSION < 3
  1781.         if (t->is_unicode) {
  1782.             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  1783.         } else if (t->intern) {
  1784.             *t->p = PyString_InternFromString(t->s);
  1785.         } else {
  1786.             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  1787.         }
  1788.         #else
  1789.         if (t->is_unicode | t->is_str) {
  1790.             if (t->intern) {
  1791.                 *t->p = PyUnicode_InternFromString(t->s);
  1792.             } else if (t->encoding) {
  1793.                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  1794.             } else {
  1795.                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  1796.             }
  1797.         } else {
  1798.             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  1799.         }
  1800.         #endif
  1801.         if (!*t->p)
  1802.             return -1;
  1803.         ++t;
  1804.     }
  1805.     return 0;
  1806. }
  1807.  
  1808. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  1809.     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
  1810. }
  1811. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  1812.     Py_ssize_t ignore;
  1813.     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  1814. }
  1815. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  1816. #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  1817.     if (
  1818. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  1819.             __Pyx_sys_getdefaultencoding_not_ascii &&
  1820. #endif
  1821.             PyUnicode_Check(o)) {
  1822. #if PY_VERSION_HEX < 0x03030000
  1823.         char* defenc_c;
  1824.         PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  1825.         if (!defenc) return NULL;
  1826.         defenc_c = PyBytes_AS_STRING(defenc);
  1827. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  1828.         {
  1829.             char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  1830.             char* c;
  1831.             for (c = defenc_c; c < end; c++) {
  1832.                 if ((unsigned char) (*c) >= 128) {
  1833.                     PyUnicode_AsASCIIString(o);
  1834.                     return NULL;
  1835.                 }
  1836.             }
  1837.         }
  1838. #endif
  1839.         *length = PyBytes_GET_SIZE(defenc);
  1840.         return defenc_c;
  1841. #else
  1842.         if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
  1843. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  1844.         if (PyUnicode_IS_ASCII(o)) {
  1845.             *length = PyUnicode_GET_LENGTH(o);
  1846.             return PyUnicode_AsUTF8(o);
  1847.         } else {
  1848.             PyUnicode_AsASCIIString(o);
  1849.             return NULL;
  1850.         }
  1851. #else
  1852.         return PyUnicode_AsUTF8AndSize(o, length);
  1853. #endif
  1854. #endif
  1855.     } else
  1856. #endif
  1857. #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  1858.     if (PyByteArray_Check(o)) {
  1859.         *length = PyByteArray_GET_SIZE(o);
  1860.         return PyByteArray_AS_STRING(o);
  1861.     } else
  1862. #endif
  1863.     {
  1864.         char* result;
  1865.         int r = PyBytes_AsStringAndSize(o, &result, length);
  1866.         if (unlikely(r < 0)) {
  1867.             return NULL;
  1868.         } else {
  1869.             return result;
  1870.         }
  1871.     }
  1872. }
  1873. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  1874.    int is_true = x == Py_True;
  1875.    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  1876.    else return PyObject_IsTrue(x);
  1877. }
  1878. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  1879.   PyNumberMethods *m;
  1880.   const char *name = NULL;
  1881.   PyObject *res = NULL;
  1882. #if PY_MAJOR_VERSION < 3
  1883.   if (PyInt_Check(x) || PyLong_Check(x))
  1884. #else
  1885.   if (PyLong_Check(x))
  1886. #endif
  1887.     return __Pyx_NewRef(x);
  1888.   m = Py_TYPE(x)->tp_as_number;
  1889. #if PY_MAJOR_VERSION < 3
  1890.   if (m && m->nb_int) {
  1891.     name = "int";
  1892.     res = PyNumber_Int(x);
  1893.   }
  1894.   else if (m && m->nb_long) {
  1895.     name = "long";
  1896.     res = PyNumber_Long(x);
  1897.   }
  1898. #else
  1899.   if (m && m->nb_int) {
  1900.     name = "int";
  1901.     res = PyNumber_Long(x);
  1902.   }
  1903. #endif
  1904.   if (res) {
  1905. #if PY_MAJOR_VERSION < 3
  1906.     if (!PyInt_Check(res) && !PyLong_Check(res)) {
  1907. #else
  1908.     if (!PyLong_Check(res)) {
  1909. #endif
  1910.       PyErr_Format(PyExc_TypeError,
  1911.                    "__%.4s__ returned non-%.4s (type %.200s)",
  1912.                    name, name, Py_TYPE(res)->tp_name);
  1913.       Py_DECREF(res);
  1914.       return NULL;
  1915.     }
  1916.   }
  1917.   else if (!PyErr_Occurred()) {
  1918.     PyErr_SetString(PyExc_TypeError,
  1919.                     "an integer is required");
  1920.   }
  1921.   return res;
  1922. }
  1923. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  1924.   Py_ssize_t ival;
  1925.   PyObject *x;
  1926. #if PY_MAJOR_VERSION < 3
  1927.   if (likely(PyInt_CheckExact(b))) {
  1928.     if (sizeof(Py_ssize_t) >= sizeof(long))
  1929.         return PyInt_AS_LONG(b);
  1930.     else
  1931.         return PyInt_AsSsize_t(x);
  1932.   }
  1933. #endif
  1934.   if (likely(PyLong_CheckExact(b))) {
  1935.     #if CYTHON_USE_PYLONG_INTERNALS
  1936.     const digit* digits = ((PyLongObject*)b)->ob_digit;
  1937.     const Py_ssize_t size = Py_SIZE(b);
  1938.     if (likely(__Pyx_sst_abs(size) <= 1)) {
  1939.         ival = likely(size) ? digits[0] : 0;
  1940.         if (size == -1) ival = -ival;
  1941.         return ival;
  1942.     } else {
  1943.       switch (size) {
  1944.          case 2:
  1945.            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  1946.              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  1947.            }
  1948.            break;
  1949.          case -2:
  1950.            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  1951.              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  1952.            }
  1953.            break;
  1954.          case 3:
  1955.            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  1956.              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  1957.            }
  1958.            break;
  1959.          case -3:
  1960.            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  1961.              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  1962.            }
  1963.            break;
  1964.          case 4:
  1965.            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  1966.              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]));
  1967.            }
  1968.            break;
  1969.          case -4:
  1970.            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  1971.              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]));
  1972.            }
  1973.            break;
  1974.       }
  1975.     }
  1976.     #endif
  1977.     return PyLong_AsSsize_t(b);
  1978.   }
  1979.   x = PyNumber_Index(b);
  1980.   if (!x) return -1;
  1981.   ival = PyInt_AsSsize_t(x);
  1982.   Py_DECREF(x);
  1983.   return ival;
  1984. }
  1985. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  1986.     return PyInt_FromSize_t(ival);
  1987. }
  1988.  
  1989.  
  1990. #endif /* Py_PYTHON_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement