You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5242 lines
200 KiB

4 years ago
  1. /* Generated by Cython 0.28.5 */
  2. /* BEGIN: Cython Metadata
  3. {
  4. "distutils": {
  5. "name": "aiohttp._helpers",
  6. "sources": [
  7. "aiohttp/_helpers.pyx"
  8. ]
  9. },
  10. "module_name": "aiohttp._helpers"
  11. }
  12. END: Cython Metadata */
  13. #define PY_SSIZE_T_CLEAN
  14. #include "Python.h"
  15. #ifndef Py_PYTHON_H
  16. #error Python headers needed to compile C extensions, please install development version of Python.
  17. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
  18. #error Cython requires Python 2.6+ or Python 3.3+.
  19. #else
  20. #define CYTHON_ABI "0_28_5"
  21. #define CYTHON_FUTURE_DIVISION 0
  22. #include <stddef.h>
  23. #ifndef offsetof
  24. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  25. #endif
  26. #if !defined(WIN32) && !defined(MS_WINDOWS)
  27. #ifndef __stdcall
  28. #define __stdcall
  29. #endif
  30. #ifndef __cdecl
  31. #define __cdecl
  32. #endif
  33. #ifndef __fastcall
  34. #define __fastcall
  35. #endif
  36. #endif
  37. #ifndef DL_IMPORT
  38. #define DL_IMPORT(t) t
  39. #endif
  40. #ifndef DL_EXPORT
  41. #define DL_EXPORT(t) t
  42. #endif
  43. #define __PYX_COMMA ,
  44. #ifndef HAVE_LONG_LONG
  45. #if PY_VERSION_HEX >= 0x02070000
  46. #define HAVE_LONG_LONG
  47. #endif
  48. #endif
  49. #ifndef PY_LONG_LONG
  50. #define PY_LONG_LONG LONG_LONG
  51. #endif
  52. #ifndef Py_HUGE_VAL
  53. #define Py_HUGE_VAL HUGE_VAL
  54. #endif
  55. #ifdef PYPY_VERSION
  56. #define CYTHON_COMPILING_IN_PYPY 1
  57. #define CYTHON_COMPILING_IN_PYSTON 0
  58. #define CYTHON_COMPILING_IN_CPYTHON 0
  59. #undef CYTHON_USE_TYPE_SLOTS
  60. #define CYTHON_USE_TYPE_SLOTS 0
  61. #undef CYTHON_USE_PYTYPE_LOOKUP
  62. #define CYTHON_USE_PYTYPE_LOOKUP 0
  63. #if PY_VERSION_HEX < 0x03050000
  64. #undef CYTHON_USE_ASYNC_SLOTS
  65. #define CYTHON_USE_ASYNC_SLOTS 0
  66. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  67. #define CYTHON_USE_ASYNC_SLOTS 1
  68. #endif
  69. #undef CYTHON_USE_PYLIST_INTERNALS
  70. #define CYTHON_USE_PYLIST_INTERNALS 0
  71. #undef CYTHON_USE_UNICODE_INTERNALS
  72. #define CYTHON_USE_UNICODE_INTERNALS 0
  73. #undef CYTHON_USE_UNICODE_WRITER
  74. #define CYTHON_USE_UNICODE_WRITER 0
  75. #undef CYTHON_USE_PYLONG_INTERNALS
  76. #define CYTHON_USE_PYLONG_INTERNALS 0
  77. #undef CYTHON_AVOID_BORROWED_REFS
  78. #define CYTHON_AVOID_BORROWED_REFS 1
  79. #undef CYTHON_ASSUME_SAFE_MACROS
  80. #define CYTHON_ASSUME_SAFE_MACROS 0
  81. #undef CYTHON_UNPACK_METHODS
  82. #define CYTHON_UNPACK_METHODS 0
  83. #undef CYTHON_FAST_THREAD_STATE
  84. #define CYTHON_FAST_THREAD_STATE 0
  85. #undef CYTHON_FAST_PYCALL
  86. #define CYTHON_FAST_PYCALL 0
  87. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  88. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  89. #undef CYTHON_USE_TP_FINALIZE
  90. #define CYTHON_USE_TP_FINALIZE 0
  91. #elif defined(PYSTON_VERSION)
  92. #define CYTHON_COMPILING_IN_PYPY 0
  93. #define CYTHON_COMPILING_IN_PYSTON 1
  94. #define CYTHON_COMPILING_IN_CPYTHON 0
  95. #ifndef CYTHON_USE_TYPE_SLOTS
  96. #define CYTHON_USE_TYPE_SLOTS 1
  97. #endif
  98. #undef CYTHON_USE_PYTYPE_LOOKUP
  99. #define CYTHON_USE_PYTYPE_LOOKUP 0
  100. #undef CYTHON_USE_ASYNC_SLOTS
  101. #define CYTHON_USE_ASYNC_SLOTS 0
  102. #undef CYTHON_USE_PYLIST_INTERNALS
  103. #define CYTHON_USE_PYLIST_INTERNALS 0
  104. #ifndef CYTHON_USE_UNICODE_INTERNALS
  105. #define CYTHON_USE_UNICODE_INTERNALS 1
  106. #endif
  107. #undef CYTHON_USE_UNICODE_WRITER
  108. #define CYTHON_USE_UNICODE_WRITER 0
  109. #undef CYTHON_USE_PYLONG_INTERNALS
  110. #define CYTHON_USE_PYLONG_INTERNALS 0
  111. #ifndef CYTHON_AVOID_BORROWED_REFS
  112. #define CYTHON_AVOID_BORROWED_REFS 0
  113. #endif
  114. #ifndef CYTHON_ASSUME_SAFE_MACROS
  115. #define CYTHON_ASSUME_SAFE_MACROS 1
  116. #endif
  117. #ifndef CYTHON_UNPACK_METHODS
  118. #define CYTHON_UNPACK_METHODS 1
  119. #endif
  120. #undef CYTHON_FAST_THREAD_STATE
  121. #define CYTHON_FAST_THREAD_STATE 0
  122. #undef CYTHON_FAST_PYCALL
  123. #define CYTHON_FAST_PYCALL 0
  124. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  125. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  126. #undef CYTHON_USE_TP_FINALIZE
  127. #define CYTHON_USE_TP_FINALIZE 0
  128. #else
  129. #define CYTHON_COMPILING_IN_PYPY 0
  130. #define CYTHON_COMPILING_IN_PYSTON 0
  131. #define CYTHON_COMPILING_IN_CPYTHON 1
  132. #ifndef CYTHON_USE_TYPE_SLOTS
  133. #define CYTHON_USE_TYPE_SLOTS 1
  134. #endif
  135. #if PY_VERSION_HEX < 0x02070000
  136. #undef CYTHON_USE_PYTYPE_LOOKUP
  137. #define CYTHON_USE_PYTYPE_LOOKUP 0
  138. #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
  139. #define CYTHON_USE_PYTYPE_LOOKUP 1
  140. #endif
  141. #if PY_MAJOR_VERSION < 3
  142. #undef CYTHON_USE_ASYNC_SLOTS
  143. #define CYTHON_USE_ASYNC_SLOTS 0
  144. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  145. #define CYTHON_USE_ASYNC_SLOTS 1
  146. #endif
  147. #if PY_VERSION_HEX < 0x02070000
  148. #undef CYTHON_USE_PYLONG_INTERNALS
  149. #define CYTHON_USE_PYLONG_INTERNALS 0
  150. #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
  151. #define CYTHON_USE_PYLONG_INTERNALS 1
  152. #endif
  153. #ifndef CYTHON_USE_PYLIST_INTERNALS
  154. #define CYTHON_USE_PYLIST_INTERNALS 1
  155. #endif
  156. #ifndef CYTHON_USE_UNICODE_INTERNALS
  157. #define CYTHON_USE_UNICODE_INTERNALS 1
  158. #endif
  159. #if PY_VERSION_HEX < 0x030300F0
  160. #undef CYTHON_USE_UNICODE_WRITER
  161. #define CYTHON_USE_UNICODE_WRITER 0
  162. #elif !defined(CYTHON_USE_UNICODE_WRITER)
  163. #define CYTHON_USE_UNICODE_WRITER 1
  164. #endif
  165. #ifndef CYTHON_AVOID_BORROWED_REFS
  166. #define CYTHON_AVOID_BORROWED_REFS 0
  167. #endif
  168. #ifndef CYTHON_ASSUME_SAFE_MACROS
  169. #define CYTHON_ASSUME_SAFE_MACROS 1
  170. #endif
  171. #ifndef CYTHON_UNPACK_METHODS
  172. #define CYTHON_UNPACK_METHODS 1
  173. #endif
  174. #ifndef CYTHON_FAST_THREAD_STATE
  175. #define CYTHON_FAST_THREAD_STATE 1
  176. #endif
  177. #ifndef CYTHON_FAST_PYCALL
  178. #define CYTHON_FAST_PYCALL 1
  179. #endif
  180. #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
  181. #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
  182. #endif
  183. #ifndef CYTHON_USE_TP_FINALIZE
  184. #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  185. #endif
  186. #endif
  187. #if !defined(CYTHON_FAST_PYCCALL)
  188. #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
  189. #endif
  190. #if CYTHON_USE_PYLONG_INTERNALS
  191. #include "longintrepr.h"
  192. #undef SHIFT
  193. #undef BASE
  194. #undef MASK
  195. #endif
  196. #ifndef __has_attribute
  197. #define __has_attribute(x) 0
  198. #endif
  199. #ifndef __has_cpp_attribute
  200. #define __has_cpp_attribute(x) 0
  201. #endif
  202. #ifndef CYTHON_RESTRICT
  203. #if defined(__GNUC__)
  204. #define CYTHON_RESTRICT __restrict__
  205. #elif defined(_MSC_VER) && _MSC_VER >= 1400
  206. #define CYTHON_RESTRICT __restrict
  207. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  208. #define CYTHON_RESTRICT restrict
  209. #else
  210. #define CYTHON_RESTRICT
  211. #endif
  212. #endif
  213. #ifndef CYTHON_UNUSED
  214. # if defined(__GNUC__)
  215. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  216. # define CYTHON_UNUSED __attribute__ ((__unused__))
  217. # else
  218. # define CYTHON_UNUSED
  219. # endif
  220. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  221. # define CYTHON_UNUSED __attribute__ ((__unused__))
  222. # else
  223. # define CYTHON_UNUSED
  224. # endif
  225. #endif
  226. #ifndef CYTHON_MAYBE_UNUSED_VAR
  227. # if defined(__cplusplus)
  228. template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
  229. # else
  230. # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
  231. # endif
  232. #endif
  233. #ifndef CYTHON_NCP_UNUSED
  234. # if CYTHON_COMPILING_IN_CPYTHON
  235. # define CYTHON_NCP_UNUSED
  236. # else
  237. # define CYTHON_NCP_UNUSED CYTHON_UNUSED
  238. # endif
  239. #endif
  240. #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
  241. #ifdef _MSC_VER
  242. #ifndef _MSC_STDINT_H_
  243. #if _MSC_VER < 1300
  244. typedef unsigned char uint8_t;
  245. typedef unsigned int uint32_t;
  246. #else
  247. typedef unsigned __int8 uint8_t;
  248. typedef unsigned __int32 uint32_t;
  249. #endif
  250. #endif
  251. #else
  252. #include <stdint.h>
  253. #endif
  254. #ifndef CYTHON_FALLTHROUGH
  255. #if defined(__cplusplus) && __cplusplus >= 201103L
  256. #if __has_cpp_attribute(fallthrough)
  257. #define CYTHON_FALLTHROUGH [[fallthrough]]
  258. #elif __has_cpp_attribute(clang::fallthrough)
  259. #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
  260. #elif __has_cpp_attribute(gnu::fallthrough)
  261. #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
  262. #endif
  263. #endif
  264. #ifndef CYTHON_FALLTHROUGH
  265. #if __has_attribute(fallthrough)
  266. #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
  267. #else
  268. #define CYTHON_FALLTHROUGH
  269. #endif
  270. #endif
  271. #if defined(__clang__ ) && defined(__apple_build_version__)
  272. #if __apple_build_version__ < 7000000
  273. #undef CYTHON_FALLTHROUGH
  274. #define CYTHON_FALLTHROUGH
  275. #endif
  276. #endif
  277. #endif
  278. #ifndef CYTHON_INLINE
  279. #if defined(__clang__)
  280. #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  281. #elif defined(__GNUC__)
  282. #define CYTHON_INLINE __inline__
  283. #elif defined(_MSC_VER)
  284. #define CYTHON_INLINE __inline
  285. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  286. #define CYTHON_INLINE inline
  287. #else
  288. #define CYTHON_INLINE
  289. #endif
  290. #endif
  291. #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  292. #define Py_OptimizeFlag 0
  293. #endif
  294. #define __PYX_BUILD_PY_SSIZE_T "n"
  295. #define CYTHON_FORMAT_SSIZE_T "z"
  296. #if PY_MAJOR_VERSION < 3
  297. #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  298. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  299. PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  300. #define __Pyx_DefaultClassType PyClass_Type
  301. #else
  302. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  303. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  304. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  305. #define __Pyx_DefaultClassType PyType_Type
  306. #endif
  307. #ifndef Py_TPFLAGS_CHECKTYPES
  308. #define Py_TPFLAGS_CHECKTYPES 0
  309. #endif
  310. #ifndef Py_TPFLAGS_HAVE_INDEX
  311. #define Py_TPFLAGS_HAVE_INDEX 0
  312. #endif
  313. #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  314. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  315. #endif
  316. #ifndef Py_TPFLAGS_HAVE_FINALIZE
  317. #define Py_TPFLAGS_HAVE_FINALIZE 0
  318. #endif
  319. #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  320. #ifndef METH_FASTCALL
  321. #define METH_FASTCALL 0x80
  322. #endif
  323. typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  324. typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
  325. Py_ssize_t nargs, PyObject *kwnames);
  326. #else
  327. #define __Pyx_PyCFunctionFast _PyCFunctionFast
  328. #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  329. #endif
  330. #if CYTHON_FAST_PYCCALL
  331. #define __Pyx_PyFastCFunction_Check(func)\
  332. ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
  333. #else
  334. #define __Pyx_PyFastCFunction_Check(func) 0
  335. #endif
  336. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  337. #define PyObject_Malloc(s) PyMem_Malloc(s)
  338. #define PyObject_Free(p) PyMem_Free(p)
  339. #define PyObject_Realloc(p) PyMem_Realloc(p)
  340. #endif
  341. #if CYTHON_COMPILING_IN_PYSTON
  342. #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
  343. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
  344. #else
  345. #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
  346. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
  347. #endif
  348. #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  349. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  350. #elif PY_VERSION_HEX >= 0x03060000
  351. #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
  352. #elif PY_VERSION_HEX >= 0x03000000
  353. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  354. #else
  355. #define __Pyx_PyThreadState_Current _PyThreadState_Current
  356. #endif
  357. #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
  358. #include "pythread.h"
  359. #define Py_tss_NEEDS_INIT 0
  360. typedef int Py_tss_t;
  361. static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  362. *key = PyThread_create_key();
  363. return 0; // PyThread_create_key reports success always
  364. }
  365. static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  366. Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  367. *key = Py_tss_NEEDS_INIT;
  368. return key;
  369. }
  370. static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  371. PyObject_Free(key);
  372. }
  373. static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  374. return *key != Py_tss_NEEDS_INIT;
  375. }
  376. static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  377. PyThread_delete_key(*key);
  378. *key = Py_tss_NEEDS_INIT;
  379. }
  380. static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  381. return PyThread_set_key_value(*key, value);
  382. }
  383. static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  384. return PyThread_get_key_value(*key);
  385. }
  386. #endif // TSS (Thread Specific Storage) API
  387. #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
  388. #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
  389. #else
  390. #define __Pyx_PyDict_NewPresized(n) PyDict_New()
  391. #endif
  392. #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  393. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  394. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  395. #else
  396. #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
  397. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
  398. #endif
  399. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
  400. #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
  401. #else
  402. #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
  403. #endif
  404. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  405. #define CYTHON_PEP393_ENABLED 1
  406. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
  407. 0 : _PyUnicode_Ready((PyObject *)(op)))
  408. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  409. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  410. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
  411. #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
  412. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  413. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  414. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
  415. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  416. #else
  417. #define CYTHON_PEP393_ENABLED 0
  418. #define PyUnicode_1BYTE_KIND 1
  419. #define PyUnicode_2BYTE_KIND 2
  420. #define PyUnicode_4BYTE_KIND 4
  421. #define __Pyx_PyUnicode_READY(op) (0)
  422. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  423. #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  424. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  425. #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
  426. #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
  427. #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  428. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  429. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
  430. #endif
  431. #if CYTHON_COMPILING_IN_PYPY
  432. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  433. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  434. #else
  435. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  436. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
  437. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  438. #endif
  439. #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  440. #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
  441. #endif
  442. #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  443. #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
  444. #endif
  445. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  446. #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
  447. #endif
  448. #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  449. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  450. #if PY_MAJOR_VERSION >= 3
  451. #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
  452. #else
  453. #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
  454. #endif
  455. #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  456. #define PyObject_ASCII(o) PyObject_Repr(o)
  457. #endif
  458. #if PY_MAJOR_VERSION >= 3
  459. #define PyBaseString_Type PyUnicode_Type
  460. #define PyStringObject PyUnicodeObject
  461. #define PyString_Type PyUnicode_Type
  462. #define PyString_Check PyUnicode_Check
  463. #define PyString_CheckExact PyUnicode_CheckExact
  464. #define PyObject_Unicode PyObject_Str
  465. #endif
  466. #if PY_MAJOR_VERSION >= 3
  467. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  468. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  469. #else
  470. #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  471. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  472. #endif
  473. #ifndef PySet_CheckExact
  474. #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
  475. #endif
  476. #if CYTHON_ASSUME_SAFE_MACROS
  477. #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
  478. #else
  479. #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
  480. #endif
  481. #if PY_MAJOR_VERSION >= 3
  482. #define PyIntObject PyLongObject
  483. #define PyInt_Type PyLong_Type
  484. #define PyInt_Check(op) PyLong_Check(op)
  485. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  486. #define PyInt_FromString PyLong_FromString
  487. #define PyInt_FromUnicode PyLong_FromUnicode
  488. #define PyInt_FromLong PyLong_FromLong
  489. #define PyInt_FromSize_t PyLong_FromSize_t
  490. #define PyInt_FromSsize_t PyLong_FromSsize_t
  491. #define PyInt_AsLong PyLong_AsLong
  492. #define PyInt_AS_LONG PyLong_AS_LONG
  493. #define PyInt_AsSsize_t PyLong_AsSsize_t
  494. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  495. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  496. #define PyNumber_Int PyNumber_Long
  497. #endif
  498. #if PY_MAJOR_VERSION >= 3
  499. #define PyBoolObject PyLongObject
  500. #endif
  501. #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  502. #ifndef PyUnicode_InternFromString
  503. #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  504. #endif
  505. #endif
  506. #if PY_VERSION_HEX < 0x030200A4
  507. typedef long Py_hash_t;
  508. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  509. #define __Pyx_PyInt_AsHash_t PyInt_AsLong
  510. #else
  511. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  512. #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
  513. #endif
  514. #if PY_MAJOR_VERSION >= 3
  515. #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
  516. #else
  517. #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
  518. #endif
  519. #if CYTHON_USE_ASYNC_SLOTS
  520. #if PY_VERSION_HEX >= 0x030500B1
  521. #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
  522. #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  523. #else
  524. #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  525. #endif
  526. #else
  527. #define __Pyx_PyType_AsAsync(obj) NULL
  528. #endif
  529. #ifndef __Pyx_PyAsyncMethodsStruct
  530. typedef struct {
  531. unaryfunc am_await;
  532. unaryfunc am_aiter;
  533. unaryfunc am_anext;
  534. } __Pyx_PyAsyncMethodsStruct;
  535. #endif
  536. #if defined(WIN32) || defined(MS_WINDOWS)
  537. #define _USE_MATH_DEFINES
  538. #endif
  539. #include <math.h>
  540. #ifdef NAN
  541. #define __PYX_NAN() ((float) NAN)
  542. #else
  543. static CYTHON_INLINE float __PYX_NAN() {
  544. float value;
  545. memset(&value, 0xFF, sizeof(value));
  546. return value;
  547. }
  548. #endif
  549. #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
  550. #define __Pyx_truncl trunc
  551. #else
  552. #define __Pyx_truncl truncl
  553. #endif
  554. #define __PYX_ERR(f_index, lineno, Ln_error) \
  555. { \
  556. __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
  557. }
  558. #ifndef __PYX_EXTERN_C
  559. #ifdef __cplusplus
  560. #define __PYX_EXTERN_C extern "C"
  561. #else
  562. #define __PYX_EXTERN_C extern
  563. #endif
  564. #endif
  565. #define __PYX_HAVE__aiohttp___helpers
  566. #define __PYX_HAVE_API__aiohttp___helpers
  567. /* Early includes */
  568. #ifdef _OPENMP
  569. #include <omp.h>
  570. #endif /* _OPENMP */
  571. #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
  572. #define CYTHON_WITHOUT_ASSERTIONS
  573. #endif
  574. typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
  575. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
  576. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  577. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  578. #define __PYX_DEFAULT_STRING_ENCODING ""
  579. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  580. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  581. #define __Pyx_uchar_cast(c) ((unsigned char)c)
  582. #define __Pyx_long_cast(x) ((long)x)
  583. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
  584. (sizeof(type) < sizeof(Py_ssize_t)) ||\
  585. (sizeof(type) > sizeof(Py_ssize_t) &&\
  586. likely(v < (type)PY_SSIZE_T_MAX ||\
  587. v == (type)PY_SSIZE_T_MAX) &&\
  588. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
  589. v == (type)PY_SSIZE_T_MIN))) ||\
  590. (sizeof(type) == sizeof(Py_ssize_t) &&\
  591. (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
  592. v == (type)PY_SSIZE_T_MAX))) )
  593. #if defined (__cplusplus) && __cplusplus >= 201103L
  594. #include <cstdlib>
  595. #define __Pyx_sst_abs(value) std::abs(value)
  596. #elif SIZEOF_INT >= SIZEOF_SIZE_T
  597. #define __Pyx_sst_abs(value) abs(value)
  598. #elif SIZEOF_LONG >= SIZEOF_SIZE_T
  599. #define __Pyx_sst_abs(value) labs(value)
  600. #elif defined (_MSC_VER)
  601. #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
  602. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  603. #define __Pyx_sst_abs(value) llabs(value)
  604. #elif defined (__GNUC__)
  605. #define __Pyx_sst_abs(value) __builtin_llabs(value)
  606. #else
  607. #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
  608. #endif
  609. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
  610. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  611. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  612. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  613. #define __Pyx_PyBytes_FromString PyBytes_FromString
  614. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  615. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  616. #if PY_MAJOR_VERSION < 3
  617. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  618. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  619. #else
  620. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  621. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  622. #endif
  623. #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
  624. #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
  625. #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
  626. #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
  627. #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
  628. #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
  629. #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
  630. #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  631. #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  632. #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
  633. #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
  634. #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
  635. #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
  636. #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
  637. #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
  638. #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
  639. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
  640. const Py_UNICODE *u_end = u;
  641. while (*u_end++) ;
  642. return (size_t)(u_end - u - 1);
  643. }
  644. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  645. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  646. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  647. #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
  648. #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
  649. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
  650. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  651. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
  652. #define __Pyx_PySequence_Tuple(obj)\
  653. (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
  654. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  655. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  656. #if CYTHON_ASSUME_SAFE_MACROS
  657. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  658. #else
  659. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  660. #endif
  661. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  662. #if PY_MAJOR_VERSION >= 3
  663. #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
  664. #else
  665. #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
  666. #endif
  667. #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
  668. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  669. static int __Pyx_sys_getdefaultencoding_not_ascii;
  670. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  671. PyObject* sys;
  672. PyObject* default_encoding = NULL;
  673. PyObject* ascii_chars_u = NULL;
  674. PyObject* ascii_chars_b = NULL;
  675. const char* default_encoding_c;
  676. sys = PyImport_ImportModule("sys");
  677. if (!sys) goto bad;
  678. default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
  679. Py_DECREF(sys);
  680. if (!default_encoding) goto bad;
  681. default_encoding_c = PyBytes_AsString(default_encoding);
  682. if (!default_encoding_c) goto bad;
  683. if (strcmp(default_encoding_c, "ascii") == 0) {
  684. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  685. } else {
  686. char ascii_chars[128];
  687. int c;
  688. for (c = 0; c < 128; c++) {
  689. ascii_chars[c] = c;
  690. }
  691. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  692. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  693. if (!ascii_chars_u) goto bad;
  694. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  695. if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  696. PyErr_Format(
  697. PyExc_ValueError,
  698. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  699. default_encoding_c);
  700. goto bad;
  701. }
  702. Py_DECREF(ascii_chars_u);
  703. Py_DECREF(ascii_chars_b);
  704. }
  705. Py_DECREF(default_encoding);
  706. return 0;
  707. bad:
  708. Py_XDECREF(default_encoding);
  709. Py_XDECREF(ascii_chars_u);
  710. Py_XDECREF(ascii_chars_b);
  711. return -1;
  712. }
  713. #endif
  714. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  715. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  716. #else
  717. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  718. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  719. static char* __PYX_DEFAULT_STRING_ENCODING;
  720. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  721. PyObject* sys;
  722. PyObject* default_encoding = NULL;
  723. char* default_encoding_c;
  724. sys = PyImport_ImportModule("sys");
  725. if (!sys) goto bad;
  726. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  727. Py_DECREF(sys);
  728. if (!default_encoding) goto bad;
  729. default_encoding_c = PyBytes_AsString(default_encoding);
  730. if (!default_encoding_c) goto bad;
  731. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  732. if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
  733. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  734. Py_DECREF(default_encoding);
  735. return 0;
  736. bad:
  737. Py_XDECREF(default_encoding);
  738. return -1;
  739. }
  740. #endif
  741. #endif
  742. /* Test for GCC > 2.95 */
  743. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  744. #define likely(x) __builtin_expect(!!(x), 1)
  745. #define unlikely(x) __builtin_expect(!!(x), 0)
  746. #else /* !__GNUC__ or GCC < 2.95 */
  747. #define likely(x) (x)
  748. #define unlikely(x) (x)
  749. #endif /* __GNUC__ */
  750. static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
  751. static PyObject *__pyx_m = NULL;
  752. static PyObject *__pyx_d;
  753. static PyObject *__pyx_b;
  754. static PyObject *__pyx_cython_runtime = NULL;
  755. static PyObject *__pyx_empty_tuple;
  756. static PyObject *__pyx_empty_bytes;
  757. static PyObject *__pyx_empty_unicode;
  758. static int __pyx_lineno;
  759. static int __pyx_clineno = 0;
  760. static const char * __pyx_cfilenm= __FILE__;
  761. static const char *__pyx_filename;
  762. static const char *__pyx_f[] = {
  763. "aiohttp/_helpers.pyx",
  764. "stringsource",
  765. };
  766. /*--- Type declarations ---*/
  767. struct __pyx_obj_7aiohttp_8_helpers_reify;
  768. /* "aiohttp/_helpers.pyx":1
  769. * cdef class reify: # <<<<<<<<<<<<<<
  770. * """Use as a class method decorator. It operates almost exactly like
  771. * the Python `@property` decorator, but it puts the result of the
  772. */
  773. struct __pyx_obj_7aiohttp_8_helpers_reify {
  774. PyObject_HEAD
  775. PyObject *wrapped;
  776. PyObject *name;
  777. };
  778. /* --- Runtime support code (head) --- */
  779. /* Refnanny.proto */
  780. #ifndef CYTHON_REFNANNY
  781. #define CYTHON_REFNANNY 0
  782. #endif
  783. #if CYTHON_REFNANNY
  784. typedef struct {
  785. void (*INCREF)(void*, PyObject*, int);
  786. void (*DECREF)(void*, PyObject*, int);
  787. void (*GOTREF)(void*, PyObject*, int);
  788. void (*GIVEREF)(void*, PyObject*, int);
  789. void* (*SetupContext)(const char*, int, const char*);
  790. void (*FinishContext)(void**);
  791. } __Pyx_RefNannyAPIStruct;
  792. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  793. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  794. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  795. #ifdef WITH_THREAD
  796. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  797. if (acquire_gil) {\
  798. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  799. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  800. PyGILState_Release(__pyx_gilstate_save);\
  801. } else {\
  802. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  803. }
  804. #else
  805. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  806. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  807. #endif
  808. #define __Pyx_RefNannyFinishContext()\
  809. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  810. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  811. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  812. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  813. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  814. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  815. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  816. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  817. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  818. #else
  819. #define __Pyx_RefNannyDeclarations
  820. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  821. #define __Pyx_RefNannyFinishContext()
  822. #define __Pyx_INCREF(r) Py_INCREF(r)
  823. #define __Pyx_DECREF(r) Py_DECREF(r)
  824. #define __Pyx_GOTREF(r)
  825. #define __Pyx_GIVEREF(r)
  826. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  827. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  828. #define __Pyx_XGOTREF(r)
  829. #define __Pyx_XGIVEREF(r)
  830. #endif
  831. #define __Pyx_XDECREF_SET(r, v) do {\
  832. PyObject *tmp = (PyObject *) r;\
  833. r = v; __Pyx_XDECREF(tmp);\
  834. } while (0)
  835. #define __Pyx_DECREF_SET(r, v) do {\
  836. PyObject *tmp = (PyObject *) r;\
  837. r = v; __Pyx_DECREF(tmp);\
  838. } while (0)
  839. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  840. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  841. /* PyObjectGetAttrStr.proto */
  842. #if CYTHON_USE_TYPE_SLOTS
  843. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
  844. #else
  845. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  846. #endif
  847. /* GetBuiltinName.proto */
  848. static PyObject *__Pyx_GetBuiltinName(PyObject *name);
  849. /* RaiseDoubleKeywords.proto */
  850. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
  851. /* ParseKeywords.proto */
  852. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
  853. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
  854. const char* function_name);
  855. /* RaiseArgTupleInvalid.proto */
  856. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  857. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
  858. /* GetItemInt.proto */
  859. #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  860. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  861. __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
  862. (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
  863. __Pyx_GetItemInt_Generic(o, to_py_func(i))))
  864. #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  865. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  866. __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
  867. (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  868. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  869. int wraparound, int boundscheck);
  870. #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  871. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  872. __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
  873. (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
  874. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  875. int wraparound, int boundscheck);
  876. static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
  877. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  878. int is_list, int wraparound, int boundscheck);
  879. /* ObjectGetItem.proto */
  880. #if CYTHON_USE_TYPE_SLOTS
  881. static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
  882. #else
  883. #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
  884. #endif
  885. /* PyThreadStateGet.proto */
  886. #if CYTHON_FAST_THREAD_STATE
  887. #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
  888. #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
  889. #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
  890. #else
  891. #define __Pyx_PyThreadState_declare
  892. #define __Pyx_PyThreadState_assign
  893. #define __Pyx_PyErr_Occurred() PyErr_Occurred()
  894. #endif
  895. /* SaveResetException.proto */
  896. #if CYTHON_FAST_THREAD_STATE
  897. #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
  898. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  899. #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
  900. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  901. #else
  902. #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
  903. #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
  904. #endif
  905. /* PyErrExceptionMatches.proto */
  906. #if CYTHON_FAST_THREAD_STATE
  907. #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
  908. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
  909. #else
  910. #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
  911. #endif
  912. /* GetException.proto */
  913. #if CYTHON_FAST_THREAD_STATE
  914. #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
  915. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  916. #else
  917. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
  918. #endif
  919. /* PyCFunctionFastCall.proto */
  920. #if CYTHON_FAST_PYCCALL
  921. static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
  922. #else
  923. #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
  924. #endif
  925. /* PyFunctionFastCall.proto */
  926. #if CYTHON_FAST_PYCALL
  927. #define __Pyx_PyFunction_FastCall(func, args, nargs)\
  928. __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
  929. #if 1 || PY_VERSION_HEX < 0x030600B1
  930. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
  931. #else
  932. #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
  933. #endif
  934. #endif
  935. /* PyObjectCall.proto */
  936. #if CYTHON_COMPILING_IN_CPYTHON
  937. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
  938. #else
  939. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  940. #endif
  941. /* PyObjectCallMethO.proto */
  942. #if CYTHON_COMPILING_IN_CPYTHON
  943. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
  944. #endif
  945. /* PyObjectCallOneArg.proto */
  946. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
  947. /* PyErrFetchRestore.proto */
  948. #if CYTHON_FAST_THREAD_STATE
  949. #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
  950. #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
  951. #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
  952. #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
  953. #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
  954. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  955. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  956. #if CYTHON_COMPILING_IN_CPYTHON
  957. #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
  958. #else
  959. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  960. #endif
  961. #else
  962. #define __Pyx_PyErr_Clear() PyErr_Clear()
  963. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  964. #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
  965. #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
  966. #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
  967. #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
  968. #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
  969. #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
  970. #endif
  971. /* RaiseException.proto */
  972. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
  973. /* GetAttr.proto */
  974. static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
  975. /* GetAttr3.proto */
  976. static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
  977. /* GetModuleGlobalName.proto */
  978. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
  979. /* Import.proto */
  980. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
  981. /* ImportFrom.proto */
  982. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
  983. /* HasAttr.proto */
  984. static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
  985. /* PyObject_GenericGetAttrNoDict.proto */
  986. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  987. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
  988. #else
  989. #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
  990. #endif
  991. /* PyObject_GenericGetAttr.proto */
  992. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  993. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
  994. #else
  995. #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
  996. #endif
  997. /* SetupReduce.proto */
  998. static int __Pyx_setup_reduce(PyObject* type_obj);
  999. /* CLineInTraceback.proto */
  1000. #ifdef CYTHON_CLINE_IN_TRACEBACK
  1001. #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
  1002. #else
  1003. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
  1004. #endif
  1005. /* CodeObjectCache.proto */
  1006. typedef struct {
  1007. PyCodeObject* code_object;
  1008. int code_line;
  1009. } __Pyx_CodeObjectCacheEntry;
  1010. struct __Pyx_CodeObjectCache {
  1011. int count;
  1012. int max_count;
  1013. __Pyx_CodeObjectCacheEntry* entries;
  1014. };
  1015. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1016. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1017. static PyCodeObject *__pyx_find_code_object(int code_line);
  1018. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1019. /* AddTraceback.proto */
  1020. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1021. int py_line, const char *filename);
  1022. /* CIntToPy.proto */
  1023. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1024. /* CIntFromPy.proto */
  1025. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1026. /* CIntFromPy.proto */
  1027. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1028. /* FastTypeChecks.proto */
  1029. #if CYTHON_COMPILING_IN_CPYTHON
  1030. #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
  1031. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
  1032. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
  1033. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
  1034. #else
  1035. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  1036. #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
  1037. #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
  1038. #endif
  1039. #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
  1040. /* CheckBinaryVersion.proto */
  1041. static int __Pyx_check_binary_version(void);
  1042. /* InitStrings.proto */
  1043. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
  1044. /* Module declarations from 'aiohttp._helpers' */
  1045. static PyTypeObject *__pyx_ptype_7aiohttp_8_helpers_reify = 0;
  1046. static PyObject *__pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(struct __pyx_obj_7aiohttp_8_helpers_reify *, PyObject *); /*proto*/
  1047. #define __Pyx_MODULE_NAME "aiohttp._helpers"
  1048. extern int __pyx_module_is_main_aiohttp___helpers;
  1049. int __pyx_module_is_main_aiohttp___helpers = 0;
  1050. /* Implementation of 'aiohttp._helpers' */
  1051. static PyObject *__pyx_builtin_KeyError;
  1052. static PyObject *__pyx_builtin_AttributeError;
  1053. static const char __pyx_k_doc[] = "__doc__";
  1054. static const char __pyx_k_new[] = "__new__";
  1055. static const char __pyx_k_dict[] = "__dict__";
  1056. static const char __pyx_k_main[] = "__main__";
  1057. static const char __pyx_k_name[] = "__name__";
  1058. static const char __pyx_k_test[] = "__test__";
  1059. static const char __pyx_k_cache[] = "_cache";
  1060. static const char __pyx_k_import[] = "__import__";
  1061. static const char __pyx_k_pickle[] = "pickle";
  1062. static const char __pyx_k_reduce[] = "__reduce__";
  1063. static const char __pyx_k_update[] = "update";
  1064. static const char __pyx_k_wrapped[] = "wrapped";
  1065. static const char __pyx_k_KeyError[] = "KeyError";
  1066. static const char __pyx_k_getstate[] = "__getstate__";
  1067. static const char __pyx_k_pyx_type[] = "__pyx_type";
  1068. static const char __pyx_k_setstate[] = "__setstate__";
  1069. static const char __pyx_k_pyx_state[] = "__pyx_state";
  1070. static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
  1071. static const char __pyx_k_pyx_result[] = "__pyx_result";
  1072. static const char __pyx_k_PickleError[] = "PickleError";
  1073. static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
  1074. static const char __pyx_k_stringsource[] = "stringsource";
  1075. static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
  1076. static const char __pyx_k_AttributeError[] = "AttributeError";
  1077. static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
  1078. static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
  1079. static const char __pyx_k_aiohttp__helpers[] = "aiohttp._helpers";
  1080. static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
  1081. static const char __pyx_k_pyx_unpickle_reify[] = "__pyx_unpickle_reify";
  1082. static const char __pyx_k_reified_property_is_read_only[] = "reified property is read-only";
  1083. static const char __pyx_k_Incompatible_checksums_s_vs_0x77[] = "Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))";
  1084. static PyObject *__pyx_n_s_AttributeError;
  1085. static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x77;
  1086. static PyObject *__pyx_n_s_KeyError;
  1087. static PyObject *__pyx_n_s_PickleError;
  1088. static PyObject *__pyx_n_s_aiohttp__helpers;
  1089. static PyObject *__pyx_n_s_cache;
  1090. static PyObject *__pyx_n_s_cline_in_traceback;
  1091. static PyObject *__pyx_n_s_dict;
  1092. static PyObject *__pyx_n_s_doc;
  1093. static PyObject *__pyx_n_s_getstate;
  1094. static PyObject *__pyx_n_s_import;
  1095. static PyObject *__pyx_n_s_main;
  1096. static PyObject *__pyx_n_s_name;
  1097. static PyObject *__pyx_n_s_new;
  1098. static PyObject *__pyx_n_s_pickle;
  1099. static PyObject *__pyx_n_s_pyx_PickleError;
  1100. static PyObject *__pyx_n_s_pyx_checksum;
  1101. static PyObject *__pyx_n_s_pyx_result;
  1102. static PyObject *__pyx_n_s_pyx_state;
  1103. static PyObject *__pyx_n_s_pyx_type;
  1104. static PyObject *__pyx_n_s_pyx_unpickle_reify;
  1105. static PyObject *__pyx_n_s_reduce;
  1106. static PyObject *__pyx_n_s_reduce_cython;
  1107. static PyObject *__pyx_n_s_reduce_ex;
  1108. static PyObject *__pyx_kp_s_reified_property_is_read_only;
  1109. static PyObject *__pyx_n_s_setstate;
  1110. static PyObject *__pyx_n_s_setstate_cython;
  1111. static PyObject *__pyx_kp_s_stringsource;
  1112. static PyObject *__pyx_n_s_test;
  1113. static PyObject *__pyx_n_s_update;
  1114. static PyObject *__pyx_n_s_wrapped;
  1115. static int __pyx_pf_7aiohttp_8_helpers_5reify___init__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_wrapped); /* proto */
  1116. static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self); /* proto */
  1117. static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_2__get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_owner); /* proto */
  1118. static int __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
  1119. static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self); /* proto */
  1120. static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
  1121. static PyObject *__pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
  1122. static PyObject *__pyx_tp_new_7aiohttp_8_helpers_reify(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  1123. static PyObject *__pyx_int_124832655;
  1124. static PyObject *__pyx_tuple_;
  1125. static PyObject *__pyx_tuple__2;
  1126. static PyObject *__pyx_codeobj__3;
  1127. /* Late includes */
  1128. /* "aiohttp/_helpers.pyx":13
  1129. * cdef object name
  1130. *
  1131. * def __init__(self, wrapped): # <<<<<<<<<<<<<<
  1132. * self.wrapped = wrapped
  1133. * self.name = wrapped.__name__
  1134. */
  1135. /* Python wrapper */
  1136. static int __pyx_pw_7aiohttp_8_helpers_5reify_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1137. static int __pyx_pw_7aiohttp_8_helpers_5reify_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1138. PyObject *__pyx_v_wrapped = 0;
  1139. int __pyx_r;
  1140. __Pyx_RefNannyDeclarations
  1141. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  1142. {
  1143. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_wrapped,0};
  1144. PyObject* values[1] = {0};
  1145. if (unlikely(__pyx_kwds)) {
  1146. Py_ssize_t kw_args;
  1147. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1148. switch (pos_args) {
  1149. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1150. CYTHON_FALLTHROUGH;
  1151. case 0: break;
  1152. default: goto __pyx_L5_argtuple_error;
  1153. }
  1154. kw_args = PyDict_Size(__pyx_kwds);
  1155. switch (pos_args) {
  1156. case 0:
  1157. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrapped)) != 0)) kw_args--;
  1158. else goto __pyx_L5_argtuple_error;
  1159. }
  1160. if (unlikely(kw_args > 0)) {
  1161. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
  1162. }
  1163. } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
  1164. goto __pyx_L5_argtuple_error;
  1165. } else {
  1166. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1167. }
  1168. __pyx_v_wrapped = values[0];
  1169. }
  1170. goto __pyx_L4_argument_unpacking_done;
  1171. __pyx_L5_argtuple_error:;
  1172. __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
  1173. __pyx_L3_error:;
  1174. __Pyx_AddTraceback("aiohttp._helpers.reify.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1175. __Pyx_RefNannyFinishContext();
  1176. return -1;
  1177. __pyx_L4_argument_unpacking_done:;
  1178. __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify___init__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), __pyx_v_wrapped);
  1179. /* function exit code */
  1180. __Pyx_RefNannyFinishContext();
  1181. return __pyx_r;
  1182. }
  1183. static int __pyx_pf_7aiohttp_8_helpers_5reify___init__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_wrapped) {
  1184. int __pyx_r;
  1185. __Pyx_RefNannyDeclarations
  1186. PyObject *__pyx_t_1 = NULL;
  1187. __Pyx_RefNannySetupContext("__init__", 0);
  1188. /* "aiohttp/_helpers.pyx":14
  1189. *
  1190. * def __init__(self, wrapped):
  1191. * self.wrapped = wrapped # <<<<<<<<<<<<<<
  1192. * self.name = wrapped.__name__
  1193. *
  1194. */
  1195. __Pyx_INCREF(__pyx_v_wrapped);
  1196. __Pyx_GIVEREF(__pyx_v_wrapped);
  1197. __Pyx_GOTREF(__pyx_v_self->wrapped);
  1198. __Pyx_DECREF(__pyx_v_self->wrapped);
  1199. __pyx_v_self->wrapped = __pyx_v_wrapped;
  1200. /* "aiohttp/_helpers.pyx":15
  1201. * def __init__(self, wrapped):
  1202. * self.wrapped = wrapped
  1203. * self.name = wrapped.__name__ # <<<<<<<<<<<<<<
  1204. *
  1205. * @property
  1206. */
  1207. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_wrapped, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  1208. __Pyx_GOTREF(__pyx_t_1);
  1209. __Pyx_GIVEREF(__pyx_t_1);
  1210. __Pyx_GOTREF(__pyx_v_self->name);
  1211. __Pyx_DECREF(__pyx_v_self->name);
  1212. __pyx_v_self->name = __pyx_t_1;
  1213. __pyx_t_1 = 0;
  1214. /* "aiohttp/_helpers.pyx":13
  1215. * cdef object name
  1216. *
  1217. * def __init__(self, wrapped): # <<<<<<<<<<<<<<
  1218. * self.wrapped = wrapped
  1219. * self.name = wrapped.__name__
  1220. */
  1221. /* function exit code */
  1222. __pyx_r = 0;
  1223. goto __pyx_L0;
  1224. __pyx_L1_error:;
  1225. __Pyx_XDECREF(__pyx_t_1);
  1226. __Pyx_AddTraceback("aiohttp._helpers.reify.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1227. __pyx_r = -1;
  1228. __pyx_L0:;
  1229. __Pyx_RefNannyFinishContext();
  1230. return __pyx_r;
  1231. }
  1232. /* "aiohttp/_helpers.pyx":18
  1233. *
  1234. * @property
  1235. * def __doc__(self): # <<<<<<<<<<<<<<
  1236. * return self.wrapped.__doc__
  1237. *
  1238. */
  1239. /* Python wrapper */
  1240. static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(PyObject *__pyx_v_self); /*proto*/
  1241. static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(PyObject *__pyx_v_self) {
  1242. PyObject *__pyx_r = 0;
  1243. __Pyx_RefNannyDeclarations
  1244. __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  1245. __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self));
  1246. /* function exit code */
  1247. __Pyx_RefNannyFinishContext();
  1248. return __pyx_r;
  1249. }
  1250. static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self) {
  1251. PyObject *__pyx_r = NULL;
  1252. __Pyx_RefNannyDeclarations
  1253. PyObject *__pyx_t_1 = NULL;
  1254. __Pyx_RefNannySetupContext("__get__", 0);
  1255. /* "aiohttp/_helpers.pyx":19
  1256. * @property
  1257. * def __doc__(self):
  1258. * return self.wrapped.__doc__ # <<<<<<<<<<<<<<
  1259. *
  1260. * def __get__(self, inst, owner):
  1261. */
  1262. __Pyx_XDECREF(__pyx_r);
  1263. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->wrapped, __pyx_n_s_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  1264. __Pyx_GOTREF(__pyx_t_1);
  1265. __pyx_r = __pyx_t_1;
  1266. __pyx_t_1 = 0;
  1267. goto __pyx_L0;
  1268. /* "aiohttp/_helpers.pyx":18
  1269. *
  1270. * @property
  1271. * def __doc__(self): # <<<<<<<<<<<<<<
  1272. * return self.wrapped.__doc__
  1273. *
  1274. */
  1275. /* function exit code */
  1276. __pyx_L1_error:;
  1277. __Pyx_XDECREF(__pyx_t_1);
  1278. __Pyx_AddTraceback("aiohttp._helpers.reify.__doc__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1279. __pyx_r = NULL;
  1280. __pyx_L0:;
  1281. __Pyx_XGIVEREF(__pyx_r);
  1282. __Pyx_RefNannyFinishContext();
  1283. return __pyx_r;
  1284. }
  1285. /* "aiohttp/_helpers.pyx":21
  1286. * return self.wrapped.__doc__
  1287. *
  1288. * def __get__(self, inst, owner): # <<<<<<<<<<<<<<
  1289. * try:
  1290. * try:
  1291. */
  1292. /* Python wrapper */
  1293. static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_owner); /*proto*/
  1294. static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_owner) {
  1295. PyObject *__pyx_r = 0;
  1296. __Pyx_RefNannyDeclarations
  1297. __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  1298. __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_2__get__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v_inst), ((PyObject *)__pyx_v_owner));
  1299. /* function exit code */
  1300. __Pyx_RefNannyFinishContext();
  1301. return __pyx_r;
  1302. }
  1303. static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_2__get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_owner) {
  1304. PyObject *__pyx_v_val = NULL;
  1305. PyObject *__pyx_r = NULL;
  1306. __Pyx_RefNannyDeclarations
  1307. PyObject *__pyx_t_1 = NULL;
  1308. PyObject *__pyx_t_2 = NULL;
  1309. PyObject *__pyx_t_3 = NULL;
  1310. PyObject *__pyx_t_4 = NULL;
  1311. PyObject *__pyx_t_5 = NULL;
  1312. PyObject *__pyx_t_6 = NULL;
  1313. PyObject *__pyx_t_7 = NULL;
  1314. PyObject *__pyx_t_8 = NULL;
  1315. int __pyx_t_9;
  1316. PyObject *__pyx_t_10 = NULL;
  1317. PyObject *__pyx_t_11 = NULL;
  1318. PyObject *__pyx_t_12 = NULL;
  1319. PyObject *__pyx_t_13 = NULL;
  1320. PyObject *__pyx_t_14 = NULL;
  1321. int __pyx_t_15;
  1322. int __pyx_t_16;
  1323. __Pyx_RefNannySetupContext("__get__", 0);
  1324. /* "aiohttp/_helpers.pyx":22
  1325. *
  1326. * def __get__(self, inst, owner):
  1327. * try: # <<<<<<<<<<<<<<
  1328. * try:
  1329. * return inst._cache[self.name]
  1330. */
  1331. {
  1332. __Pyx_PyThreadState_declare
  1333. __Pyx_PyThreadState_assign
  1334. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  1335. __Pyx_XGOTREF(__pyx_t_1);
  1336. __Pyx_XGOTREF(__pyx_t_2);
  1337. __Pyx_XGOTREF(__pyx_t_3);
  1338. /*try:*/ {
  1339. /* "aiohttp/_helpers.pyx":23
  1340. * def __get__(self, inst, owner):
  1341. * try:
  1342. * try: # <<<<<<<<<<<<<<
  1343. * return inst._cache[self.name]
  1344. * except KeyError:
  1345. */
  1346. {
  1347. __Pyx_PyThreadState_declare
  1348. __Pyx_PyThreadState_assign
  1349. __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
  1350. __Pyx_XGOTREF(__pyx_t_4);
  1351. __Pyx_XGOTREF(__pyx_t_5);
  1352. __Pyx_XGOTREF(__pyx_t_6);
  1353. /*try:*/ {
  1354. /* "aiohttp/_helpers.pyx":24
  1355. * try:
  1356. * try:
  1357. * return inst._cache[self.name] # <<<<<<<<<<<<<<
  1358. * except KeyError:
  1359. * val = self.wrapped(inst)
  1360. */
  1361. __Pyx_XDECREF(__pyx_r);
  1362. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_inst, __pyx_n_s_cache); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 24, __pyx_L9_error)
  1363. __Pyx_GOTREF(__pyx_t_7);
  1364. __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_self->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 24, __pyx_L9_error)
  1365. __Pyx_GOTREF(__pyx_t_8);
  1366. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1367. __pyx_r = __pyx_t_8;
  1368. __pyx_t_8 = 0;
  1369. goto __pyx_L13_try_return;
  1370. /* "aiohttp/_helpers.pyx":23
  1371. * def __get__(self, inst, owner):
  1372. * try:
  1373. * try: # <<<<<<<<<<<<<<
  1374. * return inst._cache[self.name]
  1375. * except KeyError:
  1376. */
  1377. }
  1378. __pyx_L9_error:;
  1379. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  1380. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  1381. /* "aiohttp/_helpers.pyx":25
  1382. * try:
  1383. * return inst._cache[self.name]
  1384. * except KeyError: # <<<<<<<<<<<<<<
  1385. * val = self.wrapped(inst)
  1386. * inst._cache[self.name] = val
  1387. */
  1388. __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
  1389. if (__pyx_t_9) {
  1390. __Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1391. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 25, __pyx_L11_except_error)
  1392. __Pyx_GOTREF(__pyx_t_8);
  1393. __Pyx_GOTREF(__pyx_t_7);
  1394. __Pyx_GOTREF(__pyx_t_10);
  1395. /* "aiohttp/_helpers.pyx":26
  1396. * return inst._cache[self.name]
  1397. * except KeyError:
  1398. * val = self.wrapped(inst) # <<<<<<<<<<<<<<
  1399. * inst._cache[self.name] = val
  1400. * return val
  1401. */
  1402. __Pyx_INCREF(__pyx_v_self->wrapped);
  1403. __pyx_t_12 = __pyx_v_self->wrapped; __pyx_t_13 = NULL;
  1404. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
  1405. __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
  1406. if (likely(__pyx_t_13)) {
  1407. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
  1408. __Pyx_INCREF(__pyx_t_13);
  1409. __Pyx_INCREF(function);
  1410. __Pyx_DECREF_SET(__pyx_t_12, function);
  1411. }
  1412. }
  1413. if (!__pyx_t_13) {
  1414. __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_inst); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 26, __pyx_L11_except_error)
  1415. __Pyx_GOTREF(__pyx_t_11);
  1416. } else {
  1417. #if CYTHON_FAST_PYCALL
  1418. if (PyFunction_Check(__pyx_t_12)) {
  1419. PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_inst};
  1420. __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 26, __pyx_L11_except_error)
  1421. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  1422. __Pyx_GOTREF(__pyx_t_11);
  1423. } else
  1424. #endif
  1425. #if CYTHON_FAST_PYCCALL
  1426. if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
  1427. PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_v_inst};
  1428. __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 26, __pyx_L11_except_error)
  1429. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  1430. __Pyx_GOTREF(__pyx_t_11);
  1431. } else
  1432. #endif
  1433. {
  1434. __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 26, __pyx_L11_except_error)
  1435. __Pyx_GOTREF(__pyx_t_14);
  1436. __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
  1437. __Pyx_INCREF(__pyx_v_inst);
  1438. __Pyx_GIVEREF(__pyx_v_inst);
  1439. PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_inst);
  1440. __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 26, __pyx_L11_except_error)
  1441. __Pyx_GOTREF(__pyx_t_11);
  1442. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  1443. }
  1444. }
  1445. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  1446. __pyx_v_val = __pyx_t_11;
  1447. __pyx_t_11 = 0;
  1448. /* "aiohttp/_helpers.pyx":27
  1449. * except KeyError:
  1450. * val = self.wrapped(inst)
  1451. * inst._cache[self.name] = val # <<<<<<<<<<<<<<
  1452. * return val
  1453. * except AttributeError:
  1454. */
  1455. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_inst, __pyx_n_s_cache); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 27, __pyx_L11_except_error)
  1456. __Pyx_GOTREF(__pyx_t_11);
  1457. if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_v_self->name, __pyx_v_val) < 0)) __PYX_ERR(0, 27, __pyx_L11_except_error)
  1458. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  1459. /* "aiohttp/_helpers.pyx":28
  1460. * val = self.wrapped(inst)
  1461. * inst._cache[self.name] = val
  1462. * return val # <<<<<<<<<<<<<<
  1463. * except AttributeError:
  1464. * if inst is None:
  1465. */
  1466. __Pyx_XDECREF(__pyx_r);
  1467. __Pyx_INCREF(__pyx_v_val);
  1468. __pyx_r = __pyx_v_val;
  1469. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1470. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1471. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1472. goto __pyx_L12_except_return;
  1473. }
  1474. goto __pyx_L11_except_error;
  1475. __pyx_L11_except_error:;
  1476. /* "aiohttp/_helpers.pyx":23
  1477. * def __get__(self, inst, owner):
  1478. * try:
  1479. * try: # <<<<<<<<<<<<<<
  1480. * return inst._cache[self.name]
  1481. * except KeyError:
  1482. */
  1483. __Pyx_XGIVEREF(__pyx_t_4);
  1484. __Pyx_XGIVEREF(__pyx_t_5);
  1485. __Pyx_XGIVEREF(__pyx_t_6);
  1486. __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
  1487. goto __pyx_L3_error;
  1488. __pyx_L13_try_return:;
  1489. __Pyx_XGIVEREF(__pyx_t_4);
  1490. __Pyx_XGIVEREF(__pyx_t_5);
  1491. __Pyx_XGIVEREF(__pyx_t_6);
  1492. __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
  1493. goto __pyx_L7_try_return;
  1494. __pyx_L12_except_return:;
  1495. __Pyx_XGIVEREF(__pyx_t_4);
  1496. __Pyx_XGIVEREF(__pyx_t_5);
  1497. __Pyx_XGIVEREF(__pyx_t_6);
  1498. __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
  1499. goto __pyx_L7_try_return;
  1500. }
  1501. /* "aiohttp/_helpers.pyx":22
  1502. *
  1503. * def __get__(self, inst, owner):
  1504. * try: # <<<<<<<<<<<<<<
  1505. * try:
  1506. * return inst._cache[self.name]
  1507. */
  1508. }
  1509. __pyx_L3_error:;
  1510. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  1511. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  1512. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  1513. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  1514. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  1515. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  1516. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  1517. /* "aiohttp/_helpers.pyx":29
  1518. * inst._cache[self.name] = val
  1519. * return val
  1520. * except AttributeError: # <<<<<<<<<<<<<<
  1521. * if inst is None:
  1522. * return self
  1523. */
  1524. __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
  1525. if (__pyx_t_9) {
  1526. __Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1527. if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 29, __pyx_L5_except_error)
  1528. __Pyx_GOTREF(__pyx_t_10);
  1529. __Pyx_GOTREF(__pyx_t_7);
  1530. __Pyx_GOTREF(__pyx_t_8);
  1531. /* "aiohttp/_helpers.pyx":30
  1532. * return val
  1533. * except AttributeError:
  1534. * if inst is None: # <<<<<<<<<<<<<<
  1535. * return self
  1536. * raise
  1537. */
  1538. __pyx_t_15 = (__pyx_v_inst == Py_None);
  1539. __pyx_t_16 = (__pyx_t_15 != 0);
  1540. if (__pyx_t_16) {
  1541. /* "aiohttp/_helpers.pyx":31
  1542. * except AttributeError:
  1543. * if inst is None:
  1544. * return self # <<<<<<<<<<<<<<
  1545. * raise
  1546. *
  1547. */
  1548. __Pyx_XDECREF(__pyx_r);
  1549. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  1550. __pyx_r = ((PyObject *)__pyx_v_self);
  1551. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  1552. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  1553. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  1554. goto __pyx_L6_except_return;
  1555. /* "aiohttp/_helpers.pyx":30
  1556. * return val
  1557. * except AttributeError:
  1558. * if inst is None: # <<<<<<<<<<<<<<
  1559. * return self
  1560. * raise
  1561. */
  1562. }
  1563. /* "aiohttp/_helpers.pyx":32
  1564. * if inst is None:
  1565. * return self
  1566. * raise # <<<<<<<<<<<<<<
  1567. *
  1568. * def __set__(self, inst, value):
  1569. */
  1570. __Pyx_GIVEREF(__pyx_t_10);
  1571. __Pyx_GIVEREF(__pyx_t_7);
  1572. __Pyx_XGIVEREF(__pyx_t_8);
  1573. __Pyx_ErrRestoreWithState(__pyx_t_10, __pyx_t_7, __pyx_t_8);
  1574. __pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0;
  1575. __PYX_ERR(0, 32, __pyx_L5_except_error)
  1576. }
  1577. goto __pyx_L5_except_error;
  1578. __pyx_L5_except_error:;
  1579. /* "aiohttp/_helpers.pyx":22
  1580. *
  1581. * def __get__(self, inst, owner):
  1582. * try: # <<<<<<<<<<<<<<
  1583. * try:
  1584. * return inst._cache[self.name]
  1585. */
  1586. __Pyx_XGIVEREF(__pyx_t_1);
  1587. __Pyx_XGIVEREF(__pyx_t_2);
  1588. __Pyx_XGIVEREF(__pyx_t_3);
  1589. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1590. goto __pyx_L1_error;
  1591. __pyx_L7_try_return:;
  1592. __Pyx_XGIVEREF(__pyx_t_1);
  1593. __Pyx_XGIVEREF(__pyx_t_2);
  1594. __Pyx_XGIVEREF(__pyx_t_3);
  1595. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1596. goto __pyx_L0;
  1597. __pyx_L6_except_return:;
  1598. __Pyx_XGIVEREF(__pyx_t_1);
  1599. __Pyx_XGIVEREF(__pyx_t_2);
  1600. __Pyx_XGIVEREF(__pyx_t_3);
  1601. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  1602. goto __pyx_L0;
  1603. }
  1604. /* "aiohttp/_helpers.pyx":21
  1605. * return self.wrapped.__doc__
  1606. *
  1607. * def __get__(self, inst, owner): # <<<<<<<<<<<<<<
  1608. * try:
  1609. * try:
  1610. */
  1611. /* function exit code */
  1612. __pyx_L1_error:;
  1613. __Pyx_XDECREF(__pyx_t_7);
  1614. __Pyx_XDECREF(__pyx_t_8);
  1615. __Pyx_XDECREF(__pyx_t_10);
  1616. __Pyx_XDECREF(__pyx_t_11);
  1617. __Pyx_XDECREF(__pyx_t_12);
  1618. __Pyx_XDECREF(__pyx_t_13);
  1619. __Pyx_XDECREF(__pyx_t_14);
  1620. __Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1621. __pyx_r = NULL;
  1622. __pyx_L0:;
  1623. __Pyx_XDECREF(__pyx_v_val);
  1624. __Pyx_XGIVEREF(__pyx_r);
  1625. __Pyx_RefNannyFinishContext();
  1626. return __pyx_r;
  1627. }
  1628. /* "aiohttp/_helpers.pyx":34
  1629. * raise
  1630. *
  1631. * def __set__(self, inst, value): # <<<<<<<<<<<<<<
  1632. * raise AttributeError("reified property is read-only")
  1633. */
  1634. /* Python wrapper */
  1635. static int __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_value); /*proto*/
  1636. static int __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_value) {
  1637. int __pyx_r;
  1638. __Pyx_RefNannyDeclarations
  1639. __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  1640. __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v_inst), ((PyObject *)__pyx_v_value));
  1641. /* function exit code */
  1642. __Pyx_RefNannyFinishContext();
  1643. return __pyx_r;
  1644. }
  1645. static int __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_value) {
  1646. int __pyx_r;
  1647. __Pyx_RefNannyDeclarations
  1648. PyObject *__pyx_t_1 = NULL;
  1649. __Pyx_RefNannySetupContext("__set__", 0);
  1650. /* "aiohttp/_helpers.pyx":35
  1651. *
  1652. * def __set__(self, inst, value):
  1653. * raise AttributeError("reified property is read-only") # <<<<<<<<<<<<<<
  1654. */
  1655. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  1656. __Pyx_GOTREF(__pyx_t_1);
  1657. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  1658. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1659. __PYX_ERR(0, 35, __pyx_L1_error)
  1660. /* "aiohttp/_helpers.pyx":34
  1661. * raise
  1662. *
  1663. * def __set__(self, inst, value): # <<<<<<<<<<<<<<
  1664. * raise AttributeError("reified property is read-only")
  1665. */
  1666. /* function exit code */
  1667. __pyx_L1_error:;
  1668. __Pyx_XDECREF(__pyx_t_1);
  1669. __Pyx_AddTraceback("aiohttp._helpers.reify.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1670. __pyx_r = -1;
  1671. __Pyx_RefNannyFinishContext();
  1672. return __pyx_r;
  1673. }
  1674. /* "(tree fragment)":1
  1675. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  1676. * cdef bint use_setstate
  1677. * state = (self.name, self.wrapped)
  1678. */
  1679. /* Python wrapper */
  1680. static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  1681. static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  1682. PyObject *__pyx_r = 0;
  1683. __Pyx_RefNannyDeclarations
  1684. __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  1685. __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self));
  1686. /* function exit code */
  1687. __Pyx_RefNannyFinishContext();
  1688. return __pyx_r;
  1689. }
  1690. static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self) {
  1691. int __pyx_v_use_setstate;
  1692. PyObject *__pyx_v_state = NULL;
  1693. PyObject *__pyx_v__dict = NULL;
  1694. PyObject *__pyx_r = NULL;
  1695. __Pyx_RefNannyDeclarations
  1696. PyObject *__pyx_t_1 = NULL;
  1697. int __pyx_t_2;
  1698. int __pyx_t_3;
  1699. PyObject *__pyx_t_4 = NULL;
  1700. int __pyx_t_5;
  1701. PyObject *__pyx_t_6 = NULL;
  1702. __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  1703. /* "(tree fragment)":3
  1704. * def __reduce_cython__(self):
  1705. * cdef bint use_setstate
  1706. * state = (self.name, self.wrapped) # <<<<<<<<<<<<<<
  1707. * _dict = getattr(self, '__dict__', None)
  1708. * if _dict is not None:
  1709. */
  1710. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  1711. __Pyx_GOTREF(__pyx_t_1);
  1712. __Pyx_INCREF(__pyx_v_self->name);
  1713. __Pyx_GIVEREF(__pyx_v_self->name);
  1714. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
  1715. __Pyx_INCREF(__pyx_v_self->wrapped);
  1716. __Pyx_GIVEREF(__pyx_v_self->wrapped);
  1717. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->wrapped);
  1718. __pyx_v_state = ((PyObject*)__pyx_t_1);
  1719. __pyx_t_1 = 0;
  1720. /* "(tree fragment)":4
  1721. * cdef bint use_setstate
  1722. * state = (self.name, self.wrapped)
  1723. * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
  1724. * if _dict is not None:
  1725. * state += (_dict,)
  1726. */
  1727. __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  1728. __Pyx_GOTREF(__pyx_t_1);
  1729. __pyx_v__dict = __pyx_t_1;
  1730. __pyx_t_1 = 0;
  1731. /* "(tree fragment)":5
  1732. * state = (self.name, self.wrapped)
  1733. * _dict = getattr(self, '__dict__', None)
  1734. * if _dict is not None: # <<<<<<<<<<<<<<
  1735. * state += (_dict,)
  1736. * use_setstate = True
  1737. */
  1738. __pyx_t_2 = (__pyx_v__dict != Py_None);
  1739. __pyx_t_3 = (__pyx_t_2 != 0);
  1740. if (__pyx_t_3) {
  1741. /* "(tree fragment)":6
  1742. * _dict = getattr(self, '__dict__', None)
  1743. * if _dict is not None:
  1744. * state += (_dict,) # <<<<<<<<<<<<<<
  1745. * use_setstate = True
  1746. * else:
  1747. */
  1748. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  1749. __Pyx_GOTREF(__pyx_t_1);
  1750. __Pyx_INCREF(__pyx_v__dict);
  1751. __Pyx_GIVEREF(__pyx_v__dict);
  1752. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
  1753. __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
  1754. __Pyx_GOTREF(__pyx_t_4);
  1755. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1756. __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
  1757. __pyx_t_4 = 0;
  1758. /* "(tree fragment)":7
  1759. * if _dict is not None:
  1760. * state += (_dict,)
  1761. * use_setstate = True # <<<<<<<<<<<<<<
  1762. * else:
  1763. * use_setstate = self.name is not None or self.wrapped is not None
  1764. */
  1765. __pyx_v_use_setstate = 1;
  1766. /* "(tree fragment)":5
  1767. * state = (self.name, self.wrapped)
  1768. * _dict = getattr(self, '__dict__', None)
  1769. * if _dict is not None: # <<<<<<<<<<<<<<
  1770. * state += (_dict,)
  1771. * use_setstate = True
  1772. */
  1773. goto __pyx_L3;
  1774. }
  1775. /* "(tree fragment)":9
  1776. * use_setstate = True
  1777. * else:
  1778. * use_setstate = self.name is not None or self.wrapped is not None # <<<<<<<<<<<<<<
  1779. * if use_setstate:
  1780. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
  1781. */
  1782. /*else*/ {
  1783. __pyx_t_2 = (__pyx_v_self->name != Py_None);
  1784. __pyx_t_5 = (__pyx_t_2 != 0);
  1785. if (!__pyx_t_5) {
  1786. } else {
  1787. __pyx_t_3 = __pyx_t_5;
  1788. goto __pyx_L4_bool_binop_done;
  1789. }
  1790. __pyx_t_5 = (__pyx_v_self->wrapped != Py_None);
  1791. __pyx_t_2 = (__pyx_t_5 != 0);
  1792. __pyx_t_3 = __pyx_t_2;
  1793. __pyx_L4_bool_binop_done:;
  1794. __pyx_v_use_setstate = __pyx_t_3;
  1795. }
  1796. __pyx_L3:;
  1797. /* "(tree fragment)":10
  1798. * else:
  1799. * use_setstate = self.name is not None or self.wrapped is not None
  1800. * if use_setstate: # <<<<<<<<<<<<<<
  1801. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
  1802. * else:
  1803. */
  1804. __pyx_t_3 = (__pyx_v_use_setstate != 0);
  1805. if (__pyx_t_3) {
  1806. /* "(tree fragment)":11
  1807. * use_setstate = self.name is not None or self.wrapped is not None
  1808. * if use_setstate:
  1809. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state # <<<<<<<<<<<<<<
  1810. * else:
  1811. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
  1812. */
  1813. __Pyx_XDECREF(__pyx_r);
  1814. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_reify); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error)
  1815. __Pyx_GOTREF(__pyx_t_4);
  1816. __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
  1817. __Pyx_GOTREF(__pyx_t_1);
  1818. __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  1819. __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  1820. PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  1821. __Pyx_INCREF(__pyx_int_124832655);
  1822. __Pyx_GIVEREF(__pyx_int_124832655);
  1823. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_124832655);
  1824. __Pyx_INCREF(Py_None);
  1825. __Pyx_GIVEREF(Py_None);
  1826. PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
  1827. __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 11, __pyx_L1_error)
  1828. __Pyx_GOTREF(__pyx_t_6);
  1829. __Pyx_GIVEREF(__pyx_t_4);
  1830. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  1831. __Pyx_GIVEREF(__pyx_t_1);
  1832. PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  1833. __Pyx_INCREF(__pyx_v_state);
  1834. __Pyx_GIVEREF(__pyx_v_state);
  1835. PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
  1836. __pyx_t_4 = 0;
  1837. __pyx_t_1 = 0;
  1838. __pyx_r = __pyx_t_6;
  1839. __pyx_t_6 = 0;
  1840. goto __pyx_L0;
  1841. /* "(tree fragment)":10
  1842. * else:
  1843. * use_setstate = self.name is not None or self.wrapped is not None
  1844. * if use_setstate: # <<<<<<<<<<<<<<
  1845. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
  1846. * else:
  1847. */
  1848. }
  1849. /* "(tree fragment)":13
  1850. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
  1851. * else:
  1852. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state) # <<<<<<<<<<<<<<
  1853. * def __setstate_cython__(self, __pyx_state):
  1854. * __pyx_unpickle_reify__set_state(self, __pyx_state)
  1855. */
  1856. /*else*/ {
  1857. __Pyx_XDECREF(__pyx_r);
  1858. __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_reify); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
  1859. __Pyx_GOTREF(__pyx_t_6);
  1860. __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
  1861. __Pyx_GOTREF(__pyx_t_1);
  1862. __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  1863. __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  1864. PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  1865. __Pyx_INCREF(__pyx_int_124832655);
  1866. __Pyx_GIVEREF(__pyx_int_124832655);
  1867. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_124832655);
  1868. __Pyx_INCREF(__pyx_v_state);
  1869. __Pyx_GIVEREF(__pyx_v_state);
  1870. PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
  1871. __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
  1872. __Pyx_GOTREF(__pyx_t_4);
  1873. __Pyx_GIVEREF(__pyx_t_6);
  1874. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  1875. __Pyx_GIVEREF(__pyx_t_1);
  1876. PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  1877. __pyx_t_6 = 0;
  1878. __pyx_t_1 = 0;
  1879. __pyx_r = __pyx_t_4;
  1880. __pyx_t_4 = 0;
  1881. goto __pyx_L0;
  1882. }
  1883. /* "(tree fragment)":1
  1884. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  1885. * cdef bint use_setstate
  1886. * state = (self.name, self.wrapped)
  1887. */
  1888. /* function exit code */
  1889. __pyx_L1_error:;
  1890. __Pyx_XDECREF(__pyx_t_1);
  1891. __Pyx_XDECREF(__pyx_t_4);
  1892. __Pyx_XDECREF(__pyx_t_6);
  1893. __Pyx_AddTraceback("aiohttp._helpers.reify.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1894. __pyx_r = NULL;
  1895. __pyx_L0:;
  1896. __Pyx_XDECREF(__pyx_v_state);
  1897. __Pyx_XDECREF(__pyx_v__dict);
  1898. __Pyx_XGIVEREF(__pyx_r);
  1899. __Pyx_RefNannyFinishContext();
  1900. return __pyx_r;
  1901. }
  1902. /* "(tree fragment)":14
  1903. * else:
  1904. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
  1905. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  1906. * __pyx_unpickle_reify__set_state(self, __pyx_state)
  1907. */
  1908. /* Python wrapper */
  1909. static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
  1910. static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  1911. PyObject *__pyx_r = 0;
  1912. __Pyx_RefNannyDeclarations
  1913. __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  1914. __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
  1915. /* function exit code */
  1916. __Pyx_RefNannyFinishContext();
  1917. return __pyx_r;
  1918. }
  1919. static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  1920. PyObject *__pyx_r = NULL;
  1921. __Pyx_RefNannyDeclarations
  1922. PyObject *__pyx_t_1 = NULL;
  1923. __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  1924. /* "(tree fragment)":15
  1925. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
  1926. * def __setstate_cython__(self, __pyx_state):
  1927. * __pyx_unpickle_reify__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
  1928. */
  1929. if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
  1930. __pyx_t_1 = __pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
  1931. __Pyx_GOTREF(__pyx_t_1);
  1932. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1933. /* "(tree fragment)":14
  1934. * else:
  1935. * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
  1936. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  1937. * __pyx_unpickle_reify__set_state(self, __pyx_state)
  1938. */
  1939. /* function exit code */
  1940. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  1941. goto __pyx_L0;
  1942. __pyx_L1_error:;
  1943. __Pyx_XDECREF(__pyx_t_1);
  1944. __Pyx_AddTraceback("aiohttp._helpers.reify.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1945. __pyx_r = NULL;
  1946. __pyx_L0:;
  1947. __Pyx_XGIVEREF(__pyx_r);
  1948. __Pyx_RefNannyFinishContext();
  1949. return __pyx_r;
  1950. }
  1951. /* "(tree fragment)":1
  1952. * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
  1953. * if __pyx_checksum != 0x770cb8f:
  1954. * from pickle import PickleError as __pyx_PickleError
  1955. */
  1956. /* Python wrapper */
  1957. static PyObject *__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1958. static PyMethodDef __pyx_mdef_7aiohttp_8_helpers_1__pyx_unpickle_reify = {"__pyx_unpickle_reify", (PyCFunction)__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify, METH_VARARGS|METH_KEYWORDS, 0};
  1959. static PyObject *__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1960. PyObject *__pyx_v___pyx_type = 0;
  1961. long __pyx_v___pyx_checksum;
  1962. PyObject *__pyx_v___pyx_state = 0;
  1963. PyObject *__pyx_r = 0;
  1964. __Pyx_RefNannyDeclarations
  1965. __Pyx_RefNannySetupContext("__pyx_unpickle_reify (wrapper)", 0);
  1966. {
  1967. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
  1968. PyObject* values[3] = {0,0,0};
  1969. if (unlikely(__pyx_kwds)) {
  1970. Py_ssize_t kw_args;
  1971. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1972. switch (pos_args) {
  1973. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1974. CYTHON_FALLTHROUGH;
  1975. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1976. CYTHON_FALLTHROUGH;
  1977. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1978. CYTHON_FALLTHROUGH;
  1979. case 0: break;
  1980. default: goto __pyx_L5_argtuple_error;
  1981. }
  1982. kw_args = PyDict_Size(__pyx_kwds);
  1983. switch (pos_args) {
  1984. case 0:
  1985. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
  1986. else goto __pyx_L5_argtuple_error;
  1987. CYTHON_FALLTHROUGH;
  1988. case 1:
  1989. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
  1990. else {
  1991. __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
  1992. }
  1993. CYTHON_FALLTHROUGH;
  1994. case 2:
  1995. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
  1996. else {
  1997. __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
  1998. }
  1999. }
  2000. if (unlikely(kw_args > 0)) {
  2001. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_reify") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
  2002. }
  2003. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  2004. goto __pyx_L5_argtuple_error;
  2005. } else {
  2006. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2007. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2008. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2009. }
  2010. __pyx_v___pyx_type = values[0];
  2011. __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
  2012. __pyx_v___pyx_state = values[2];
  2013. }
  2014. goto __pyx_L4_argument_unpacking_done;
  2015. __pyx_L5_argtuple_error:;
  2016. __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  2017. __pyx_L3_error:;
  2018. __Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2019. __Pyx_RefNannyFinishContext();
  2020. return NULL;
  2021. __pyx_L4_argument_unpacking_done:;
  2022. __pyx_r = __pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
  2023. /* function exit code */
  2024. __Pyx_RefNannyFinishContext();
  2025. return __pyx_r;
  2026. }
  2027. static PyObject *__pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  2028. PyObject *__pyx_v___pyx_PickleError = NULL;
  2029. PyObject *__pyx_v___pyx_result = NULL;
  2030. PyObject *__pyx_r = NULL;
  2031. __Pyx_RefNannyDeclarations
  2032. int __pyx_t_1;
  2033. PyObject *__pyx_t_2 = NULL;
  2034. PyObject *__pyx_t_3 = NULL;
  2035. PyObject *__pyx_t_4 = NULL;
  2036. PyObject *__pyx_t_5 = NULL;
  2037. PyObject *__pyx_t_6 = NULL;
  2038. int __pyx_t_7;
  2039. __Pyx_RefNannySetupContext("__pyx_unpickle_reify", 0);
  2040. /* "(tree fragment)":2
  2041. * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state):
  2042. * if __pyx_checksum != 0x770cb8f: # <<<<<<<<<<<<<<
  2043. * from pickle import PickleError as __pyx_PickleError
  2044. * raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
  2045. */
  2046. __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x770cb8f) != 0);
  2047. if (__pyx_t_1) {
  2048. /* "(tree fragment)":3
  2049. * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state):
  2050. * if __pyx_checksum != 0x770cb8f:
  2051. * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
  2052. * raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
  2053. * __pyx_result = reify.__new__(__pyx_type)
  2054. */
  2055. __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  2056. __Pyx_GOTREF(__pyx_t_2);
  2057. __Pyx_INCREF(__pyx_n_s_PickleError);
  2058. __Pyx_GIVEREF(__pyx_n_s_PickleError);
  2059. PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
  2060. __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
  2061. __Pyx_GOTREF(__pyx_t_3);
  2062. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2063. __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  2064. __Pyx_GOTREF(__pyx_t_2);
  2065. __Pyx_INCREF(__pyx_t_2);
  2066. __pyx_v___pyx_PickleError = __pyx_t_2;
  2067. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2068. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2069. /* "(tree fragment)":4
  2070. * if __pyx_checksum != 0x770cb8f:
  2071. * from pickle import PickleError as __pyx_PickleError
  2072. * raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum) # <<<<<<<<<<<<<<
  2073. * __pyx_result = reify.__new__(__pyx_type)
  2074. * if __pyx_state is not None:
  2075. */
  2076. __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
  2077. __Pyx_GOTREF(__pyx_t_2);
  2078. __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
  2079. __Pyx_GOTREF(__pyx_t_4);
  2080. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2081. __Pyx_INCREF(__pyx_v___pyx_PickleError);
  2082. __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
  2083. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  2084. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
  2085. if (likely(__pyx_t_5)) {
  2086. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  2087. __Pyx_INCREF(__pyx_t_5);
  2088. __Pyx_INCREF(function);
  2089. __Pyx_DECREF_SET(__pyx_t_2, function);
  2090. }
  2091. }
  2092. if (!__pyx_t_5) {
  2093. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
  2094. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2095. __Pyx_GOTREF(__pyx_t_3);
  2096. } else {
  2097. #if CYTHON_FAST_PYCALL
  2098. if (PyFunction_Check(__pyx_t_2)) {
  2099. PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
  2100. __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
  2101. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  2102. __Pyx_GOTREF(__pyx_t_3);
  2103. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2104. } else
  2105. #endif
  2106. #if CYTHON_FAST_PYCCALL
  2107. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  2108. PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
  2109. __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
  2110. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  2111. __Pyx_GOTREF(__pyx_t_3);
  2112. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2113. } else
  2114. #endif
  2115. {
  2116. __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
  2117. __Pyx_GOTREF(__pyx_t_6);
  2118. __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
  2119. __Pyx_GIVEREF(__pyx_t_4);
  2120. PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
  2121. __pyx_t_4 = 0;
  2122. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
  2123. __Pyx_GOTREF(__pyx_t_3);
  2124. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2125. }
  2126. }
  2127. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2128. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  2129. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2130. __PYX_ERR(1, 4, __pyx_L1_error)
  2131. /* "(tree fragment)":2
  2132. * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state):
  2133. * if __pyx_checksum != 0x770cb8f: # <<<<<<<<<<<<<<
  2134. * from pickle import PickleError as __pyx_PickleError
  2135. * raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
  2136. */
  2137. }
  2138. /* "(tree fragment)":5
  2139. * from pickle import PickleError as __pyx_PickleError
  2140. * raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
  2141. * __pyx_result = reify.__new__(__pyx_type) # <<<<<<<<<<<<<<
  2142. * if __pyx_state is not None:
  2143. * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
  2144. */
  2145. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7aiohttp_8_helpers_reify), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  2146. __Pyx_GOTREF(__pyx_t_2);
  2147. __pyx_t_6 = NULL;
  2148. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  2149. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  2150. if (likely(__pyx_t_6)) {
  2151. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  2152. __Pyx_INCREF(__pyx_t_6);
  2153. __Pyx_INCREF(function);
  2154. __Pyx_DECREF_SET(__pyx_t_2, function);
  2155. }
  2156. }
  2157. if (!__pyx_t_6) {
  2158. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  2159. __Pyx_GOTREF(__pyx_t_3);
  2160. } else {
  2161. #if CYTHON_FAST_PYCALL
  2162. if (PyFunction_Check(__pyx_t_2)) {
  2163. PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
  2164. __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  2165. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  2166. __Pyx_GOTREF(__pyx_t_3);
  2167. } else
  2168. #endif
  2169. #if CYTHON_FAST_PYCCALL
  2170. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  2171. PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
  2172. __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  2173. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  2174. __Pyx_GOTREF(__pyx_t_3);
  2175. } else
  2176. #endif
  2177. {
  2178. __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  2179. __Pyx_GOTREF(__pyx_t_4);
  2180. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
  2181. __Pyx_INCREF(__pyx_v___pyx_type);
  2182. __Pyx_GIVEREF(__pyx_v___pyx_type);
  2183. PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
  2184. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  2185. __Pyx_GOTREF(__pyx_t_3);
  2186. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2187. }
  2188. }
  2189. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2190. __pyx_v___pyx_result = __pyx_t_3;
  2191. __pyx_t_3 = 0;
  2192. /* "(tree fragment)":6
  2193. * raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
  2194. * __pyx_result = reify.__new__(__pyx_type)
  2195. * if __pyx_state is not None: # <<<<<<<<<<<<<<
  2196. * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
  2197. * return __pyx_result
  2198. */
  2199. __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  2200. __pyx_t_7 = (__pyx_t_1 != 0);
  2201. if (__pyx_t_7) {
  2202. /* "(tree fragment)":7
  2203. * __pyx_result = reify.__new__(__pyx_type)
  2204. * if __pyx_state is not None:
  2205. * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
  2206. * return __pyx_result
  2207. * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
  2208. */
  2209. if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  2210. __pyx_t_3 = __pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  2211. __Pyx_GOTREF(__pyx_t_3);
  2212. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2213. /* "(tree fragment)":6
  2214. * raise __pyx_PickleError("Incompatible checksums (%s vs 0x770cb8f = (name, wrapped))" % __pyx_checksum)
  2215. * __pyx_result = reify.__new__(__pyx_type)
  2216. * if __pyx_state is not None: # <<<<<<<<<<<<<<
  2217. * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
  2218. * return __pyx_result
  2219. */
  2220. }
  2221. /* "(tree fragment)":8
  2222. * if __pyx_state is not None:
  2223. * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
  2224. * return __pyx_result # <<<<<<<<<<<<<<
  2225. * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
  2226. * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
  2227. */
  2228. __Pyx_XDECREF(__pyx_r);
  2229. __Pyx_INCREF(__pyx_v___pyx_result);
  2230. __pyx_r = __pyx_v___pyx_result;
  2231. goto __pyx_L0;
  2232. /* "(tree fragment)":1
  2233. * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
  2234. * if __pyx_checksum != 0x770cb8f:
  2235. * from pickle import PickleError as __pyx_PickleError
  2236. */
  2237. /* function exit code */
  2238. __pyx_L1_error:;
  2239. __Pyx_XDECREF(__pyx_t_2);
  2240. __Pyx_XDECREF(__pyx_t_3);
  2241. __Pyx_XDECREF(__pyx_t_4);
  2242. __Pyx_XDECREF(__pyx_t_5);
  2243. __Pyx_XDECREF(__pyx_t_6);
  2244. __Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2245. __pyx_r = NULL;
  2246. __pyx_L0:;
  2247. __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  2248. __Pyx_XDECREF(__pyx_v___pyx_result);
  2249. __Pyx_XGIVEREF(__pyx_r);
  2250. __Pyx_RefNannyFinishContext();
  2251. return __pyx_r;
  2252. }
  2253. /* "(tree fragment)":9
  2254. * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
  2255. * return __pyx_result
  2256. * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
  2257. * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
  2258. * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
  2259. */
  2260. static PyObject *__pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  2261. PyObject *__pyx_r = NULL;
  2262. __Pyx_RefNannyDeclarations
  2263. PyObject *__pyx_t_1 = NULL;
  2264. int __pyx_t_2;
  2265. Py_ssize_t __pyx_t_3;
  2266. int __pyx_t_4;
  2267. int __pyx_t_5;
  2268. PyObject *__pyx_t_6 = NULL;
  2269. PyObject *__pyx_t_7 = NULL;
  2270. PyObject *__pyx_t_8 = NULL;
  2271. PyObject *__pyx_t_9 = NULL;
  2272. __Pyx_RefNannySetupContext("__pyx_unpickle_reify__set_state", 0);
  2273. /* "(tree fragment)":10
  2274. * return __pyx_result
  2275. * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
  2276. * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1] # <<<<<<<<<<<<<<
  2277. * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
  2278. * __pyx_result.__dict__.update(__pyx_state[2])
  2279. */
  2280. if (unlikely(__pyx_v___pyx_state == Py_None)) {
  2281. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
  2282. __PYX_ERR(1, 10, __pyx_L1_error)
  2283. }
  2284. __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
  2285. __Pyx_GOTREF(__pyx_t_1);
  2286. __Pyx_GIVEREF(__pyx_t_1);
  2287. __Pyx_GOTREF(__pyx_v___pyx_result->name);
  2288. __Pyx_DECREF(__pyx_v___pyx_result->name);
  2289. __pyx_v___pyx_result->name = __pyx_t_1;
  2290. __pyx_t_1 = 0;
  2291. if (unlikely(__pyx_v___pyx_state == Py_None)) {
  2292. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
  2293. __PYX_ERR(1, 10, __pyx_L1_error)
  2294. }
  2295. __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
  2296. __Pyx_GOTREF(__pyx_t_1);
  2297. __Pyx_GIVEREF(__pyx_t_1);
  2298. __Pyx_GOTREF(__pyx_v___pyx_result->wrapped);
  2299. __Pyx_DECREF(__pyx_v___pyx_result->wrapped);
  2300. __pyx_v___pyx_result->wrapped = __pyx_t_1;
  2301. __pyx_t_1 = 0;
  2302. /* "(tree fragment)":11
  2303. * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
  2304. * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
  2305. * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
  2306. * __pyx_result.__dict__.update(__pyx_state[2])
  2307. */
  2308. if (unlikely(__pyx_v___pyx_state == Py_None)) {
  2309. PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
  2310. __PYX_ERR(1, 11, __pyx_L1_error)
  2311. }
  2312. __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
  2313. __pyx_t_4 = ((__pyx_t_3 > 2) != 0);
  2314. if (__pyx_t_4) {
  2315. } else {
  2316. __pyx_t_2 = __pyx_t_4;
  2317. goto __pyx_L4_bool_binop_done;
  2318. }
  2319. __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
  2320. __pyx_t_5 = (__pyx_t_4 != 0);
  2321. __pyx_t_2 = __pyx_t_5;
  2322. __pyx_L4_bool_binop_done:;
  2323. if (__pyx_t_2) {
  2324. /* "(tree fragment)":12
  2325. * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
  2326. * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
  2327. * __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<<
  2328. */
  2329. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
  2330. __Pyx_GOTREF(__pyx_t_6);
  2331. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
  2332. __Pyx_GOTREF(__pyx_t_7);
  2333. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2334. if (unlikely(__pyx_v___pyx_state == Py_None)) {
  2335. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
  2336. __PYX_ERR(1, 12, __pyx_L1_error)
  2337. }
  2338. __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
  2339. __Pyx_GOTREF(__pyx_t_6);
  2340. __pyx_t_8 = NULL;
  2341. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  2342. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
  2343. if (likely(__pyx_t_8)) {
  2344. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  2345. __Pyx_INCREF(__pyx_t_8);
  2346. __Pyx_INCREF(function);
  2347. __Pyx_DECREF_SET(__pyx_t_7, function);
  2348. }
  2349. }
  2350. if (!__pyx_t_8) {
  2351. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  2352. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2353. __Pyx_GOTREF(__pyx_t_1);
  2354. } else {
  2355. #if CYTHON_FAST_PYCALL
  2356. if (PyFunction_Check(__pyx_t_7)) {
  2357. PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
  2358. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  2359. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  2360. __Pyx_GOTREF(__pyx_t_1);
  2361. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2362. } else
  2363. #endif
  2364. #if CYTHON_FAST_PYCCALL
  2365. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  2366. PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
  2367. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  2368. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  2369. __Pyx_GOTREF(__pyx_t_1);
  2370. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2371. } else
  2372. #endif
  2373. {
  2374. __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
  2375. __Pyx_GOTREF(__pyx_t_9);
  2376. __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
  2377. __Pyx_GIVEREF(__pyx_t_6);
  2378. PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
  2379. __pyx_t_6 = 0;
  2380. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  2381. __Pyx_GOTREF(__pyx_t_1);
  2382. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  2383. }
  2384. }
  2385. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  2386. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2387. /* "(tree fragment)":11
  2388. * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
  2389. * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
  2390. * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
  2391. * __pyx_result.__dict__.update(__pyx_state[2])
  2392. */
  2393. }
  2394. /* "(tree fragment)":9
  2395. * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
  2396. * return __pyx_result
  2397. * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
  2398. * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
  2399. * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
  2400. */
  2401. /* function exit code */
  2402. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  2403. goto __pyx_L0;
  2404. __pyx_L1_error:;
  2405. __Pyx_XDECREF(__pyx_t_1);
  2406. __Pyx_XDECREF(__pyx_t_6);
  2407. __Pyx_XDECREF(__pyx_t_7);
  2408. __Pyx_XDECREF(__pyx_t_8);
  2409. __Pyx_XDECREF(__pyx_t_9);
  2410. __Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2411. __pyx_r = 0;
  2412. __pyx_L0:;
  2413. __Pyx_XGIVEREF(__pyx_r);
  2414. __Pyx_RefNannyFinishContext();
  2415. return __pyx_r;
  2416. }
  2417. static PyObject *__pyx_tp_new_7aiohttp_8_helpers_reify(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  2418. struct __pyx_obj_7aiohttp_8_helpers_reify *p;
  2419. PyObject *o;
  2420. if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
  2421. o = (*t->tp_alloc)(t, 0);
  2422. } else {
  2423. o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  2424. }
  2425. if (unlikely(!o)) return 0;
  2426. p = ((struct __pyx_obj_7aiohttp_8_helpers_reify *)o);
  2427. p->wrapped = Py_None; Py_INCREF(Py_None);
  2428. p->name = Py_None; Py_INCREF(Py_None);
  2429. return o;
  2430. }
  2431. static void __pyx_tp_dealloc_7aiohttp_8_helpers_reify(PyObject *o) {
  2432. struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
  2433. #if CYTHON_USE_TP_FINALIZE
  2434. if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
  2435. if (PyObject_CallFinalizerFromDealloc(o)) return;
  2436. }
  2437. #endif
  2438. PyObject_GC_UnTrack(o);
  2439. Py_CLEAR(p->wrapped);
  2440. Py_CLEAR(p->name);
  2441. (*Py_TYPE(o)->tp_free)(o);
  2442. }
  2443. static int __pyx_tp_traverse_7aiohttp_8_helpers_reify(PyObject *o, visitproc v, void *a) {
  2444. int e;
  2445. struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
  2446. if (p->wrapped) {
  2447. e = (*v)(p->wrapped, a); if (e) return e;
  2448. }
  2449. if (p->name) {
  2450. e = (*v)(p->name, a); if (e) return e;
  2451. }
  2452. return 0;
  2453. }
  2454. static int __pyx_tp_clear_7aiohttp_8_helpers_reify(PyObject *o) {
  2455. PyObject* tmp;
  2456. struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
  2457. tmp = ((PyObject*)p->wrapped);
  2458. p->wrapped = Py_None; Py_INCREF(Py_None);
  2459. Py_XDECREF(tmp);
  2460. tmp = ((PyObject*)p->name);
  2461. p->name = Py_None; Py_INCREF(Py_None);
  2462. Py_XDECREF(tmp);
  2463. return 0;
  2464. }
  2465. static PyObject *__pyx_tp_descr_get_7aiohttp_8_helpers_reify(PyObject *o, PyObject *i, PyObject *c) {
  2466. PyObject *r = 0;
  2467. if (!i) i = Py_None;
  2468. if (!c) c = Py_None;
  2469. r = __pyx_pw_7aiohttp_8_helpers_5reify_3__get__(o, i, c);
  2470. return r;
  2471. }
  2472. static int __pyx_tp_descr_set_7aiohttp_8_helpers_reify(PyObject *o, PyObject *i, PyObject *v) {
  2473. if (v) {
  2474. return __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(o, i, v);
  2475. }
  2476. else {
  2477. PyErr_SetString(PyExc_NotImplementedError, "__delete__");
  2478. return -1;
  2479. }
  2480. }
  2481. static PyObject *__pyx_getprop_7aiohttp_8_helpers_5reify___doc__(PyObject *o, CYTHON_UNUSED void *x) {
  2482. return __pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(o);
  2483. }
  2484. static PyMethodDef __pyx_methods_7aiohttp_8_helpers_reify[] = {
  2485. {"__reduce_cython__", (PyCFunction)__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__, METH_NOARGS, 0},
  2486. {"__setstate_cython__", (PyCFunction)__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__, METH_O, 0},
  2487. {0, 0, 0, 0}
  2488. };
  2489. static struct PyGetSetDef __pyx_getsets_7aiohttp_8_helpers_reify[] = {
  2490. {(char *)"__doc__", __pyx_getprop_7aiohttp_8_helpers_5reify___doc__, 0, (char *)0, 0},
  2491. {0, 0, 0, 0, 0}
  2492. };
  2493. static PyTypeObject __pyx_type_7aiohttp_8_helpers_reify = {
  2494. PyVarObject_HEAD_INIT(0, 0)
  2495. "aiohttp._helpers.reify", /*tp_name*/
  2496. sizeof(struct __pyx_obj_7aiohttp_8_helpers_reify), /*tp_basicsize*/
  2497. 0, /*tp_itemsize*/
  2498. __pyx_tp_dealloc_7aiohttp_8_helpers_reify, /*tp_dealloc*/
  2499. 0, /*tp_print*/
  2500. 0, /*tp_getattr*/
  2501. 0, /*tp_setattr*/
  2502. #if PY_MAJOR_VERSION < 3
  2503. 0, /*tp_compare*/
  2504. #endif
  2505. #if PY_MAJOR_VERSION >= 3
  2506. 0, /*tp_as_async*/
  2507. #endif
  2508. 0, /*tp_repr*/
  2509. 0, /*tp_as_number*/
  2510. 0, /*tp_as_sequence*/
  2511. 0, /*tp_as_mapping*/
  2512. 0, /*tp_hash*/
  2513. 0, /*tp_call*/
  2514. 0, /*tp_str*/
  2515. 0, /*tp_getattro*/
  2516. 0, /*tp_setattro*/
  2517. 0, /*tp_as_buffer*/
  2518. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  2519. "Use as a class method decorator. It operates almost exactly like\n the Python `@property` decorator, but it puts the result of the\n method it decorates into the instance dict after the first call,\n effectively replacing the function it decorates with an instance\n variable. It is, in Python parlance, a data descriptor.\n\n ", /*tp_doc*/
  2520. __pyx_tp_traverse_7aiohttp_8_helpers_reify, /*tp_traverse*/
  2521. __pyx_tp_clear_7aiohttp_8_helpers_reify, /*tp_clear*/
  2522. 0, /*tp_richcompare*/
  2523. 0, /*tp_weaklistoffset*/
  2524. 0, /*tp_iter*/
  2525. 0, /*tp_iternext*/
  2526. __pyx_methods_7aiohttp_8_helpers_reify, /*tp_methods*/
  2527. 0, /*tp_members*/
  2528. __pyx_getsets_7aiohttp_8_helpers_reify, /*tp_getset*/
  2529. 0, /*tp_base*/
  2530. 0, /*tp_dict*/
  2531. __pyx_tp_descr_get_7aiohttp_8_helpers_reify, /*tp_descr_get*/
  2532. __pyx_tp_descr_set_7aiohttp_8_helpers_reify, /*tp_descr_set*/
  2533. 0, /*tp_dictoffset*/
  2534. __pyx_pw_7aiohttp_8_helpers_5reify_1__init__, /*tp_init*/
  2535. 0, /*tp_alloc*/
  2536. __pyx_tp_new_7aiohttp_8_helpers_reify, /*tp_new*/
  2537. 0, /*tp_free*/
  2538. 0, /*tp_is_gc*/
  2539. 0, /*tp_bases*/
  2540. 0, /*tp_mro*/
  2541. 0, /*tp_cache*/
  2542. 0, /*tp_subclasses*/
  2543. 0, /*tp_weaklist*/
  2544. 0, /*tp_del*/
  2545. 0, /*tp_version_tag*/
  2546. #if PY_VERSION_HEX >= 0x030400a1
  2547. 0, /*tp_finalize*/
  2548. #endif
  2549. };
  2550. static PyMethodDef __pyx_methods[] = {
  2551. {0, 0, 0, 0}
  2552. };
  2553. #if PY_MAJOR_VERSION >= 3
  2554. #if CYTHON_PEP489_MULTI_PHASE_INIT
  2555. static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
  2556. static int __pyx_pymod_exec__helpers(PyObject* module); /*proto*/
  2557. static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  2558. {Py_mod_create, (void*)__pyx_pymod_create},
  2559. {Py_mod_exec, (void*)__pyx_pymod_exec__helpers},
  2560. {0, NULL}
  2561. };
  2562. #endif
  2563. static struct PyModuleDef __pyx_moduledef = {
  2564. PyModuleDef_HEAD_INIT,
  2565. "_helpers",
  2566. 0, /* m_doc */
  2567. #if CYTHON_PEP489_MULTI_PHASE_INIT
  2568. 0, /* m_size */
  2569. #else
  2570. -1, /* m_size */
  2571. #endif
  2572. __pyx_methods /* m_methods */,
  2573. #if CYTHON_PEP489_MULTI_PHASE_INIT
  2574. __pyx_moduledef_slots, /* m_slots */
  2575. #else
  2576. NULL, /* m_reload */
  2577. #endif
  2578. NULL, /* m_traverse */
  2579. NULL, /* m_clear */
  2580. NULL /* m_free */
  2581. };
  2582. #endif
  2583. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  2584. {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  2585. {&__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_k_Incompatible_checksums_s_vs_0x77, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x77), 0, 0, 1, 0},
  2586. {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  2587. {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  2588. {&__pyx_n_s_aiohttp__helpers, __pyx_k_aiohttp__helpers, sizeof(__pyx_k_aiohttp__helpers), 0, 0, 1, 1},
  2589. {&__pyx_n_s_cache, __pyx_k_cache, sizeof(__pyx_k_cache), 0, 0, 1, 1},
  2590. {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  2591. {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  2592. {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  2593. {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  2594. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  2595. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  2596. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  2597. {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  2598. {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  2599. {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  2600. {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  2601. {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  2602. {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  2603. {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  2604. {&__pyx_n_s_pyx_unpickle_reify, __pyx_k_pyx_unpickle_reify, sizeof(__pyx_k_pyx_unpickle_reify), 0, 0, 1, 1},
  2605. {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  2606. {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  2607. {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  2608. {&__pyx_kp_s_reified_property_is_read_only, __pyx_k_reified_property_is_read_only, sizeof(__pyx_k_reified_property_is_read_only), 0, 0, 1, 0},
  2609. {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  2610. {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  2611. {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  2612. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  2613. {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  2614. {&__pyx_n_s_wrapped, __pyx_k_wrapped, sizeof(__pyx_k_wrapped), 0, 0, 1, 1},
  2615. {0, 0, 0, 0, 0, 0, 0}
  2616. };
  2617. static int __Pyx_InitCachedBuiltins(void) {
  2618. __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 25, __pyx_L1_error)
  2619. __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 29, __pyx_L1_error)
  2620. return 0;
  2621. __pyx_L1_error:;
  2622. return -1;
  2623. }
  2624. static int __Pyx_InitCachedConstants(void) {
  2625. __Pyx_RefNannyDeclarations
  2626. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  2627. /* "aiohttp/_helpers.pyx":35
  2628. *
  2629. * def __set__(self, inst, value):
  2630. * raise AttributeError("reified property is read-only") # <<<<<<<<<<<<<<
  2631. */
  2632. __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_reified_property_is_read_only); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 35, __pyx_L1_error)
  2633. __Pyx_GOTREF(__pyx_tuple_);
  2634. __Pyx_GIVEREF(__pyx_tuple_);
  2635. /* "(tree fragment)":1
  2636. * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
  2637. * if __pyx_checksum != 0x770cb8f:
  2638. * from pickle import PickleError as __pyx_PickleError
  2639. */
  2640. __pyx_tuple__2 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 1, __pyx_L1_error)
  2641. __Pyx_GOTREF(__pyx_tuple__2);
  2642. __Pyx_GIVEREF(__pyx_tuple__2);
  2643. __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_reify, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 1, __pyx_L1_error)
  2644. __Pyx_RefNannyFinishContext();
  2645. return 0;
  2646. __pyx_L1_error:;
  2647. __Pyx_RefNannyFinishContext();
  2648. return -1;
  2649. }
  2650. static int __Pyx_InitGlobals(void) {
  2651. if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  2652. __pyx_int_124832655 = PyInt_FromLong(124832655L); if (unlikely(!__pyx_int_124832655)) __PYX_ERR(0, 1, __pyx_L1_error)
  2653. return 0;
  2654. __pyx_L1_error:;
  2655. return -1;
  2656. }
  2657. static int __Pyx_modinit_global_init_code(void); /*proto*/
  2658. static int __Pyx_modinit_variable_export_code(void); /*proto*/
  2659. static int __Pyx_modinit_function_export_code(void); /*proto*/
  2660. static int __Pyx_modinit_type_init_code(void); /*proto*/
  2661. static int __Pyx_modinit_type_import_code(void); /*proto*/
  2662. static int __Pyx_modinit_variable_import_code(void); /*proto*/
  2663. static int __Pyx_modinit_function_import_code(void); /*proto*/
  2664. static int __Pyx_modinit_global_init_code(void) {
  2665. __Pyx_RefNannyDeclarations
  2666. __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  2667. /*--- Global init code ---*/
  2668. __Pyx_RefNannyFinishContext();
  2669. return 0;
  2670. }
  2671. static int __Pyx_modinit_variable_export_code(void) {
  2672. __Pyx_RefNannyDeclarations
  2673. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  2674. /*--- Variable export code ---*/
  2675. __Pyx_RefNannyFinishContext();
  2676. return 0;
  2677. }
  2678. static int __Pyx_modinit_function_export_code(void) {
  2679. __Pyx_RefNannyDeclarations
  2680. __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  2681. /*--- Function export code ---*/
  2682. __Pyx_RefNannyFinishContext();
  2683. return 0;
  2684. }
  2685. static int __Pyx_modinit_type_init_code(void) {
  2686. __Pyx_RefNannyDeclarations
  2687. __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  2688. /*--- Type init code ---*/
  2689. if (PyType_Ready(&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2690. __pyx_type_7aiohttp_8_helpers_reify.tp_print = 0;
  2691. if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_8_helpers_reify.tp_dictoffset && __pyx_type_7aiohttp_8_helpers_reify.tp_getattro == PyObject_GenericGetAttr)) {
  2692. __pyx_type_7aiohttp_8_helpers_reify.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  2693. }
  2694. if (PyObject_SetAttrString(__pyx_m, "reify", (PyObject *)&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2695. if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2696. __pyx_ptype_7aiohttp_8_helpers_reify = &__pyx_type_7aiohttp_8_helpers_reify;
  2697. __Pyx_RefNannyFinishContext();
  2698. return 0;
  2699. __pyx_L1_error:;
  2700. __Pyx_RefNannyFinishContext();
  2701. return -1;
  2702. }
  2703. static int __Pyx_modinit_type_import_code(void) {
  2704. __Pyx_RefNannyDeclarations
  2705. __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  2706. /*--- Type import code ---*/
  2707. __Pyx_RefNannyFinishContext();
  2708. return 0;
  2709. }
  2710. static int __Pyx_modinit_variable_import_code(void) {
  2711. __Pyx_RefNannyDeclarations
  2712. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  2713. /*--- Variable import code ---*/
  2714. __Pyx_RefNannyFinishContext();
  2715. return 0;
  2716. }
  2717. static int __Pyx_modinit_function_import_code(void) {
  2718. __Pyx_RefNannyDeclarations
  2719. __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  2720. /*--- Function import code ---*/
  2721. __Pyx_RefNannyFinishContext();
  2722. return 0;
  2723. }
  2724. #if PY_MAJOR_VERSION < 3
  2725. #ifdef CYTHON_NO_PYINIT_EXPORT
  2726. #define __Pyx_PyMODINIT_FUNC void
  2727. #else
  2728. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  2729. #endif
  2730. #else
  2731. #ifdef CYTHON_NO_PYINIT_EXPORT
  2732. #define __Pyx_PyMODINIT_FUNC PyObject *
  2733. #else
  2734. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  2735. #endif
  2736. #endif
  2737. #ifndef CYTHON_SMALL_CODE
  2738. #if defined(__clang__)
  2739. #define CYTHON_SMALL_CODE
  2740. #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
  2741. #define CYTHON_SMALL_CODE __attribute__((cold))
  2742. #else
  2743. #define CYTHON_SMALL_CODE
  2744. #endif
  2745. #endif
  2746. #if PY_MAJOR_VERSION < 3
  2747. __Pyx_PyMODINIT_FUNC init_helpers(void) CYTHON_SMALL_CODE; /*proto*/
  2748. __Pyx_PyMODINIT_FUNC init_helpers(void)
  2749. #else
  2750. __Pyx_PyMODINIT_FUNC PyInit__helpers(void) CYTHON_SMALL_CODE; /*proto*/
  2751. __Pyx_PyMODINIT_FUNC PyInit__helpers(void)
  2752. #if CYTHON_PEP489_MULTI_PHASE_INIT
  2753. {
  2754. return PyModuleDef_Init(&__pyx_moduledef);
  2755. }
  2756. static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
  2757. PyObject *value = PyObject_GetAttrString(spec, from_name);
  2758. int result = 0;
  2759. if (likely(value)) {
  2760. result = PyDict_SetItemString(moddict, to_name, value);
  2761. Py_DECREF(value);
  2762. } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
  2763. PyErr_Clear();
  2764. } else {
  2765. result = -1;
  2766. }
  2767. return result;
  2768. }
  2769. static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
  2770. PyObject *module = NULL, *moddict, *modname;
  2771. if (__pyx_m)
  2772. return __Pyx_NewRef(__pyx_m);
  2773. modname = PyObject_GetAttrString(spec, "name");
  2774. if (unlikely(!modname)) goto bad;
  2775. module = PyModule_NewObject(modname);
  2776. Py_DECREF(modname);
  2777. if (unlikely(!module)) goto bad;
  2778. moddict = PyModule_GetDict(module);
  2779. if (unlikely(!moddict)) goto bad;
  2780. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
  2781. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
  2782. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
  2783. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
  2784. return module;
  2785. bad:
  2786. Py_XDECREF(module);
  2787. return NULL;
  2788. }
  2789. static int __pyx_pymod_exec__helpers(PyObject *__pyx_pyinit_module)
  2790. #endif
  2791. #endif
  2792. {
  2793. PyObject *__pyx_t_1 = NULL;
  2794. __Pyx_RefNannyDeclarations
  2795. #if CYTHON_PEP489_MULTI_PHASE_INIT
  2796. if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
  2797. #elif PY_MAJOR_VERSION >= 3
  2798. if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  2799. #endif
  2800. #if CYTHON_REFNANNY
  2801. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  2802. if (!__Pyx_RefNanny) {
  2803. PyErr_Clear();
  2804. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  2805. if (!__Pyx_RefNanny)
  2806. Py_FatalError("failed to import 'refnanny' module");
  2807. }
  2808. #endif
  2809. __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__helpers(void)", 0);
  2810. if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2811. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  2812. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  2813. __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  2814. #ifdef __Pyx_CyFunction_USED
  2815. if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2816. #endif
  2817. #ifdef __Pyx_FusedFunction_USED
  2818. if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2819. #endif
  2820. #ifdef __Pyx_Coroutine_USED
  2821. if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2822. #endif
  2823. #ifdef __Pyx_Generator_USED
  2824. if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2825. #endif
  2826. #ifdef __Pyx_AsyncGen_USED
  2827. if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2828. #endif
  2829. #ifdef __Pyx_StopAsyncIteration_USED
  2830. if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2831. #endif
  2832. /*--- Library function declarations ---*/
  2833. /*--- Threads initialization code ---*/
  2834. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  2835. #ifdef WITH_THREAD /* Python build with threading support? */
  2836. PyEval_InitThreads();
  2837. #endif
  2838. #endif
  2839. /*--- Module creation code ---*/
  2840. #if CYTHON_PEP489_MULTI_PHASE_INIT
  2841. __pyx_m = __pyx_pyinit_module;
  2842. Py_INCREF(__pyx_m);
  2843. #else
  2844. #if PY_MAJOR_VERSION < 3
  2845. __pyx_m = Py_InitModule4("_helpers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  2846. #else
  2847. __pyx_m = PyModule_Create(&__pyx_moduledef);
  2848. #endif
  2849. if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  2850. #endif
  2851. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  2852. Py_INCREF(__pyx_d);
  2853. __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  2854. __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  2855. #if CYTHON_COMPILING_IN_PYPY
  2856. Py_INCREF(__pyx_b);
  2857. #endif
  2858. if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  2859. /*--- Initialize various global constants etc. ---*/
  2860. if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2861. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  2862. if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2863. #endif
  2864. if (__pyx_module_is_main_aiohttp___helpers) {
  2865. if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2866. }
  2867. #if PY_MAJOR_VERSION >= 3
  2868. {
  2869. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  2870. if (!PyDict_GetItemString(modules, "aiohttp._helpers")) {
  2871. if (unlikely(PyDict_SetItemString(modules, "aiohttp._helpers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  2872. }
  2873. }
  2874. #endif
  2875. /*--- Builtin init code ---*/
  2876. if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2877. /*--- Constants init code ---*/
  2878. if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2879. /*--- Global type/function init code ---*/
  2880. (void)__Pyx_modinit_global_init_code();
  2881. (void)__Pyx_modinit_variable_export_code();
  2882. (void)__Pyx_modinit_function_export_code();
  2883. if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  2884. (void)__Pyx_modinit_type_import_code();
  2885. (void)__Pyx_modinit_variable_import_code();
  2886. (void)__Pyx_modinit_function_import_code();
  2887. /*--- Execution code ---*/
  2888. #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  2889. if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2890. #endif
  2891. /* "(tree fragment)":1
  2892. * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
  2893. * if __pyx_checksum != 0x770cb8f:
  2894. * from pickle import PickleError as __pyx_PickleError
  2895. */
  2896. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7aiohttp_8_helpers_1__pyx_unpickle_reify, NULL, __pyx_n_s_aiohttp__helpers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  2897. __Pyx_GOTREF(__pyx_t_1);
  2898. if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_reify, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  2899. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2900. /* "aiohttp/_helpers.pyx":1
  2901. * cdef class reify: # <<<<<<<<<<<<<<
  2902. * """Use as a class method decorator. It operates almost exactly like
  2903. * the Python `@property` decorator, but it puts the result of the
  2904. */
  2905. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  2906. __Pyx_GOTREF(__pyx_t_1);
  2907. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  2908. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2909. /*--- Wrapped vars code ---*/
  2910. goto __pyx_L0;
  2911. __pyx_L1_error:;
  2912. __Pyx_XDECREF(__pyx_t_1);
  2913. if (__pyx_m) {
  2914. if (__pyx_d) {
  2915. __Pyx_AddTraceback("init aiohttp._helpers", 0, __pyx_lineno, __pyx_filename);
  2916. }
  2917. Py_DECREF(__pyx_m); __pyx_m = 0;
  2918. } else if (!PyErr_Occurred()) {
  2919. PyErr_SetString(PyExc_ImportError, "init aiohttp._helpers");
  2920. }
  2921. __pyx_L0:;
  2922. __Pyx_RefNannyFinishContext();
  2923. #if CYTHON_PEP489_MULTI_PHASE_INIT
  2924. return (__pyx_m != NULL) ? 0 : -1;
  2925. #elif PY_MAJOR_VERSION >= 3
  2926. return __pyx_m;
  2927. #else
  2928. return;
  2929. #endif
  2930. }
  2931. /* --- Runtime support code --- */
  2932. /* Refnanny */
  2933. #if CYTHON_REFNANNY
  2934. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  2935. PyObject *m = NULL, *p = NULL;
  2936. void *r = NULL;
  2937. m = PyImport_ImportModule((char *)modname);
  2938. if (!m) goto end;
  2939. p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  2940. if (!p) goto end;
  2941. r = PyLong_AsVoidPtr(p);
  2942. end:
  2943. Py_XDECREF(p);
  2944. Py_XDECREF(m);
  2945. return (__Pyx_RefNannyAPIStruct *)r;
  2946. }
  2947. #endif
  2948. /* PyObjectGetAttrStr */
  2949. #if CYTHON_USE_TYPE_SLOTS
  2950. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  2951. PyTypeObject* tp = Py_TYPE(obj);
  2952. if (likely(tp->tp_getattro))
  2953. return tp->tp_getattro(obj, attr_name);
  2954. #if PY_MAJOR_VERSION < 3
  2955. if (likely(tp->tp_getattr))
  2956. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  2957. #endif
  2958. return PyObject_GetAttr(obj, attr_name);
  2959. }
  2960. #endif
  2961. /* GetBuiltinName */
  2962. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  2963. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  2964. if (unlikely(!result)) {
  2965. PyErr_Format(PyExc_NameError,
  2966. #if PY_MAJOR_VERSION >= 3
  2967. "name '%U' is not defined", name);
  2968. #else
  2969. "name '%.200s' is not defined", PyString_AS_STRING(name));
  2970. #endif
  2971. }
  2972. return result;
  2973. }
  2974. /* RaiseDoubleKeywords */
  2975. static void __Pyx_RaiseDoubleKeywordsError(
  2976. const char* func_name,
  2977. PyObject* kw_name)
  2978. {
  2979. PyErr_Format(PyExc_TypeError,
  2980. #if PY_MAJOR_VERSION >= 3
  2981. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  2982. #else
  2983. "%s() got multiple values for keyword argument '%s'", func_name,
  2984. PyString_AsString(kw_name));
  2985. #endif
  2986. }
  2987. /* ParseKeywords */
  2988. static int __Pyx_ParseOptionalKeywords(
  2989. PyObject *kwds,
  2990. PyObject **argnames[],
  2991. PyObject *kwds2,
  2992. PyObject *values[],
  2993. Py_ssize_t num_pos_args,
  2994. const char* function_name)
  2995. {
  2996. PyObject *key = 0, *value = 0;
  2997. Py_ssize_t pos = 0;
  2998. PyObject*** name;
  2999. PyObject*** first_kw_arg = argnames + num_pos_args;
  3000. while (PyDict_Next(kwds, &pos, &key, &value)) {
  3001. name = first_kw_arg;
  3002. while (*name && (**name != key)) name++;
  3003. if (*name) {
  3004. values[name-argnames] = value;
  3005. continue;
  3006. }
  3007. name = first_kw_arg;
  3008. #if PY_MAJOR_VERSION < 3
  3009. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  3010. while (*name) {
  3011. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  3012. && _PyString_Eq(**name, key)) {
  3013. values[name-argnames] = value;
  3014. break;
  3015. }
  3016. name++;
  3017. }
  3018. if (*name) continue;
  3019. else {
  3020. PyObject*** argname = argnames;
  3021. while (argname != first_kw_arg) {
  3022. if ((**argname == key) || (
  3023. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  3024. && _PyString_Eq(**argname, key))) {
  3025. goto arg_passed_twice;
  3026. }
  3027. argname++;
  3028. }
  3029. }
  3030. } else
  3031. #endif
  3032. if (likely(PyUnicode_Check(key))) {
  3033. while (*name) {
  3034. int cmp = (**name == key) ? 0 :
  3035. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  3036. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  3037. #endif
  3038. PyUnicode_Compare(**name, key);
  3039. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  3040. if (cmp == 0) {
  3041. values[name-argnames] = value;
  3042. break;
  3043. }
  3044. name++;
  3045. }
  3046. if (*name) continue;
  3047. else {
  3048. PyObject*** argname = argnames;
  3049. while (argname != first_kw_arg) {
  3050. int cmp = (**argname == key) ? 0 :
  3051. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  3052. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  3053. #endif
  3054. PyUnicode_Compare(**argname, key);
  3055. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  3056. if (cmp == 0) goto arg_passed_twice;
  3057. argname++;
  3058. }
  3059. }
  3060. } else
  3061. goto invalid_keyword_type;
  3062. if (kwds2) {
  3063. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  3064. } else {
  3065. goto invalid_keyword;
  3066. }
  3067. }
  3068. return 0;
  3069. arg_passed_twice:
  3070. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  3071. goto bad;
  3072. invalid_keyword_type:
  3073. PyErr_Format(PyExc_TypeError,
  3074. "%.200s() keywords must be strings", function_name);
  3075. goto bad;
  3076. invalid_keyword:
  3077. PyErr_Format(PyExc_TypeError,
  3078. #if PY_MAJOR_VERSION < 3
  3079. "%.200s() got an unexpected keyword argument '%.200s'",
  3080. function_name, PyString_AsString(key));
  3081. #else
  3082. "%s() got an unexpected keyword argument '%U'",
  3083. function_name, key);
  3084. #endif
  3085. bad:
  3086. return -1;
  3087. }
  3088. /* RaiseArgTupleInvalid */
  3089. static void __Pyx_RaiseArgtupleInvalid(
  3090. const char* func_name,
  3091. int exact,
  3092. Py_ssize_t num_min,
  3093. Py_ssize_t num_max,
  3094. Py_ssize_t num_found)
  3095. {
  3096. Py_ssize_t num_expected;
  3097. const char *more_or_less;
  3098. if (num_found < num_min) {
  3099. num_expected = num_min;
  3100. more_or_less = "at least";
  3101. } else {
  3102. num_expected = num_max;
  3103. more_or_less = "at most";
  3104. }
  3105. if (exact) {
  3106. more_or_less = "exactly";
  3107. }
  3108. PyErr_Format(PyExc_TypeError,
  3109. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  3110. func_name, more_or_less, num_expected,
  3111. (num_expected == 1) ? "" : "s", num_found);
  3112. }
  3113. /* GetItemInt */
  3114. static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  3115. PyObject *r;
  3116. if (!j) return NULL;
  3117. r = PyObject_GetItem(o, j);
  3118. Py_DECREF(j);
  3119. return r;
  3120. }
  3121. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  3122. CYTHON_NCP_UNUSED int wraparound,
  3123. CYTHON_NCP_UNUSED int boundscheck) {
  3124. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  3125. Py_ssize_t wrapped_i = i;
  3126. if (wraparound & unlikely(i < 0)) {
  3127. wrapped_i += PyList_GET_SIZE(o);
  3128. }
  3129. if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
  3130. PyObject *r = PyList_GET_ITEM(o, wrapped_i);
  3131. Py_INCREF(r);
  3132. return r;
  3133. }
  3134. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  3135. #else
  3136. return PySequence_GetItem(o, i);
  3137. #endif
  3138. }
  3139. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  3140. CYTHON_NCP_UNUSED int wraparound,
  3141. CYTHON_NCP_UNUSED int boundscheck) {
  3142. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  3143. Py_ssize_t wrapped_i = i;
  3144. if (wraparound & unlikely(i < 0)) {
  3145. wrapped_i += PyTuple_GET_SIZE(o);
  3146. }
  3147. if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
  3148. PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
  3149. Py_INCREF(r);
  3150. return r;
  3151. }
  3152. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  3153. #else
  3154. return PySequence_GetItem(o, i);
  3155. #endif
  3156. }
  3157. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
  3158. CYTHON_NCP_UNUSED int wraparound,
  3159. CYTHON_NCP_UNUSED int boundscheck) {
  3160. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
  3161. if (is_list || PyList_CheckExact(o)) {
  3162. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  3163. if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
  3164. PyObject *r = PyList_GET_ITEM(o, n);
  3165. Py_INCREF(r);
  3166. return r;
  3167. }
  3168. }
  3169. else if (PyTuple_CheckExact(o)) {
  3170. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  3171. if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
  3172. PyObject *r = PyTuple_GET_ITEM(o, n);
  3173. Py_INCREF(r);
  3174. return r;
  3175. }
  3176. } else {
  3177. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  3178. if (likely(m && m->sq_item)) {
  3179. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  3180. Py_ssize_t l = m->sq_length(o);
  3181. if (likely(l >= 0)) {
  3182. i += l;
  3183. } else {
  3184. if (!PyErr_ExceptionMatches(PyExc_OverflowError))
  3185. return NULL;
  3186. PyErr_Clear();
  3187. }
  3188. }
  3189. return m->sq_item(o, i);
  3190. }
  3191. }
  3192. #else
  3193. if (is_list || PySequence_Check(o)) {
  3194. return PySequence_GetItem(o, i);
  3195. }
  3196. #endif
  3197. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  3198. }
  3199. /* ObjectGetItem */
  3200. #if CYTHON_USE_TYPE_SLOTS
  3201. static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
  3202. PyObject *runerr;
  3203. Py_ssize_t key_value;
  3204. PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
  3205. if (unlikely(!(m && m->sq_item))) {
  3206. PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
  3207. return NULL;
  3208. }
  3209. key_value = __Pyx_PyIndex_AsSsize_t(index);
  3210. if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
  3211. return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
  3212. }
  3213. if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
  3214. PyErr_Clear();
  3215. PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
  3216. }
  3217. return NULL;
  3218. }
  3219. static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
  3220. PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
  3221. if (likely(m && m->mp_subscript)) {
  3222. return m->mp_subscript(obj, key);
  3223. }
  3224. return __Pyx_PyObject_GetIndex(obj, key);
  3225. }
  3226. #endif
  3227. /* SaveResetException */
  3228. #if CYTHON_FAST_THREAD_STATE
  3229. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  3230. #if PY_VERSION_HEX >= 0x030700A3
  3231. *type = tstate->exc_state.exc_type;
  3232. *value = tstate->exc_state.exc_value;
  3233. *tb = tstate->exc_state.exc_traceback;
  3234. #else
  3235. *type = tstate->exc_type;
  3236. *value = tstate->exc_value;
  3237. *tb = tstate->exc_traceback;
  3238. #endif
  3239. Py_XINCREF(*type);
  3240. Py_XINCREF(*value);
  3241. Py_XINCREF(*tb);
  3242. }
  3243. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  3244. PyObject *tmp_type, *tmp_value, *tmp_tb;
  3245. #if PY_VERSION_HEX >= 0x030700A3
  3246. tmp_type = tstate->exc_state.exc_type;
  3247. tmp_value = tstate->exc_state.exc_value;
  3248. tmp_tb = tstate->exc_state.exc_traceback;
  3249. tstate->exc_state.exc_type = type;
  3250. tstate->exc_state.exc_value = value;
  3251. tstate->exc_state.exc_traceback = tb;
  3252. #else
  3253. tmp_type = tstate->exc_type;
  3254. tmp_value = tstate->exc_value;
  3255. tmp_tb = tstate->exc_traceback;
  3256. tstate->exc_type = type;
  3257. tstate->exc_value = value;
  3258. tstate->exc_traceback = tb;
  3259. #endif
  3260. Py_XDECREF(tmp_type);
  3261. Py_XDECREF(tmp_value);
  3262. Py_XDECREF(tmp_tb);
  3263. }
  3264. #endif
  3265. /* PyErrExceptionMatches */
  3266. #if CYTHON_FAST_THREAD_STATE
  3267. static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  3268. Py_ssize_t i, n;
  3269. n = PyTuple_GET_SIZE(tuple);
  3270. #if PY_MAJOR_VERSION >= 3
  3271. for (i=0; i<n; i++) {
  3272. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  3273. }
  3274. #endif
  3275. for (i=0; i<n; i++) {
  3276. if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
  3277. }
  3278. return 0;
  3279. }
  3280. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
  3281. PyObject *exc_type = tstate->curexc_type;
  3282. if (exc_type == err) return 1;
  3283. if (unlikely(!exc_type)) return 0;
  3284. if (unlikely(PyTuple_Check(err)))
  3285. return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
  3286. return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
  3287. }
  3288. #endif
  3289. /* GetException */
  3290. #if CYTHON_FAST_THREAD_STATE
  3291. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  3292. #else
  3293. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
  3294. #endif
  3295. PyObject *local_type, *local_value, *local_tb;
  3296. #if CYTHON_FAST_THREAD_STATE
  3297. PyObject *tmp_type, *tmp_value, *tmp_tb;
  3298. local_type = tstate->curexc_type;
  3299. local_value = tstate->curexc_value;
  3300. local_tb = tstate->curexc_traceback;
  3301. tstate->curexc_type = 0;
  3302. tstate->curexc_value = 0;
  3303. tstate->curexc_traceback = 0;
  3304. #else
  3305. PyErr_Fetch(&local_type, &local_value, &local_tb);
  3306. #endif
  3307. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  3308. #if CYTHON_FAST_THREAD_STATE
  3309. if (unlikely(tstate->curexc_type))
  3310. #else
  3311. if (unlikely(PyErr_Occurred()))
  3312. #endif
  3313. goto bad;
  3314. #if PY_MAJOR_VERSION >= 3
  3315. if (local_tb) {
  3316. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  3317. goto bad;
  3318. }
  3319. #endif
  3320. Py_XINCREF(local_tb);
  3321. Py_XINCREF(local_type);
  3322. Py_XINCREF(local_value);
  3323. *type = local_type;
  3324. *value = local_value;
  3325. *tb = local_tb;
  3326. #if CYTHON_FAST_THREAD_STATE
  3327. #if PY_VERSION_HEX >= 0x030700A3
  3328. tmp_type = tstate->exc_state.exc_type;
  3329. tmp_value = tstate->exc_state.exc_value;
  3330. tmp_tb = tstate->exc_state.exc_traceback;
  3331. tstate->exc_state.exc_type = local_type;
  3332. tstate->exc_state.exc_value = local_value;
  3333. tstate->exc_state.exc_traceback = local_tb;
  3334. #else
  3335. tmp_type = tstate->exc_type;
  3336. tmp_value = tstate->exc_value;
  3337. tmp_tb = tstate->exc_traceback;
  3338. tstate->exc_type = local_type;
  3339. tstate->exc_value = local_value;
  3340. tstate->exc_traceback = local_tb;
  3341. #endif
  3342. Py_XDECREF(tmp_type);
  3343. Py_XDECREF(tmp_value);
  3344. Py_XDECREF(tmp_tb);
  3345. #else
  3346. PyErr_SetExcInfo(local_type, local_value, local_tb);
  3347. #endif
  3348. return 0;
  3349. bad:
  3350. *type = 0;
  3351. *value = 0;
  3352. *tb = 0;
  3353. Py_XDECREF(local_type);
  3354. Py_XDECREF(local_value);
  3355. Py_XDECREF(local_tb);
  3356. return -1;
  3357. }
  3358. /* PyCFunctionFastCall */
  3359. #if CYTHON_FAST_PYCCALL
  3360. static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
  3361. PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
  3362. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  3363. PyObject *self = PyCFunction_GET_SELF(func);
  3364. int flags = PyCFunction_GET_FLAGS(func);
  3365. assert(PyCFunction_Check(func));
  3366. assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
  3367. assert(nargs >= 0);
  3368. assert(nargs == 0 || args != NULL);
  3369. /* _PyCFunction_FastCallDict() must not be called with an exception set,
  3370. because it may clear it (directly or indirectly) and so the
  3371. caller loses its exception */
  3372. assert(!PyErr_Occurred());
  3373. if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
  3374. return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
  3375. } else {
  3376. return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
  3377. }
  3378. }
  3379. #endif
  3380. /* PyFunctionFastCall */
  3381. #if CYTHON_FAST_PYCALL
  3382. #include "frameobject.h"
  3383. static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
  3384. PyObject *globals) {
  3385. PyFrameObject *f;
  3386. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  3387. PyObject **fastlocals;
  3388. Py_ssize_t i;
  3389. PyObject *result;
  3390. assert(globals != NULL);
  3391. /* XXX Perhaps we should create a specialized
  3392. PyFrame_New() that doesn't take locals, but does
  3393. take builtins without sanity checking them.
  3394. */
  3395. assert(tstate != NULL);
  3396. f = PyFrame_New(tstate, co, globals, NULL);
  3397. if (f == NULL) {
  3398. return NULL;
  3399. }
  3400. fastlocals = f->f_localsplus;
  3401. for (i = 0; i < na; i++) {
  3402. Py_INCREF(*args);
  3403. fastlocals[i] = *args++;
  3404. }
  3405. result = PyEval_EvalFrameEx(f,0);
  3406. ++tstate->recursion_depth;
  3407. Py_DECREF(f);
  3408. --tstate->recursion_depth;
  3409. return result;
  3410. }
  3411. #if 1 || PY_VERSION_HEX < 0x030600B1
  3412. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
  3413. PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
  3414. PyObject *globals = PyFunction_GET_GLOBALS(func);
  3415. PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
  3416. PyObject *closure;
  3417. #if PY_MAJOR_VERSION >= 3
  3418. PyObject *kwdefs;
  3419. #endif
  3420. PyObject *kwtuple, **k;
  3421. PyObject **d;
  3422. Py_ssize_t nd;
  3423. Py_ssize_t nk;
  3424. PyObject *result;
  3425. assert(kwargs == NULL || PyDict_Check(kwargs));
  3426. nk = kwargs ? PyDict_Size(kwargs) : 0;
  3427. if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
  3428. return NULL;
  3429. }
  3430. if (
  3431. #if PY_MAJOR_VERSION >= 3
  3432. co->co_kwonlyargcount == 0 &&
  3433. #endif
  3434. likely(kwargs == NULL || nk == 0) &&
  3435. co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  3436. if (argdefs == NULL && co->co_argcount == nargs) {
  3437. result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  3438. goto done;
  3439. }
  3440. else if (nargs == 0 && argdefs != NULL
  3441. && co->co_argcount == Py_SIZE(argdefs)) {
  3442. /* function called with no arguments, but all parameters have
  3443. a default value: use default values as arguments .*/
  3444. args = &PyTuple_GET_ITEM(argdefs, 0);
  3445. result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
  3446. goto done;
  3447. }
  3448. }
  3449. if (kwargs != NULL) {
  3450. Py_ssize_t pos, i;
  3451. kwtuple = PyTuple_New(2 * nk);
  3452. if (kwtuple == NULL) {
  3453. result = NULL;
  3454. goto done;
  3455. }
  3456. k = &PyTuple_GET_ITEM(kwtuple, 0);
  3457. pos = i = 0;
  3458. while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
  3459. Py_INCREF(k[i]);
  3460. Py_INCREF(k[i+1]);
  3461. i += 2;
  3462. }
  3463. nk = i / 2;
  3464. }
  3465. else {
  3466. kwtuple = NULL;
  3467. k = NULL;
  3468. }
  3469. closure = PyFunction_GET_CLOSURE(func);
  3470. #if PY_MAJOR_VERSION >= 3
  3471. kwdefs = PyFunction_GET_KW_DEFAULTS(func);
  3472. #endif
  3473. if (argdefs != NULL) {
  3474. d = &PyTuple_GET_ITEM(argdefs, 0);
  3475. nd = Py_SIZE(argdefs);
  3476. }
  3477. else {
  3478. d = NULL;
  3479. nd = 0;
  3480. }
  3481. #if PY_MAJOR_VERSION >= 3
  3482. result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
  3483. args, nargs,
  3484. k, (int)nk,
  3485. d, (int)nd, kwdefs, closure);
  3486. #else
  3487. result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
  3488. args, nargs,
  3489. k, (int)nk,
  3490. d, (int)nd, closure);
  3491. #endif
  3492. Py_XDECREF(kwtuple);
  3493. done:
  3494. Py_LeaveRecursiveCall();
  3495. return result;
  3496. }
  3497. #endif
  3498. #endif
  3499. /* PyObjectCall */
  3500. #if CYTHON_COMPILING_IN_CPYTHON
  3501. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  3502. PyObject *result;
  3503. ternaryfunc call = func->ob_type->tp_call;
  3504. if (unlikely(!call))
  3505. return PyObject_Call(func, arg, kw);
  3506. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  3507. return NULL;
  3508. result = (*call)(func, arg, kw);
  3509. Py_LeaveRecursiveCall();
  3510. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  3511. PyErr_SetString(
  3512. PyExc_SystemError,
  3513. "NULL result without error in PyObject_Call");
  3514. }
  3515. return result;
  3516. }
  3517. #endif
  3518. /* PyObjectCallMethO */
  3519. #if CYTHON_COMPILING_IN_CPYTHON
  3520. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  3521. PyObject *self, *result;
  3522. PyCFunction cfunc;
  3523. cfunc = PyCFunction_GET_FUNCTION(func);
  3524. self = PyCFunction_GET_SELF(func);
  3525. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  3526. return NULL;
  3527. result = cfunc(self, arg);
  3528. Py_LeaveRecursiveCall();
  3529. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  3530. PyErr_SetString(
  3531. PyExc_SystemError,
  3532. "NULL result without error in PyObject_Call");
  3533. }
  3534. return result;
  3535. }
  3536. #endif
  3537. /* PyObjectCallOneArg */
  3538. #if CYTHON_COMPILING_IN_CPYTHON
  3539. static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  3540. PyObject *result;
  3541. PyObject *args = PyTuple_New(1);
  3542. if (unlikely(!args)) return NULL;
  3543. Py_INCREF(arg);
  3544. PyTuple_SET_ITEM(args, 0, arg);
  3545. result = __Pyx_PyObject_Call(func, args, NULL);
  3546. Py_DECREF(args);
  3547. return result;
  3548. }
  3549. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  3550. #if CYTHON_FAST_PYCALL
  3551. if (PyFunction_Check(func)) {
  3552. return __Pyx_PyFunction_FastCall(func, &arg, 1);
  3553. }
  3554. #endif
  3555. if (likely(PyCFunction_Check(func))) {
  3556. if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
  3557. return __Pyx_PyObject_CallMethO(func, arg);
  3558. #if CYTHON_FAST_PYCCALL
  3559. } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
  3560. return __Pyx_PyCFunction_FastCall(func, &arg, 1);
  3561. #endif
  3562. }
  3563. }
  3564. return __Pyx__PyObject_CallOneArg(func, arg);
  3565. }
  3566. #else
  3567. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  3568. PyObject *result;
  3569. PyObject *args = PyTuple_Pack(1, arg);
  3570. if (unlikely(!args)) return NULL;
  3571. result = __Pyx_PyObject_Call(func, args, NULL);
  3572. Py_DECREF(args);
  3573. return result;
  3574. }
  3575. #endif
  3576. /* PyErrFetchRestore */
  3577. #if CYTHON_FAST_THREAD_STATE
  3578. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  3579. PyObject *tmp_type, *tmp_value, *tmp_tb;
  3580. tmp_type = tstate->curexc_type;
  3581. tmp_value = tstate->curexc_value;
  3582. tmp_tb = tstate->curexc_traceback;
  3583. tstate->curexc_type = type;
  3584. tstate->curexc_value = value;
  3585. tstate->curexc_traceback = tb;
  3586. Py_XDECREF(tmp_type);
  3587. Py_XDECREF(tmp_value);
  3588. Py_XDECREF(tmp_tb);
  3589. }
  3590. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  3591. *type = tstate->curexc_type;
  3592. *value = tstate->curexc_value;
  3593. *tb = tstate->curexc_traceback;
  3594. tstate->curexc_type = 0;
  3595. tstate->curexc_value = 0;
  3596. tstate->curexc_traceback = 0;
  3597. }
  3598. #endif
  3599. /* RaiseException */
  3600. #if PY_MAJOR_VERSION < 3
  3601. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  3602. CYTHON_UNUSED PyObject *cause) {
  3603. __Pyx_PyThreadState_declare
  3604. Py_XINCREF(type);
  3605. if (!value || value == Py_None)
  3606. value = NULL;
  3607. else
  3608. Py_INCREF(value);
  3609. if (!tb || tb == Py_None)
  3610. tb = NULL;
  3611. else {
  3612. Py_INCREF(tb);
  3613. if (!PyTraceBack_Check(tb)) {
  3614. PyErr_SetString(PyExc_TypeError,
  3615. "raise: arg 3 must be a traceback or None");
  3616. goto raise_error;
  3617. }
  3618. }
  3619. if (PyType_Check(type)) {
  3620. #if CYTHON_COMPILING_IN_PYPY
  3621. if (!value) {
  3622. Py_INCREF(Py_None);
  3623. value = Py_None;
  3624. }
  3625. #endif
  3626. PyErr_NormalizeException(&type, &value, &tb);
  3627. } else {
  3628. if (value) {
  3629. PyErr_SetString(PyExc_TypeError,
  3630. "instance exception may not have a separate value");
  3631. goto raise_error;
  3632. }
  3633. value = type;
  3634. type = (PyObject*) Py_TYPE(type);
  3635. Py_INCREF(type);
  3636. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  3637. PyErr_SetString(PyExc_TypeError,
  3638. "raise: exception class must be a subclass of BaseException");
  3639. goto raise_error;
  3640. }
  3641. }
  3642. __Pyx_PyThreadState_assign
  3643. __Pyx_ErrRestore(type, value, tb);
  3644. return;
  3645. raise_error:
  3646. Py_XDECREF(value);
  3647. Py_XDECREF(type);
  3648. Py_XDECREF(tb);
  3649. return;
  3650. }
  3651. #else
  3652. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  3653. PyObject* owned_instance = NULL;
  3654. if (tb == Py_None) {
  3655. tb = 0;
  3656. } else if (tb && !PyTraceBack_Check(tb)) {
  3657. PyErr_SetString(PyExc_TypeError,
  3658. "raise: arg 3 must be a traceback or None");
  3659. goto bad;
  3660. }
  3661. if (value == Py_None)
  3662. value = 0;
  3663. if (PyExceptionInstance_Check(type)) {
  3664. if (value) {
  3665. PyErr_SetString(PyExc_TypeError,
  3666. "instance exception may not have a separate value");
  3667. goto bad;
  3668. }
  3669. value = type;
  3670. type = (PyObject*) Py_TYPE(value);
  3671. } else if (PyExceptionClass_Check(type)) {
  3672. PyObject *instance_class = NULL;
  3673. if (value && PyExceptionInstance_Check(value)) {
  3674. instance_class = (PyObject*) Py_TYPE(value);
  3675. if (instance_class != type) {
  3676. int is_subclass = PyObject_IsSubclass(instance_class, type);
  3677. if (!is_subclass) {
  3678. instance_class = NULL;
  3679. } else if (unlikely(is_subclass == -1)) {
  3680. goto bad;
  3681. } else {
  3682. type = instance_class;
  3683. }
  3684. }
  3685. }
  3686. if (!instance_class) {
  3687. PyObject *args;
  3688. if (!value)
  3689. args = PyTuple_New(0);
  3690. else if (PyTuple_Check(value)) {
  3691. Py_INCREF(value);
  3692. args = value;
  3693. } else
  3694. args = PyTuple_Pack(1, value);
  3695. if (!args)
  3696. goto bad;
  3697. owned_instance = PyObject_Call(type, args, NULL);
  3698. Py_DECREF(args);
  3699. if (!owned_instance)
  3700. goto bad;
  3701. value = owned_instance;
  3702. if (!PyExceptionInstance_Check(value)) {
  3703. PyErr_Format(PyExc_TypeError,
  3704. "calling %R should have returned an instance of "
  3705. "BaseException, not %R",
  3706. type, Py_TYPE(value));
  3707. goto bad;
  3708. }
  3709. }
  3710. } else {
  3711. PyErr_SetString(PyExc_TypeError,
  3712. "raise: exception class must be a subclass of BaseException");
  3713. goto bad;
  3714. }
  3715. if (cause) {
  3716. PyObject *fixed_cause;
  3717. if (cause == Py_None) {
  3718. fixed_cause = NULL;
  3719. } else if (PyExceptionClass_Check(cause)) {
  3720. fixed_cause = PyObject_CallObject(cause, NULL);
  3721. if (fixed_cause == NULL)
  3722. goto bad;
  3723. } else if (PyExceptionInstance_Check(cause)) {
  3724. fixed_cause = cause;
  3725. Py_INCREF(fixed_cause);
  3726. } else {
  3727. PyErr_SetString(PyExc_TypeError,
  3728. "exception causes must derive from "
  3729. "BaseException");
  3730. goto bad;
  3731. }
  3732. PyException_SetCause(value, fixed_cause);
  3733. }
  3734. PyErr_SetObject(type, value);
  3735. if (tb) {
  3736. #if CYTHON_COMPILING_IN_PYPY
  3737. PyObject *tmp_type, *tmp_value, *tmp_tb;
  3738. PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
  3739. Py_INCREF(tb);
  3740. PyErr_Restore(tmp_type, tmp_value, tb);
  3741. Py_XDECREF(tmp_tb);
  3742. #else
  3743. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  3744. PyObject* tmp_tb = tstate->curexc_traceback;
  3745. if (tb != tmp_tb) {
  3746. Py_INCREF(tb);
  3747. tstate->curexc_traceback = tb;
  3748. Py_XDECREF(tmp_tb);
  3749. }
  3750. #endif
  3751. }
  3752. bad:
  3753. Py_XDECREF(owned_instance);
  3754. return;
  3755. }
  3756. #endif
  3757. /* GetAttr */
  3758. static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
  3759. #if CYTHON_USE_TYPE_SLOTS
  3760. #if PY_MAJOR_VERSION >= 3
  3761. if (likely(PyUnicode_Check(n)))
  3762. #else
  3763. if (likely(PyString_Check(n)))
  3764. #endif
  3765. return __Pyx_PyObject_GetAttrStr(o, n);
  3766. #endif
  3767. return PyObject_GetAttr(o, n);
  3768. }
  3769. /* GetAttr3 */
  3770. static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
  3771. __Pyx_PyThreadState_declare
  3772. __Pyx_PyThreadState_assign
  3773. if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
  3774. return NULL;
  3775. __Pyx_PyErr_Clear();
  3776. Py_INCREF(d);
  3777. return d;
  3778. }
  3779. static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
  3780. PyObject *r = __Pyx_GetAttr(o, n);
  3781. return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
  3782. }
  3783. /* GetModuleGlobalName */
  3784. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  3785. PyObject *result;
  3786. #if !CYTHON_AVOID_BORROWED_REFS
  3787. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  3788. result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
  3789. if (likely(result)) {
  3790. Py_INCREF(result);
  3791. } else if (unlikely(PyErr_Occurred())) {
  3792. result = NULL;
  3793. } else {
  3794. #else
  3795. result = PyDict_GetItem(__pyx_d, name);
  3796. if (likely(result)) {
  3797. Py_INCREF(result);
  3798. } else {
  3799. #endif
  3800. #else
  3801. result = PyObject_GetItem(__pyx_d, name);
  3802. if (!result) {
  3803. PyErr_Clear();
  3804. #endif
  3805. result = __Pyx_GetBuiltinName(name);
  3806. }
  3807. return result;
  3808. }
  3809. /* Import */
  3810. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  3811. PyObject *empty_list = 0;
  3812. PyObject *module = 0;
  3813. PyObject *global_dict = 0;
  3814. PyObject *empty_dict = 0;
  3815. PyObject *list;
  3816. #if PY_MAJOR_VERSION < 3
  3817. PyObject *py_import;
  3818. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  3819. if (!py_import)
  3820. goto bad;
  3821. #endif
  3822. if (from_list)
  3823. list = from_list;
  3824. else {
  3825. empty_list = PyList_New(0);
  3826. if (!empty_list)
  3827. goto bad;
  3828. list = empty_list;
  3829. }
  3830. global_dict = PyModule_GetDict(__pyx_m);
  3831. if (!global_dict)
  3832. goto bad;
  3833. empty_dict = PyDict_New();
  3834. if (!empty_dict)
  3835. goto bad;
  3836. {
  3837. #if PY_MAJOR_VERSION >= 3
  3838. if (level == -1) {
  3839. if (strchr(__Pyx_MODULE_NAME, '.')) {
  3840. module = PyImport_ImportModuleLevelObject(
  3841. name, global_dict, empty_dict, list, 1);
  3842. if (!module) {
  3843. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  3844. goto bad;
  3845. PyErr_Clear();
  3846. }
  3847. }
  3848. level = 0;
  3849. }
  3850. #endif
  3851. if (!module) {
  3852. #if PY_MAJOR_VERSION < 3
  3853. PyObject *py_level = PyInt_FromLong(level);
  3854. if (!py_level)
  3855. goto bad;
  3856. module = PyObject_CallFunctionObjArgs(py_import,
  3857. name, global_dict, empty_dict, list, py_level, NULL);
  3858. Py_DECREF(py_level);
  3859. #else
  3860. module = PyImport_ImportModuleLevelObject(
  3861. name, global_dict, empty_dict, list, level);
  3862. #endif
  3863. }
  3864. }
  3865. bad:
  3866. #if PY_MAJOR_VERSION < 3
  3867. Py_XDECREF(py_import);
  3868. #endif
  3869. Py_XDECREF(empty_list);
  3870. Py_XDECREF(empty_dict);
  3871. return module;
  3872. }
  3873. /* ImportFrom */
  3874. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  3875. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  3876. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  3877. PyErr_Format(PyExc_ImportError,
  3878. #if PY_MAJOR_VERSION < 3
  3879. "cannot import name %.230s", PyString_AS_STRING(name));
  3880. #else
  3881. "cannot import name %S", name);
  3882. #endif
  3883. }
  3884. return value;
  3885. }
  3886. /* HasAttr */
  3887. static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
  3888. PyObject *r;
  3889. if (unlikely(!__Pyx_PyBaseString_Check(n))) {
  3890. PyErr_SetString(PyExc_TypeError,
  3891. "hasattr(): attribute name must be string");
  3892. return -1;
  3893. }
  3894. r = __Pyx_GetAttr(o, n);
  3895. if (unlikely(!r)) {
  3896. PyErr_Clear();
  3897. return 0;
  3898. } else {
  3899. Py_DECREF(r);
  3900. return 1;
  3901. }
  3902. }
  3903. /* PyObject_GenericGetAttrNoDict */
  3904. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  3905. static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
  3906. PyErr_Format(PyExc_AttributeError,
  3907. #if PY_MAJOR_VERSION >= 3
  3908. "'%.50s' object has no attribute '%U'",
  3909. tp->tp_name, attr_name);
  3910. #else
  3911. "'%.50s' object has no attribute '%.400s'",
  3912. tp->tp_name, PyString_AS_STRING(attr_name));
  3913. #endif
  3914. return NULL;
  3915. }
  3916. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
  3917. PyObject *descr;
  3918. PyTypeObject *tp = Py_TYPE(obj);
  3919. if (unlikely(!PyString_Check(attr_name))) {
  3920. return PyObject_GenericGetAttr(obj, attr_name);
  3921. }
  3922. assert(!tp->tp_dictoffset);
  3923. descr = _PyType_Lookup(tp, attr_name);
  3924. if (unlikely(!descr)) {
  3925. return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
  3926. }
  3927. Py_INCREF(descr);
  3928. #if PY_MAJOR_VERSION < 3
  3929. if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
  3930. #endif
  3931. {
  3932. descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
  3933. if (unlikely(f)) {
  3934. PyObject *res = f(descr, obj, (PyObject *)tp);
  3935. Py_DECREF(descr);
  3936. return res;
  3937. }
  3938. }
  3939. return descr;
  3940. }
  3941. #endif
  3942. /* PyObject_GenericGetAttr */
  3943. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  3944. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
  3945. if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
  3946. return PyObject_GenericGetAttr(obj, attr_name);
  3947. }
  3948. return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
  3949. }
  3950. #endif
  3951. /* SetupReduce */
  3952. static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  3953. int ret;
  3954. PyObject *name_attr;
  3955. name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
  3956. if (likely(name_attr)) {
  3957. ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  3958. } else {
  3959. ret = -1;
  3960. }
  3961. if (unlikely(ret < 0)) {
  3962. PyErr_Clear();
  3963. ret = 0;
  3964. }
  3965. Py_XDECREF(name_attr);
  3966. return ret;
  3967. }
  3968. static int __Pyx_setup_reduce(PyObject* type_obj) {
  3969. int ret = 0;
  3970. PyObject *object_reduce = NULL;
  3971. PyObject *object_reduce_ex = NULL;
  3972. PyObject *reduce = NULL;
  3973. PyObject *reduce_ex = NULL;
  3974. PyObject *reduce_cython = NULL;
  3975. PyObject *setstate = NULL;
  3976. PyObject *setstate_cython = NULL;
  3977. #if CYTHON_USE_PYTYPE_LOOKUP
  3978. if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
  3979. #else
  3980. if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
  3981. #endif
  3982. #if CYTHON_USE_PYTYPE_LOOKUP
  3983. object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
  3984. #else
  3985. object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
  3986. #endif
  3987. reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
  3988. if (reduce_ex == object_reduce_ex) {
  3989. #if CYTHON_USE_PYTYPE_LOOKUP
  3990. object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
  3991. #else
  3992. object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
  3993. #endif
  3994. reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
  3995. if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
  3996. reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
  3997. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
  3998. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
  3999. setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
  4000. if (!setstate) PyErr_Clear();
  4001. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
  4002. setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
  4003. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
  4004. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
  4005. }
  4006. PyType_Modified((PyTypeObject*)type_obj);
  4007. }
  4008. }
  4009. goto GOOD;
  4010. BAD:
  4011. if (!PyErr_Occurred())
  4012. PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
  4013. ret = -1;
  4014. GOOD:
  4015. #if !CYTHON_USE_PYTYPE_LOOKUP
  4016. Py_XDECREF(object_reduce);
  4017. Py_XDECREF(object_reduce_ex);
  4018. #endif
  4019. Py_XDECREF(reduce);
  4020. Py_XDECREF(reduce_ex);
  4021. Py_XDECREF(reduce_cython);
  4022. Py_XDECREF(setstate);
  4023. Py_XDECREF(setstate_cython);
  4024. return ret;
  4025. }
  4026. /* CLineInTraceback */
  4027. #ifndef CYTHON_CLINE_IN_TRACEBACK
  4028. static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
  4029. PyObject *use_cline;
  4030. PyObject *ptype, *pvalue, *ptraceback;
  4031. #if CYTHON_COMPILING_IN_CPYTHON
  4032. PyObject **cython_runtime_dict;
  4033. #endif
  4034. if (unlikely(!__pyx_cython_runtime)) {
  4035. return c_line;
  4036. }
  4037. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  4038. #if CYTHON_COMPILING_IN_CPYTHON
  4039. cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
  4040. if (likely(cython_runtime_dict)) {
  4041. use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
  4042. } else
  4043. #endif
  4044. {
  4045. PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
  4046. if (use_cline_obj) {
  4047. use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
  4048. Py_DECREF(use_cline_obj);
  4049. } else {
  4050. PyErr_Clear();
  4051. use_cline = NULL;
  4052. }
  4053. }
  4054. if (!use_cline) {
  4055. c_line = 0;
  4056. PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
  4057. }
  4058. else if (PyObject_Not(use_cline) != 0) {
  4059. c_line = 0;
  4060. }
  4061. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  4062. return c_line;
  4063. }
  4064. #endif
  4065. /* CodeObjectCache */
  4066. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  4067. int start = 0, mid = 0, end = count - 1;
  4068. if (end >= 0 && code_line > entries[end].code_line) {
  4069. return count;
  4070. }
  4071. while (start < end) {
  4072. mid = start + (end - start) / 2;
  4073. if (code_line < entries[mid].code_line) {
  4074. end = mid;
  4075. } else if (code_line > entries[mid].code_line) {
  4076. start = mid + 1;
  4077. } else {
  4078. return mid;
  4079. }
  4080. }
  4081. if (code_line <= entries[mid].code_line) {
  4082. return mid;
  4083. } else {
  4084. return mid + 1;
  4085. }
  4086. }
  4087. static PyCodeObject *__pyx_find_code_object(int code_line) {
  4088. PyCodeObject* code_object;
  4089. int pos;
  4090. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  4091. return NULL;
  4092. }
  4093. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  4094. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  4095. return NULL;
  4096. }
  4097. code_object = __pyx_code_cache.entries[pos].code_object;
  4098. Py_INCREF(code_object);
  4099. return code_object;
  4100. }
  4101. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  4102. int pos, i;
  4103. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  4104. if (unlikely(!code_line)) {
  4105. return;
  4106. }
  4107. if (unlikely(!entries)) {
  4108. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  4109. if (likely(entries)) {
  4110. __pyx_code_cache.entries = entries;
  4111. __pyx_code_cache.max_count = 64;
  4112. __pyx_code_cache.count = 1;
  4113. entries[0].code_line = code_line;
  4114. entries[0].code_object = code_object;
  4115. Py_INCREF(code_object);
  4116. }
  4117. return;
  4118. }
  4119. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  4120. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  4121. PyCodeObject* tmp = entries[pos].code_object;
  4122. entries[pos].code_object = code_object;
  4123. Py_DECREF(tmp);
  4124. return;
  4125. }
  4126. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  4127. int new_max = __pyx_code_cache.max_count + 64;
  4128. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  4129. __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  4130. if (unlikely(!entries)) {
  4131. return;
  4132. }
  4133. __pyx_code_cache.entries = entries;
  4134. __pyx_code_cache.max_count = new_max;
  4135. }
  4136. for (i=__pyx_code_cache.count; i>pos; i--) {
  4137. entries[i] = entries[i-1];
  4138. }
  4139. entries[pos].code_line = code_line;
  4140. entries[pos].code_object = code_object;
  4141. __pyx_code_cache.count++;
  4142. Py_INCREF(code_object);
  4143. }
  4144. /* AddTraceback */
  4145. #include "compile.h"
  4146. #include "frameobject.h"
  4147. #include "traceback.h"
  4148. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  4149. const char *funcname, int c_line,
  4150. int py_line, const char *filename) {
  4151. PyCodeObject *py_code = 0;
  4152. PyObject *py_srcfile = 0;
  4153. PyObject *py_funcname = 0;
  4154. #if PY_MAJOR_VERSION < 3
  4155. py_srcfile = PyString_FromString(filename);
  4156. #else
  4157. py_srcfile = PyUnicode_FromString(filename);
  4158. #endif
  4159. if (!py_srcfile) goto bad;
  4160. if (c_line) {
  4161. #if PY_MAJOR_VERSION < 3
  4162. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  4163. #else
  4164. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  4165. #endif
  4166. }
  4167. else {
  4168. #if PY_MAJOR_VERSION < 3
  4169. py_funcname = PyString_FromString(funcname);
  4170. #else
  4171. py_funcname = PyUnicode_FromString(funcname);
  4172. #endif
  4173. }
  4174. if (!py_funcname) goto bad;
  4175. py_code = __Pyx_PyCode_New(
  4176. 0,
  4177. 0,
  4178. 0,
  4179. 0,
  4180. 0,
  4181. __pyx_empty_bytes, /*PyObject *code,*/
  4182. __pyx_empty_tuple, /*PyObject *consts,*/
  4183. __pyx_empty_tuple, /*PyObject *names,*/
  4184. __pyx_empty_tuple, /*PyObject *varnames,*/
  4185. __pyx_empty_tuple, /*PyObject *freevars,*/
  4186. __pyx_empty_tuple, /*PyObject *cellvars,*/
  4187. py_srcfile, /*PyObject *filename,*/
  4188. py_funcname, /*PyObject *name,*/
  4189. py_line,
  4190. __pyx_empty_bytes /*PyObject *lnotab*/
  4191. );
  4192. Py_DECREF(py_srcfile);
  4193. Py_DECREF(py_funcname);
  4194. return py_code;
  4195. bad:
  4196. Py_XDECREF(py_srcfile);
  4197. Py_XDECREF(py_funcname);
  4198. return NULL;
  4199. }
  4200. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  4201. int py_line, const char *filename) {
  4202. PyCodeObject *py_code = 0;
  4203. PyFrameObject *py_frame = 0;
  4204. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  4205. if (c_line) {
  4206. c_line = __Pyx_CLineForTraceback(tstate, c_line);
  4207. }
  4208. py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
  4209. if (!py_code) {
  4210. py_code = __Pyx_CreateCodeObjectForTraceback(
  4211. funcname, c_line, py_line, filename);
  4212. if (!py_code) goto bad;
  4213. __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
  4214. }
  4215. py_frame = PyFrame_New(
  4216. tstate, /*PyThreadState *tstate,*/
  4217. py_code, /*PyCodeObject *code,*/
  4218. __pyx_d, /*PyObject *globals,*/
  4219. 0 /*PyObject *locals*/
  4220. );
  4221. if (!py_frame) goto bad;
  4222. __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  4223. PyTraceBack_Here(py_frame);
  4224. bad:
  4225. Py_XDECREF(py_code);
  4226. Py_XDECREF(py_frame);
  4227. }
  4228. /* CIntFromPyVerify */
  4229. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  4230. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  4231. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  4232. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  4233. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  4234. {\
  4235. func_type value = func_value;\
  4236. if (sizeof(target_type) < sizeof(func_type)) {\
  4237. if (unlikely(value != (func_type) (target_type) value)) {\
  4238. func_type zero = 0;\
  4239. if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  4240. return (target_type) -1;\
  4241. if (is_unsigned && unlikely(value < zero))\
  4242. goto raise_neg_overflow;\
  4243. else\
  4244. goto raise_overflow;\
  4245. }\
  4246. }\
  4247. return (target_type) value;\
  4248. }
  4249. /* CIntToPy */
  4250. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  4251. const long neg_one = (long) -1, const_zero = (long) 0;
  4252. const int is_unsigned = neg_one > const_zero;
  4253. if (is_unsigned) {
  4254. if (sizeof(long) < sizeof(long)) {
  4255. return PyInt_FromLong((long) value);
  4256. } else if (sizeof(long) <= sizeof(unsigned long)) {
  4257. return PyLong_FromUnsignedLong((unsigned long) value);
  4258. #ifdef HAVE_LONG_LONG
  4259. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  4260. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  4261. #endif
  4262. }
  4263. } else {
  4264. if (sizeof(long) <= sizeof(long)) {
  4265. return PyInt_FromLong((long) value);
  4266. #ifdef HAVE_LONG_LONG
  4267. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  4268. return PyLong_FromLongLong((PY_LONG_LONG) value);
  4269. #endif
  4270. }
  4271. }
  4272. {
  4273. int one = 1; int little = (int)*(unsigned char *)&one;
  4274. unsigned char *bytes = (unsigned char *)&value;
  4275. return _PyLong_FromByteArray(bytes, sizeof(long),
  4276. little, !is_unsigned);
  4277. }
  4278. }
  4279. /* CIntFromPy */
  4280. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  4281. const long neg_one = (long) -1, const_zero = (long) 0;
  4282. const int is_unsigned = neg_one > const_zero;
  4283. #if PY_MAJOR_VERSION < 3
  4284. if (likely(PyInt_Check(x))) {
  4285. if (sizeof(long) < sizeof(long)) {
  4286. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  4287. } else {
  4288. long val = PyInt_AS_LONG(x);
  4289. if (is_unsigned && unlikely(val < 0)) {
  4290. goto raise_neg_overflow;
  4291. }
  4292. return (long) val;
  4293. }
  4294. } else
  4295. #endif
  4296. if (likely(PyLong_Check(x))) {
  4297. if (is_unsigned) {
  4298. #if CYTHON_USE_PYLONG_INTERNALS
  4299. const digit* digits = ((PyLongObject*)x)->ob_digit;
  4300. switch (Py_SIZE(x)) {
  4301. case 0: return (long) 0;
  4302. case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
  4303. case 2:
  4304. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  4305. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  4306. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4307. } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
  4308. return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  4309. }
  4310. }
  4311. break;
  4312. case 3:
  4313. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  4314. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  4315. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4316. } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
  4317. return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  4318. }
  4319. }
  4320. break;
  4321. case 4:
  4322. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  4323. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  4324. __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])))
  4325. } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
  4326. return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  4327. }
  4328. }
  4329. break;
  4330. }
  4331. #endif
  4332. #if CYTHON_COMPILING_IN_CPYTHON
  4333. if (unlikely(Py_SIZE(x) < 0)) {
  4334. goto raise_neg_overflow;
  4335. }
  4336. #else
  4337. {
  4338. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  4339. if (unlikely(result < 0))
  4340. return (long) -1;
  4341. if (unlikely(result == 1))
  4342. goto raise_neg_overflow;
  4343. }
  4344. #endif
  4345. if (sizeof(long) <= sizeof(unsigned long)) {
  4346. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  4347. #ifdef HAVE_LONG_LONG
  4348. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  4349. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  4350. #endif
  4351. }
  4352. } else {
  4353. #if CYTHON_USE_PYLONG_INTERNALS
  4354. const digit* digits = ((PyLongObject*)x)->ob_digit;
  4355. switch (Py_SIZE(x)) {
  4356. case 0: return (long) 0;
  4357. case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
  4358. case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
  4359. case -2:
  4360. if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
  4361. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  4362. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4363. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  4364. return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  4365. }
  4366. }
  4367. break;
  4368. case 2:
  4369. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  4370. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  4371. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4372. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  4373. return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  4374. }
  4375. }
  4376. break;
  4377. case -3:
  4378. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  4379. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  4380. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4381. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  4382. return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  4383. }
  4384. }
  4385. break;
  4386. case 3:
  4387. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  4388. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  4389. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4390. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  4391. return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  4392. }
  4393. }
  4394. break;
  4395. case -4:
  4396. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  4397. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  4398. __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])))
  4399. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  4400. return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  4401. }
  4402. }
  4403. break;
  4404. case 4:
  4405. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  4406. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  4407. __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])))
  4408. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  4409. return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  4410. }
  4411. }
  4412. break;
  4413. }
  4414. #endif
  4415. if (sizeof(long) <= sizeof(long)) {
  4416. __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  4417. #ifdef HAVE_LONG_LONG
  4418. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  4419. __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  4420. #endif
  4421. }
  4422. }
  4423. {
  4424. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  4425. PyErr_SetString(PyExc_RuntimeError,
  4426. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  4427. #else
  4428. long val;
  4429. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  4430. #if PY_MAJOR_VERSION < 3
  4431. if (likely(v) && !PyLong_Check(v)) {
  4432. PyObject *tmp = v;
  4433. v = PyNumber_Long(tmp);
  4434. Py_DECREF(tmp);
  4435. }
  4436. #endif
  4437. if (likely(v)) {
  4438. int one = 1; int is_little = (int)*(unsigned char *)&one;
  4439. unsigned char *bytes = (unsigned char *)&val;
  4440. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  4441. bytes, sizeof(val),
  4442. is_little, !is_unsigned);
  4443. Py_DECREF(v);
  4444. if (likely(!ret))
  4445. return val;
  4446. }
  4447. #endif
  4448. return (long) -1;
  4449. }
  4450. } else {
  4451. long val;
  4452. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  4453. if (!tmp) return (long) -1;
  4454. val = __Pyx_PyInt_As_long(tmp);
  4455. Py_DECREF(tmp);
  4456. return val;
  4457. }
  4458. raise_overflow:
  4459. PyErr_SetString(PyExc_OverflowError,
  4460. "value too large to convert to long");
  4461. return (long) -1;
  4462. raise_neg_overflow:
  4463. PyErr_SetString(PyExc_OverflowError,
  4464. "can't convert negative value to long");
  4465. return (long) -1;
  4466. }
  4467. /* CIntFromPy */
  4468. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  4469. const int neg_one = (int) -1, const_zero = (int) 0;
  4470. const int is_unsigned = neg_one > const_zero;
  4471. #if PY_MAJOR_VERSION < 3
  4472. if (likely(PyInt_Check(x))) {
  4473. if (sizeof(int) < sizeof(long)) {
  4474. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  4475. } else {
  4476. long val = PyInt_AS_LONG(x);
  4477. if (is_unsigned && unlikely(val < 0)) {
  4478. goto raise_neg_overflow;
  4479. }
  4480. return (int) val;
  4481. }
  4482. } else
  4483. #endif
  4484. if (likely(PyLong_Check(x))) {
  4485. if (is_unsigned) {
  4486. #if CYTHON_USE_PYLONG_INTERNALS
  4487. const digit* digits = ((PyLongObject*)x)->ob_digit;
  4488. switch (Py_SIZE(x)) {
  4489. case 0: return (int) 0;
  4490. case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
  4491. case 2:
  4492. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  4493. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  4494. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4495. } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
  4496. return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  4497. }
  4498. }
  4499. break;
  4500. case 3:
  4501. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  4502. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  4503. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4504. } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
  4505. return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  4506. }
  4507. }
  4508. break;
  4509. case 4:
  4510. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  4511. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  4512. __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])))
  4513. } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
  4514. return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  4515. }
  4516. }
  4517. break;
  4518. }
  4519. #endif
  4520. #if CYTHON_COMPILING_IN_CPYTHON
  4521. if (unlikely(Py_SIZE(x) < 0)) {
  4522. goto raise_neg_overflow;
  4523. }
  4524. #else
  4525. {
  4526. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  4527. if (unlikely(result < 0))
  4528. return (int) -1;
  4529. if (unlikely(result == 1))
  4530. goto raise_neg_overflow;
  4531. }
  4532. #endif
  4533. if (sizeof(int) <= sizeof(unsigned long)) {
  4534. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  4535. #ifdef HAVE_LONG_LONG
  4536. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  4537. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  4538. #endif
  4539. }
  4540. } else {
  4541. #if CYTHON_USE_PYLONG_INTERNALS
  4542. const digit* digits = ((PyLongObject*)x)->ob_digit;
  4543. switch (Py_SIZE(x)) {
  4544. case 0: return (int) 0;
  4545. case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
  4546. case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
  4547. case -2:
  4548. if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
  4549. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  4550. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4551. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  4552. return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  4553. }
  4554. }
  4555. break;
  4556. case 2:
  4557. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  4558. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  4559. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4560. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  4561. return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  4562. }
  4563. }
  4564. break;
  4565. case -3:
  4566. if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  4567. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  4568. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4569. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  4570. return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  4571. }
  4572. }
  4573. break;
  4574. case 3:
  4575. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  4576. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  4577. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  4578. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  4579. return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  4580. }
  4581. }
  4582. break;
  4583. case -4:
  4584. if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  4585. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  4586. __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])))
  4587. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  4588. return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  4589. }
  4590. }
  4591. break;
  4592. case 4:
  4593. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  4594. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  4595. __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])))
  4596. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  4597. return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  4598. }
  4599. }
  4600. break;
  4601. }
  4602. #endif
  4603. if (sizeof(int) <= sizeof(long)) {
  4604. __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  4605. #ifdef HAVE_LONG_LONG
  4606. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  4607. __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  4608. #endif
  4609. }
  4610. }
  4611. {
  4612. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  4613. PyErr_SetString(PyExc_RuntimeError,
  4614. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  4615. #else
  4616. int val;
  4617. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  4618. #if PY_MAJOR_VERSION < 3
  4619. if (likely(v) && !PyLong_Check(v)) {
  4620. PyObject *tmp = v;
  4621. v = PyNumber_Long(tmp);
  4622. Py_DECREF(tmp);
  4623. }
  4624. #endif
  4625. if (likely(v)) {
  4626. int one = 1; int is_little = (int)*(unsigned char *)&one;
  4627. unsigned char *bytes = (unsigned char *)&val;
  4628. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  4629. bytes, sizeof(val),
  4630. is_little, !is_unsigned);
  4631. Py_DECREF(v);
  4632. if (likely(!ret))
  4633. return val;
  4634. }
  4635. #endif
  4636. return (int) -1;
  4637. }
  4638. } else {
  4639. int val;
  4640. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  4641. if (!tmp) return (int) -1;
  4642. val = __Pyx_PyInt_As_int(tmp);
  4643. Py_DECREF(tmp);
  4644. return val;
  4645. }
  4646. raise_overflow:
  4647. PyErr_SetString(PyExc_OverflowError,
  4648. "value too large to convert to int");
  4649. return (int) -1;
  4650. raise_neg_overflow:
  4651. PyErr_SetString(PyExc_OverflowError,
  4652. "can't convert negative value to int");
  4653. return (int) -1;
  4654. }
  4655. /* FastTypeChecks */
  4656. #if CYTHON_COMPILING_IN_CPYTHON
  4657. static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
  4658. while (a) {
  4659. a = a->tp_base;
  4660. if (a == b)
  4661. return 1;
  4662. }
  4663. return b == &PyBaseObject_Type;
  4664. }
  4665. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
  4666. PyObject *mro;
  4667. if (a == b) return 1;
  4668. mro = a->tp_mro;
  4669. if (likely(mro)) {
  4670. Py_ssize_t i, n;
  4671. n = PyTuple_GET_SIZE(mro);
  4672. for (i = 0; i < n; i++) {
  4673. if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
  4674. return 1;
  4675. }
  4676. return 0;
  4677. }
  4678. return __Pyx_InBases(a, b);
  4679. }
  4680. #if PY_MAJOR_VERSION == 2
  4681. static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
  4682. PyObject *exception, *value, *tb;
  4683. int res;
  4684. __Pyx_PyThreadState_declare
  4685. __Pyx_PyThreadState_assign
  4686. __Pyx_ErrFetch(&exception, &value, &tb);
  4687. res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
  4688. if (unlikely(res == -1)) {
  4689. PyErr_WriteUnraisable(err);
  4690. res = 0;
  4691. }
  4692. if (!res) {
  4693. res = PyObject_IsSubclass(err, exc_type2);
  4694. if (unlikely(res == -1)) {
  4695. PyErr_WriteUnraisable(err);
  4696. res = 0;
  4697. }
  4698. }
  4699. __Pyx_ErrRestore(exception, value, tb);
  4700. return res;
  4701. }
  4702. #else
  4703. static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
  4704. int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
  4705. if (!res) {
  4706. res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
  4707. }
  4708. return res;
  4709. }
  4710. #endif
  4711. static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  4712. Py_ssize_t i, n;
  4713. assert(PyExceptionClass_Check(exc_type));
  4714. n = PyTuple_GET_SIZE(tuple);
  4715. #if PY_MAJOR_VERSION >= 3
  4716. for (i=0; i<n; i++) {
  4717. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  4718. }
  4719. #endif
  4720. for (i=0; i<n; i++) {
  4721. PyObject *t = PyTuple_GET_ITEM(tuple, i);
  4722. #if PY_MAJOR_VERSION < 3
  4723. if (likely(exc_type == t)) return 1;
  4724. #endif
  4725. if (likely(PyExceptionClass_Check(t))) {
  4726. if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
  4727. } else {
  4728. }
  4729. }
  4730. return 0;
  4731. }
  4732. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
  4733. if (likely(err == exc_type)) return 1;
  4734. if (likely(PyExceptionClass_Check(err))) {
  4735. if (likely(PyExceptionClass_Check(exc_type))) {
  4736. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
  4737. } else if (likely(PyTuple_Check(exc_type))) {
  4738. return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
  4739. } else {
  4740. }
  4741. }
  4742. return PyErr_GivenExceptionMatches(err, exc_type);
  4743. }
  4744. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
  4745. assert(PyExceptionClass_Check(exc_type1));
  4746. assert(PyExceptionClass_Check(exc_type2));
  4747. if (likely(err == exc_type1 || err == exc_type2)) return 1;
  4748. if (likely(PyExceptionClass_Check(err))) {
  4749. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
  4750. }
  4751. return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
  4752. }
  4753. #endif
  4754. /* CheckBinaryVersion */
  4755. static int __Pyx_check_binary_version(void) {
  4756. char ctversion[4], rtversion[4];
  4757. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  4758. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  4759. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  4760. char message[200];
  4761. PyOS_snprintf(message, sizeof(message),
  4762. "compiletime version %s of module '%.100s' "
  4763. "does not match runtime version %s",
  4764. ctversion, __Pyx_MODULE_NAME, rtversion);
  4765. return PyErr_WarnEx(NULL, message, 1);
  4766. }
  4767. return 0;
  4768. }
  4769. /* InitStrings */
  4770. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  4771. while (t->p) {
  4772. #if PY_MAJOR_VERSION < 3
  4773. if (t->is_unicode) {
  4774. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  4775. } else if (t->intern) {
  4776. *t->p = PyString_InternFromString(t->s);
  4777. } else {
  4778. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  4779. }
  4780. #else
  4781. if (t->is_unicode | t->is_str) {
  4782. if (t->intern) {
  4783. *t->p = PyUnicode_InternFromString(t->s);
  4784. } else if (t->encoding) {
  4785. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  4786. } else {
  4787. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  4788. }
  4789. } else {
  4790. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  4791. }
  4792. #endif
  4793. if (!*t->p)
  4794. return -1;
  4795. if (PyObject_Hash(*t->p) == -1)
  4796. return -1;
  4797. ++t;
  4798. }
  4799. return 0;
  4800. }
  4801. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  4802. return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
  4803. }
  4804. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
  4805. Py_ssize_t ignore;
  4806. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  4807. }
  4808. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  4809. #if !CYTHON_PEP393_ENABLED
  4810. static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  4811. char* defenc_c;
  4812. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  4813. if (!defenc) return NULL;
  4814. defenc_c = PyBytes_AS_STRING(defenc);
  4815. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  4816. {
  4817. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  4818. char* c;
  4819. for (c = defenc_c; c < end; c++) {
  4820. if ((unsigned char) (*c) >= 128) {
  4821. PyUnicode_AsASCIIString(o);
  4822. return NULL;
  4823. }
  4824. }
  4825. }
  4826. #endif
  4827. *length = PyBytes_GET_SIZE(defenc);
  4828. return defenc_c;
  4829. }
  4830. #else
  4831. static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  4832. if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
  4833. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  4834. if (likely(PyUnicode_IS_ASCII(o))) {
  4835. *length = PyUnicode_GET_LENGTH(o);
  4836. return PyUnicode_AsUTF8(o);
  4837. } else {
  4838. PyUnicode_AsASCIIString(o);
  4839. return NULL;
  4840. }
  4841. #else
  4842. return PyUnicode_AsUTF8AndSize(o, length);
  4843. #endif
  4844. }
  4845. #endif
  4846. #endif
  4847. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  4848. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  4849. if (
  4850. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  4851. __Pyx_sys_getdefaultencoding_not_ascii &&
  4852. #endif
  4853. PyUnicode_Check(o)) {
  4854. return __Pyx_PyUnicode_AsStringAndSize(o, length);
  4855. } else
  4856. #endif
  4857. #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  4858. if (PyByteArray_Check(o)) {
  4859. *length = PyByteArray_GET_SIZE(o);
  4860. return PyByteArray_AS_STRING(o);
  4861. } else
  4862. #endif
  4863. {
  4864. char* result;
  4865. int r = PyBytes_AsStringAndSize(o, &result, length);
  4866. if (unlikely(r < 0)) {
  4867. return NULL;
  4868. } else {
  4869. return result;
  4870. }
  4871. }
  4872. }
  4873. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  4874. int is_true = x == Py_True;
  4875. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  4876. else return PyObject_IsTrue(x);
  4877. }
  4878. static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
  4879. #if PY_MAJOR_VERSION >= 3
  4880. if (PyLong_Check(result)) {
  4881. if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
  4882. "__int__ returned non-int (type %.200s). "
  4883. "The ability to return an instance of a strict subclass of int "
  4884. "is deprecated, and may be removed in a future version of Python.",
  4885. Py_TYPE(result)->tp_name)) {
  4886. Py_DECREF(result);
  4887. return NULL;
  4888. }
  4889. return result;
  4890. }
  4891. #endif
  4892. PyErr_Format(PyExc_TypeError,
  4893. "__%.4s__ returned non-%.4s (type %.200s)",
  4894. type_name, type_name, Py_TYPE(result)->tp_name);
  4895. Py_DECREF(result);
  4896. return NULL;
  4897. }
  4898. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  4899. #if CYTHON_USE_TYPE_SLOTS
  4900. PyNumberMethods *m;
  4901. #endif
  4902. const char *name = NULL;
  4903. PyObject *res = NULL;
  4904. #if PY_MAJOR_VERSION < 3
  4905. if (likely(PyInt_Check(x) || PyLong_Check(x)))
  4906. #else
  4907. if (likely(PyLong_Check(x)))
  4908. #endif
  4909. return __Pyx_NewRef(x);
  4910. #if CYTHON_USE_TYPE_SLOTS
  4911. m = Py_TYPE(x)->tp_as_number;
  4912. #if PY_MAJOR_VERSION < 3
  4913. if (m && m->nb_int) {
  4914. name = "int";
  4915. res = m->nb_int(x);
  4916. }
  4917. else if (m && m->nb_long) {
  4918. name = "long";
  4919. res = m->nb_long(x);
  4920. }
  4921. #else
  4922. if (likely(m && m->nb_int)) {
  4923. name = "int";
  4924. res = m->nb_int(x);
  4925. }
  4926. #endif
  4927. #else
  4928. if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
  4929. res = PyNumber_Int(x);
  4930. }
  4931. #endif
  4932. if (likely(res)) {
  4933. #if PY_MAJOR_VERSION < 3
  4934. if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
  4935. #else
  4936. if (unlikely(!PyLong_CheckExact(res))) {
  4937. #endif
  4938. return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
  4939. }
  4940. }
  4941. else if (!PyErr_Occurred()) {
  4942. PyErr_SetString(PyExc_TypeError,
  4943. "an integer is required");
  4944. }
  4945. return res;
  4946. }
  4947. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  4948. Py_ssize_t ival;
  4949. PyObject *x;
  4950. #if PY_MAJOR_VERSION < 3
  4951. if (likely(PyInt_CheckExact(b))) {
  4952. if (sizeof(Py_ssize_t) >= sizeof(long))
  4953. return PyInt_AS_LONG(b);
  4954. else
  4955. return PyInt_AsSsize_t(x);
  4956. }
  4957. #endif
  4958. if (likely(PyLong_CheckExact(b))) {
  4959. #if CYTHON_USE_PYLONG_INTERNALS
  4960. const digit* digits = ((PyLongObject*)b)->ob_digit;
  4961. const Py_ssize_t size = Py_SIZE(b);
  4962. if (likely(__Pyx_sst_abs(size) <= 1)) {
  4963. ival = likely(size) ? digits[0] : 0;
  4964. if (size == -1) ival = -ival;
  4965. return ival;
  4966. } else {
  4967. switch (size) {
  4968. case 2:
  4969. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  4970. return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  4971. }
  4972. break;
  4973. case -2:
  4974. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  4975. return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  4976. }
  4977. break;
  4978. case 3:
  4979. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  4980. return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  4981. }
  4982. break;
  4983. case -3:
  4984. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  4985. return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  4986. }
  4987. break;
  4988. case 4:
  4989. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  4990. 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]));
  4991. }
  4992. break;
  4993. case -4:
  4994. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  4995. 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]));
  4996. }
  4997. break;
  4998. }
  4999. }
  5000. #endif
  5001. return PyLong_AsSsize_t(b);
  5002. }
  5003. x = PyNumber_Index(b);
  5004. if (!x) return -1;
  5005. ival = PyInt_AsSsize_t(x);
  5006. Py_DECREF(x);
  5007. return ival;
  5008. }
  5009. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  5010. return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
  5011. }
  5012. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  5013. return PyInt_FromSize_t(ival);
  5014. }
  5015. #endif /* Py_PYTHON_H */