Cython: event.py

Generated by Cython 3.0.11

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: event.c

    +001: # Copyright (c) 2009-2016 Denis Bilenko, gevent contributors. See LICENSE for details.

      __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True

     003:

     004: """Basic synchronization primitives: Event and AsyncResult"""

     005: from __future__ import print_function

     006:

    +007: from gevent._util import _NONE

      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_NONE);
      __Pyx_GIVEREF(__pyx_n_s_NONE);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_NONE)) __PYX_ERR(0, 7, __pyx_L1_error);
      __pyx_t_3 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +008: from gevent._compat import reraise

      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_n_s_reraise);
      __Pyx_GIVEREF(__pyx_n_s_reraise);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_reraise)) __PYX_ERR(0, 8, __pyx_L1_error);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_reraise); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_v_6gevent_14_gevent_cevent_reraise);
      __Pyx_DECREF_SET(__pyx_v_6gevent_14_gevent_cevent_reraise, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +009: from gevent._tblib import dump_traceback, load_traceback

      __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_dump_traceback);
      __Pyx_GIVEREF(__pyx_n_s_dump_traceback);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_dump_traceback)) __PYX_ERR(0, 9, __pyx_L1_error);
      __Pyx_INCREF(__pyx_n_s_load_traceback);
      __Pyx_GIVEREF(__pyx_n_s_load_traceback);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_load_traceback)) __PYX_ERR(0, 9, __pyx_L1_error);
      __pyx_t_3 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_v_6gevent_14_gevent_cevent_dump_traceback);
      __Pyx_DECREF_SET(__pyx_v_6gevent_14_gevent_cevent_dump_traceback, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_v_6gevent_14_gevent_cevent_load_traceback);
      __Pyx_DECREF_SET(__pyx_v_6gevent_14_gevent_cevent_load_traceback, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     010:

    +011: from gevent.timeout import Timeout

      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_n_s_Timeout);
      __Pyx_GIVEREF(__pyx_n_s_Timeout);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Timeout)) __PYX_ERR(0, 11, __pyx_L1_error);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_v_6gevent_14_gevent_cevent_Timeout);
      __Pyx_DECREF_SET(__pyx_v_6gevent_14_gevent_cevent_Timeout, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     012:

     013:

    +014: __all__ = [

      __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_n_s_Event);
      __Pyx_GIVEREF(__pyx_n_s_Event);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Event)) __PYX_ERR(0, 14, __pyx_L1_error);
      __Pyx_INCREF(__pyx_n_s_AsyncResult);
      __Pyx_GIVEREF(__pyx_n_s_AsyncResult);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_AsyncResult)) __PYX_ERR(0, 14, __pyx_L1_error);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     015:     'Event',

     016:     'AsyncResult',

     017: ]

     018:

    +019: def _get_linkable():

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent__get_linkable, "_get_linkable()");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent__get_linkable};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent__get_linkable(__pyx_self);

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) {
      PyObject *__pyx_v_x = NULL;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_x);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__3);
      __Pyx_GIVEREF(__pyx_tuple__3);
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_linkable, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 19, __pyx_L1_error)

    +020:     x = __import__('gevent._abstract_linkable')

      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_x = __pyx_t_1;
      __pyx_t_1 = 0;
    /* … */
      __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 20, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple_);
      __Pyx_GIVEREF(__pyx_tuple_);

    +021:     return x._abstract_linkable.AbstractLinkable

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

    +022: locals()['AbstractLinkable'] = _get_linkable()

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely((PyDict_SetItem(__pyx_t_2, __pyx_n_s_AbstractLinkable, __pyx_t_3) < 0))) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +023: del _get_linkable

      if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 23, __pyx_L1_error)

     024:

     025:

    +026: class Event(AbstractLinkable): # pylint:disable=undefined-variable

    struct __pyx_vtabstruct_6gevent_14_gevent_cevent_Event {
      struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable __pyx_base;
    };
    static struct __pyx_vtabstruct_6gevent_14_gevent_cevent_Event *__pyx_vtabptr_6gevent_14_gevent_cevent_Event;

     027:     """

     028:     A synchronization primitive that allows one greenlet to wake up

     029:     one or more others. It has the same interface as

     030:     :class:`threading.Event` but works across greenlets.

     031:

     032:     .. important::

     033:        This object is for communicating among greenlets within the

     034:        same thread *only*! Do not try to use it to communicate across threads.

     035:

     036:     An event object manages an internal flag that can be set to true

     037:     with the :meth:`set` method and reset to false with the

     038:     :meth:`clear` method. The :meth:`wait` method blocks until the

     039:     flag is true; as soon as the flag is set to true, all greenlets

     040:     that are currently blocked in a call to :meth:`wait` will be scheduled

     041:     to awaken.

     042:

     043:     Note that the flag may be cleared and set many times before

     044:     any individual greenlet runs; all the greenlet can know for sure is that the

     045:     flag was set *at least once* while it was waiting.

     046:     If the greenlet cares whether the flag is still

     047:     set, it must check with :meth:`ready` and possibly call back into

     048:     :meth:`wait` again.

     049:

     050:     .. note::

     051:

     052:         The exact order and timing in which waiting greenlets are awakened is not determined.

     053:

     054:         Once the event is set, other greenlets may run before any waiting greenlets

     055:         are awakened.

     056:

     057:         While the code here will awaken greenlets in the order in which they

     058:         waited, each such greenlet that runs may in turn cause other greenlets

     059:         to run.

     060:

     061:         These details may change in the future.

     062:

     063:     .. versionchanged:: 1.5a3

     064:

     065:         Waiting greenlets are now awakened in

     066:         the order in which they waited.

     067:

     068:     .. versionchanged:: 1.5a3

     069:

     070:         The low-level ``rawlink`` method (most users won't use this) now

     071:         automatically unlinks waiters before calling them.

     072:

     073:     .. versionchanged:: 20.5.1

     074:

     075:         Callers to ``wait`` that find the event already set will now run

     076:         after any other waiters that had to block. See :issue:`1520`.

     077:     """

     078:

    +079:     __slots__ = ('_flag',)

      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event, __pyx_n_s_slots, __pyx_tuple__5) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_Event);
    /* … */
      __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__5);
      __Pyx_GIVEREF(__pyx_tuple__5);

     080:

    +081:     def __init__(self):

    /* Python wrapper */
    static int __pyx_pw_6gevent_14_gevent_cevent_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_14_gevent_cevent_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      if (unlikely(__pyx_nargs > 0)) {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;}
      if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event___init__(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_14_gevent_cevent_5Event___init__(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self) {
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_r = 0;
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +082:         super(Event, self).__init__()

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event);
      __Pyx_GIVEREF((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event))) __PYX_ERR(0, 82, __pyx_L1_error);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 82, __pyx_L1_error);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +083:         self._flag = False

      __pyx_v_self->_flag = 0;

     084:

    +085:     def __str__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_3__str__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_3__str__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event_2__str__(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_5Event_2__str__(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +086:         return '<%s.%s %s _links[%s]>' % (

      __Pyx_XDECREF(__pyx_r);
    /* … */
      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s__links_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

    +087:             self.__class__.__module__,

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /* … */
      __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;

    +088:             self.__class__.__name__,

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +089:             'set' if self._flag else 'clear',

      if (__pyx_v_self->_flag) {
        __Pyx_INCREF(__pyx_n_s_set);
        __pyx_t_1 = __pyx_n_s_set;
      } else {
        __Pyx_INCREF(__pyx_n_s_clear);
        __pyx_t_1 = __pyx_n_s_clear;
      }

    +090:             self.linkcount()

      __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.linkcount(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

     091:         )

     092:

    +093:     def is_set(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_5Event_4is_set, "Event.is_set(self)\nReturn true if and only if the internal flag is true.");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_5Event_5is_set = {"is_set", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_5Event_5is_set, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_5Event_4is_set};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("is_set (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event_4is_set(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_5Event_4is_set(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.is_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__6);
      __Pyx_GIVEREF(__pyx_tuple__6);
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_5Event_5is_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_is_set, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event, __pyx_n_s_is_set, __pyx_t_3) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_Event);
      __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_is_set, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 93, __pyx_L1_error)

     094:         """Return true if and only if the internal flag is true."""

    +095:         return self._flag

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     096:

    +097:     def isSet(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_5Event_6isSet, "Event.isSet(self)");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_5Event_7isSet = {"isSet", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_5Event_7isSet, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_5Event_6isSet};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("isSet (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event_6isSet(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_5Event_6isSet(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.isSet", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_5Event_7isSet, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_isSet, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event, __pyx_n_s_isSet, __pyx_t_3) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_Event);
    /* … */
      __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_isSet, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 97, __pyx_L1_error)

     098:         # makes it a better drop-in replacement for threading.Event

    +099:         return self._flag

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     100:

    +101:     def ready(self):

    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static int __pyx_f_6gevent_14_gevent_cevent_5Event_ready(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self, int __pyx_skip_dispatch) {
      int __pyx_r;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_14_gevent_cevent_5Event_9ready)) {
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_r = __pyx_t_6;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_5Event_8ready, "Event.ready(self) -> bool");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_5Event_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_5Event_9ready, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_5Event_8ready};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ready (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event_8ready(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_5Event_8ready(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_14_gevent_cevent_5Event_ready(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_5Event_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_ready, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event, __pyx_n_s_ready, __pyx_t_3) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_Event);
    /* … */
      __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 101, __pyx_L1_error)

     102:         # makes it compatible with AsyncResult and Greenlet (for

     103:         # example in wait())

    +104:         return self._flag

      __pyx_r = __pyx_v_self->_flag;
      goto __pyx_L0;

     105:

    +106:     def set(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_5Event_10set, "Event.set(self)\n\n        Set the internal flag to true.\n\n        All greenlets waiting for it to become true are awakened in\n        some order at some time in the future. Greenlets that call\n        :meth:`wait` once the flag is true will not block at all\n        (until :meth:`clear` is called).\n        ");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_5Event_11set = {"set", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_5Event_11set, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_5Event_10set};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event_10set(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_5Event_10set(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_5Event_11set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_set, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event, __pyx_n_s_set, __pyx_t_3) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_Event);
    /* … */
      __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 106, __pyx_L1_error)

     107:         """

     108:         Set the internal flag to true.

     109:

     110:         All greenlets waiting for it to become true are awakened in

     111:         some order at some time in the future. Greenlets that call

     112:         :meth:`wait` once the flag is true will not block at all

     113:         (until :meth:`clear` is called).

     114:         """

    +115:         self._flag = True

      __pyx_v_self->_flag = 1;

    +116:         self._check_and_notify()

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     117:

    +118:     def clear(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_5Event_12clear, "Event.clear(self)\n\n        Reset the internal flag to false.\n\n        Subsequently, threads calling :meth:`wait` will block until\n        :meth:`set` is called to set the internal flag to true again.\n        ");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_5Event_13clear = {"clear", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_5Event_13clear, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_5Event_12clear};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("clear (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event_12clear(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_5Event_12clear(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_5Event_13clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_clear, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event, __pyx_n_s_clear, __pyx_t_3) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_Event);
    /* … */
      __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_clear, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 118, __pyx_L1_error)

     119:         """

     120:         Reset the internal flag to false.

     121:

     122:         Subsequently, threads calling :meth:`wait` will block until

     123:         :meth:`set` is called to set the internal flag to true again.

     124:         """

    +125:         self._flag = False

      __pyx_v_self->_flag = 0;

     126:

    +127:     def _wait_return_value(self, waited, wait_success):

    static PyObject *__pyx_f_6gevent_14_gevent_cevent_5Event__wait_return_value(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self, int __pyx_v_waited, int __pyx_v_wait_success) {
      int __pyx_v_flag;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     128:         # To avoid the race condition outlined in http://bugs.python.org/issue13502,

     129:         # if we had to wait, then we need to return whether or not

     130:         # the condition got changed. Otherwise we simply echo

     131:         # the current state of the flag (which should be true)

    +132:         if not waited:

      __pyx_t_1 = (!__pyx_v_waited);
      if (__pyx_t_1) {
    /* … */
      }

    +133:             flag = self._flag

        __pyx_t_1 = __pyx_v_self->_flag;
        __pyx_v_flag = __pyx_t_1;

    +134:             assert flag, "if we didn't wait we should already be set"

        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          if (unlikely(!__pyx_v_flag)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_s_if_we_didn_t_wait_we_should_alre, 0, 0);
            __PYX_ERR(0, 134, __pyx_L1_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(0, 134, __pyx_L1_error)
        #endif

    +135:             return flag

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;

     136:

    +137:         return wait_success

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_wait_success); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     138:

    +139:     def wait(self, timeout=None):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_15wait(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_5Event_14wait, "Event.wait(self, timeout=None)\n\n        Block until this object is :meth:`ready`.\n\n        If the internal flag is true on entry, return immediately. Otherwise,\n        block until another thread (greenlet) calls :meth:`set` to set the flag to true,\n        or until the optional *timeout* expires.\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof).\n\n        :return: This method returns true if and only if the internal flag has been set to\n            true, either before the wait call or after the wait starts, so it will\n            always return ``True`` except if a timeout is given and the operation\n            times out.\n\n        .. versionchanged:: 1.1\n            The return value represents the flag during the elapsed wait, not\n            just after it elapses. This solves a race condition if one greenlet\n            sets and then clears the flag without switching, while other greenlets\n            are waiting. When the waiters wake up, this will return True; previously,\n            they would still wake up, but the return value would be False. This is most\n            noticeable when the *timeout* is present.\n        ");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_5Event_15wait = {"wait", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_14_gevent_cevent_5Event_15wait, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6gevent_14_gevent_cevent_5Event_14wait};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_15wait(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_timeout = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("wait (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
      PyObject* values[1] = {0};
        values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout);
              if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wait") < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_timeout = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 139, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event_14wait(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self), __pyx_v_timeout);

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_5Event_14wait(struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self, PyObject *__pyx_v_timeout) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__12);
      __Pyx_GIVEREF(__pyx_tuple__12);
      __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 139, __pyx_L1_error)
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_5Event_15wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_wait, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event, __pyx_n_s_wait, __pyx_t_3) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_Event);
      __pyx_tuple__14 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__14);
      __Pyx_GIVEREF(__pyx_tuple__14);

     140:         """

     141:         Block until this object is :meth:`ready`.

     142:

     143:         If the internal flag is true on entry, return immediately. Otherwise,

     144:         block until another thread (greenlet) calls :meth:`set` to set the flag to true,

     145:         or until the optional *timeout* expires.

     146:

     147:         When the *timeout* argument is present and not ``None``, it should be a

     148:         floating point number specifying a timeout for the operation in seconds

     149:         (or fractions thereof).

     150:

     151:         :return: This method returns true if and only if the internal flag has been set to

     152:             true, either before the wait call or after the wait starts, so it will

     153:             always return ``True`` except if a timeout is given and the operation

     154:             times out.

     155:

     156:         .. versionchanged:: 1.1

     157:             The return value represents the flag during the elapsed wait, not

     158:             just after it elapses. This solves a race condition if one greenlet

     159:             sets and then clears the flag without switching, while other greenlets

     160:             are waiting. When the waiters wake up, this will return True; previously,

     161:             they would still wake up, but the return value would be False. This is most

     162:             noticeable when the *timeout* is present.

     163:         """

    +164:         return self._wait(timeout)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2.__pyx_n = 1;
      __pyx_t_2.timeout = __pyx_v_timeout;
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     165:

    +166:     def _reset_internal_locks(self): # pragma: no cover

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_5Event_16_reset_internal_locks, "Event._reset_internal_locks(self)");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_5Event_17_reset_internal_locks = {"_reset_internal_locks", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_5Event_17_reset_internal_locks, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_5Event_16_reset_internal_locks};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_reset_internal_locks (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_5Event_16_reset_internal_locks(((struct __pyx_obj_6gevent_14_gevent_cevent_Event *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_5Event_16_reset_internal_locks(CYTHON_UNUSED struct __pyx_obj_6gevent_14_gevent_cevent_Event *__pyx_v_self) {
      PyObject *__pyx_r = NULL;

      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_5Event_17_reset_internal_locks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event__reset_internal_locks, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_Event, __pyx_n_s_reset_internal_locks, __pyx_t_3) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_Event);
    /* … */
      __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_reset_internal_locks, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 166, __pyx_L1_error)

     167:         # for compatibility with threading.Event

     168:         #  Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",)

     169:         # in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored

     170:         pass

     171:

     172:

    +173: class AsyncResult(AbstractLinkable): # pylint:disable=undefined-variable

    struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult {
      struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable __pyx_base;
      PyObject *(*get)(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_14_gevent_cevent_11AsyncResult_get *__pyx_optional_args);
      int (*successful)(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *, int __pyx_skip_dispatch);
      PyObject *(*wait)(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_14_gevent_cevent_11AsyncResult_wait *__pyx_optional_args);
      int (*done)(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *, int __pyx_skip_dispatch);
      int (*cancel)(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *, int __pyx_skip_dispatch);
      int (*cancelled)(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *, int __pyx_skip_dispatch);
    };
    static struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *__pyx_vtabptr_6gevent_14_gevent_cevent_AsyncResult;

     174:     """

     175:     A one-time event that stores a value or an exception.

     176:

     177:     Like :class:`Event` it wakes up all the waiters when :meth:`set`

     178:     or :meth:`set_exception` is called. Waiters may receive the passed

     179:     value or exception by calling :meth:`get` instead of :meth:`wait`.

     180:     An :class:`AsyncResult` instance cannot be reset.

     181:

     182:     .. important::

     183:        This object is for communicating among greenlets within the

     184:        same thread *only*! Do not try to use it to communicate across threads.

     185:

     186:     To pass a value call :meth:`set`. Calls to :meth:`get` (those that

     187:     are currently blocking as well as those made in the future) will

     188:     return the value::

     189:

     190:         >>> from gevent.event import AsyncResult

     191:         >>> result = AsyncResult()

     192:         >>> result.set(100)

     193:         >>> result.get()

     194:         100

     195:

     196:     To pass an exception call :meth:`set_exception`. This will cause

     197:     :meth:`get` to raise that exception::

     198:

     199:         >>> result = AsyncResult()

     200:         >>> result.set_exception(RuntimeError('failure'))

     201:         >>> result.get()

     202:         Traceback (most recent call last):

     203:          ...

     204:         RuntimeError: failure

     205:

     206:     :class:`AsyncResult` implements :meth:`__call__` and thus can be

     207:     used as :meth:`link` target::

     208:

     209:         >>> import gevent

     210:         >>> result = AsyncResult()

     211:         >>> gevent.spawn(lambda : 1/0).link(result)

     212:         >>> try:

     213:         ...     result.get()

     214:         ... except ZeroDivisionError:

     215:         ...     print('ZeroDivisionError')

     216:         ZeroDivisionError

     217:

     218:     .. note::

     219:

     220:         The order and timing in which waiting greenlets are awakened is not determined.

     221:         As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a

     222:         undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets

     223:         (those not waiting to be awakened) may run between the current greenlet yielding and

     224:         the waiting greenlets being awakened. These details may change in the future.

     225:

     226:     .. versionchanged:: 1.1

     227:

     228:        The exact order in which waiting greenlets

     229:        are awakened is not the same as in 1.0.

     230:

     231:     .. versionchanged:: 1.1

     232:

     233:        Callbacks :meth:`linked <rawlink>` to this object are required to

     234:        be hashable, and duplicates are merged.

     235:

     236:     .. versionchanged:: 1.5a3

     237:

     238:        Waiting greenlets are now awakened in the order in which they

     239:        waited.

     240:

     241:     .. versionchanged:: 1.5a3

     242:

     243:        The low-level ``rawlink`` method

     244:        (most users won't use this) now automatically unlinks waiters

     245:        before calling them.

     246:     """

     247:

    +248:     __slots__ = ('_value', '_exc_info', '_imap_task_index')

      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_slots, __pyx_tuple__16) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_value_2, __pyx_n_s_exc_info_2, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__16);
      __Pyx_GIVEREF(__pyx_tuple__16);

     249:

    +250:     def __init__(self):

    /* Python wrapper */
    static int __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      if (unlikely(__pyx_nargs > 0)) {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;}
      if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult___init__(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult___init__(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_r = 0;
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +251:         super(AsyncResult, self).__init__()

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
      __Pyx_GIVEREF((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult))) __PYX_ERR(0, 251, __pyx_L1_error);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self))) __PYX_ERR(0, 251, __pyx_L1_error);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +252:         self._value = _NONE

      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->_value);
      __Pyx_DECREF(__pyx_v_self->_value);
      __pyx_v_self->_value = __pyx_t_1;
      __pyx_t_1 = 0;

    +253:         self._exc_info = ()

      __Pyx_INCREF(__pyx_empty_tuple);
      __Pyx_GIVEREF(__pyx_empty_tuple);
      __Pyx_GOTREF(__pyx_v_self->_exc_info);
      __Pyx_DECREF(__pyx_v_self->_exc_info);
      __pyx_v_self->_exc_info = __pyx_empty_tuple;

     254:

    +255:     @property

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_10_exception___get__(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_10_exception___get__(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult._exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     256:     def _exception(self):

    +257:         return self._exc_info[1] if self._exc_info else _NONE

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
      if (__pyx_t_2) {
        if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 257, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __pyx_t_3;
        __pyx_t_3 = 0;
      } else {
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __pyx_t_3;
        __pyx_t_3 = 0;
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     258:

    +259:     @property

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_5value___get__(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_5value___get__(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     260:     def value(self):

     261:         """

     262:         Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise,

     263:         ``None``

     264:         """

    +265:         return self._value if self._value is not _NONE else None

      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = (__pyx_v_self->_value != __pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_3) {
        __Pyx_INCREF(__pyx_v_self->_value);
        __pyx_t_1 = __pyx_v_self->_value;
      } else {
        __Pyx_INCREF(Py_None);
        __pyx_t_1 = Py_None;
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     266:

    +267:     @property

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_8exc_info___get__(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_8exc_info___get__(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     268:     def exc_info(self):

     269:         """

     270:         The three-tuple of exception information if :meth:`set_exception` was called.

     271:         """

    +272:         if self._exc_info:

      __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +273:             return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2]))

        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 273, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 273, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 273, __pyx_L1_error)
        }
        __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_6gevent_14_gevent_cevent_load_traceback);
        __pyx_t_6 = __pyx_v_6gevent_14_gevent_cevent_load_traceback; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_2);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_3);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_4);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_4 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L0;

    +274:         return ()

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_empty_tuple);
      __pyx_r = __pyx_empty_tuple;
      goto __pyx_L0;

     275:

    +276:     def __str__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_3__str__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_3__str__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_2__str__(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_2__str__(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_v_result = NULL;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +277:         result = '<%s ' % (self.__class__.__name__, )

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_result = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

    +278:         if self.value is not None or self._exception is not _NONE:

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (__pyx_t_2 != Py_None);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!__pyx_t_4) {
      } else {
        __pyx_t_3 = __pyx_t_4;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = (__pyx_t_2 != __pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = __pyx_t_4;
      __pyx_L4_bool_binop_done:;
      if (__pyx_t_3) {
    /* … */
      }

    +279:             result += 'value=%r ' % self.value

        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_value_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

    +280:         if self._exception is not None and self._exception is not _NONE:

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = (__pyx_t_1 != Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_4) {
      } else {
        __pyx_t_3 = __pyx_t_4;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (__pyx_t_1 != __pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_3 = __pyx_t_4;
      __pyx_L7_bool_binop_done:;
      if (__pyx_t_3) {
    /* … */
      }

    +281:             result += 'exception=%r ' % self._exception

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_exception_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
        __pyx_t_2 = 0;

    +282:         if self._exception is _NONE:

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = (__pyx_t_2 == __pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_3) {
    /* … */
      }

    +283:             result += 'unset '

        __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_unset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
        __pyx_t_1 = 0;

    +284:         return result + ' _links[%s]>' % self.linkcount()

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.linkcount(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_links_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     285:

    +286:     def ready(self):

    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static int __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_ready(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
      int __pyx_r;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_5ready)) {
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_r = __pyx_t_6;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_4ready, "AsyncResult.ready(self) -> bool\nReturn true if and only if it holds a value or an exception");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_5ready, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_4ready};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ready (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_4ready(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_4ready(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_ready(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_ready, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_ready, __pyx_t_3) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 286, __pyx_L1_error)

     287:         """Return true if and only if it holds a value or an exception"""

    +288:         return self._exc_info or self._value is not _NONE

      __pyx_t_7 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
      if (!__pyx_t_7) {
      } else {
        __pyx_t_6 = __pyx_t_7;
        goto __pyx_L3_bool_binop_done;
      }
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = (__pyx_v_self->_value != __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __pyx_t_7;
      __pyx_L3_bool_binop_done:;
      __pyx_r = __pyx_t_6;
      goto __pyx_L0;

     289:

    +290:     def successful(self):

    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static int __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_successful(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
      int __pyx_r;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_7successful)) {
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_r = __pyx_t_6;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_6successful, "AsyncResult.successful(self) -> bool\nReturn true if and only if it is ready and holds a value");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_7successful = {"successful", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_7successful, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_6successful};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("successful (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_6successful(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_6successful(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_successful(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_7successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_successful, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_successful, __pyx_t_3) < 0) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_successful, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 290, __pyx_L1_error)

     291:         """Return true if and only if it is ready and holds a value"""

    +292:         return self._value is not _NONE

      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = (__pyx_v_self->_value != __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_6;
      goto __pyx_L0;

     293:

    +294:     @property

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_9exception___get__(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_9exception___get__(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     295:     def exception(self):

     296:         """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called.

     297:         Otherwise ``None``."""

    +298:         if self._exc_info:

      __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +299:             return self._exc_info[1]

        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 299, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;

     300:

    +301:     def set(self, value=None):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_9set(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_8set, "AsyncResult.set(self, value=None)\nStore the value and wake up any waiters.\n\n        All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n        Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n        ");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_9set = {"set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_9set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_8set};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_9set(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_value = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
      PyObject* values[1] = {0};
        values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value);
              if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_value = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("set", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 301, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_8set(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self), __pyx_v_value);

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_8set(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__19);
      __Pyx_GIVEREF(__pyx_tuple__19);
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_9set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_set, __pyx_t_3) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
      __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 301, __pyx_L1_error)

     302:         """Store the value and wake up any waiters.

     303:

     304:         All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.

     305:         Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.

     306:         """

    +307:         self._value = value

      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->_value);
      __Pyx_DECREF(__pyx_v_self->_value);
      __pyx_v_self->_value = __pyx_v_value;

    +308:         self._check_and_notify()

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     309:

    +310:     def set_exception(self, exception, exc_info=None):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_11set_exception(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_10set_exception, "AsyncResult.set_exception(self, exception, exc_info=None)\nStore the exception and wake up any waiters.\n\n        All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n        Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n\n        :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback`\n            as returned by :func:`sys.exc_info`. This will be used when the exception\n            is re-raised to propagate the correct traceback.\n        ");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_11set_exception = {"set_exception", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_11set_exception, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_10set_exception};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_11set_exception(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_exception = 0;
      PyObject *__pyx_v_exc_info = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set_exception (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception_2,&__pyx_n_s_exc_info,0};
      PyObject* values[2] = {0,0};
        values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exception_2)) != 0)) {
              (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
            CYTHON_FALLTHROUGH;
            case  1:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exc_info);
              if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_exception") < 0)) __PYX_ERR(0, 310, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_exception = values[0];
        __pyx_v_exc_info = values[1];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("set_exception", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 310, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_10set_exception(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self), __pyx_v_exception, __pyx_v_exc_info);

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_10set_exception(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_exc_info) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_exception_2, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__21);
      __Pyx_GIVEREF(__pyx_tuple__21);
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_11set_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set_exception, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_set_exception, __pyx_t_3) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
      __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set_exception, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 310, __pyx_L1_error)

     311:         """Store the exception and wake up any waiters.

     312:

     313:         All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.

     314:         Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.

     315:

     316:         :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback`

     317:             as returned by :func:`sys.exc_info`. This will be used when the exception

     318:             is re-raised to propagate the correct traceback.

     319:         """

    +320:         if exc_info:

      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc_info); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 320, __pyx_L1_error)
      if (__pyx_t_1) {
    /* … */
        goto __pyx_L3;
      }

    +321:             self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2]))

        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_6gevent_14_gevent_cevent_dump_traceback);
        __pyx_t_6 = __pyx_v_6gevent_14_gevent_cevent_dump_traceback; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
          __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_2);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_3);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_4);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error);
        __pyx_t_2 = 0;
        __pyx_t_3 = 0;
        __pyx_t_4 = 0;
        __Pyx_GIVEREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_v_self->_exc_info);
        __Pyx_DECREF(__pyx_v_self->_exc_info);
        __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_6);
        __pyx_t_6 = 0;

     322:         else:

    +323:             self._exc_info = (type(exception), exception, dump_traceback(None))

      /*else*/ {
        __Pyx_INCREF(__pyx_v_6gevent_14_gevent_cevent_dump_traceback);
        __pyx_t_4 = __pyx_v_6gevent_14_gevent_cevent_dump_traceback; __pyx_t_3 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, Py_None};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_exception)));
        __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_exception)));
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_exception)))) __PYX_ERR(0, 323, __pyx_L1_error);
        __Pyx_INCREF(__pyx_v_exception);
        __Pyx_GIVEREF(__pyx_v_exception);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_exception)) __PYX_ERR(0, 323, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_6);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error);
        __pyx_t_6 = 0;
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_v_self->_exc_info);
        __Pyx_DECREF(__pyx_v_self->_exc_info);
        __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_4);
        __pyx_t_4 = 0;
      }
      __pyx_L3:;

     324:

    +325:         self._check_and_notify()

      __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     326:

    +327:     def _raise_exception(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_12_raise_exception, "AsyncResult._raise_exception(self)");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_13_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_13_raise_exception, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_12_raise_exception};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_12_raise_exception(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_12_raise_exception(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_13_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult__raise_exception, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_raise_exception, __pyx_t_3) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_raise_exception, 327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 327, __pyx_L1_error)

    +328:         reraise(*self.exc_info)

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_14_gevent_cevent_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     329:

    +330:     def get(self, block=True, timeout=None):

    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_15get(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyObject *__pyx_f_6gevent_14_gevent_cevent_11AsyncResult_get(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_14_gevent_cevent_11AsyncResult_get *__pyx_optional_args) {
      PyObject *__pyx_v_block = ((PyObject *)Py_True);
      PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
      PyObject *__pyx_r = NULL;
      if (__pyx_optional_args) {
        if (__pyx_optional_args->__pyx_n > 0) {
          __pyx_v_block = __pyx_optional_args->block;
          if (__pyx_optional_args->__pyx_n > 1) {
            __pyx_v_timeout = __pyx_optional_args->timeout;
          }
        }
      }
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_15get)) {
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_r = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_15get(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_14get, "AsyncResult.get(self, block=True, timeout=None)\nReturn the stored value or raise the exception.\n\n        If this instance already holds a value or an exception, return  or raise it immediately.\n        Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or\n        until the optional timeout occurs.\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will\n        be raised.\n\n        :keyword bool block: If set to ``False`` and this instance is not ready,\n            immediately raise a :class:`Timeout` exception.\n        ");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_15get = {"get", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_15get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_14get};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_15get(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_block = 0;
      PyObject *__pyx_v_timeout = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
      PyObject* values[2] = {0,0};
        values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_True));
        values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_block);
              if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error)
            }
            CYTHON_FALLTHROUGH;
            case  1:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout);
              if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get") < 0)) __PYX_ERR(0, 330, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
            CYTHON_FALLTHROUGH;
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_block = values[0];
        __pyx_v_timeout = values[1];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 330, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_14get(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_14get(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2.__pyx_n = 2;
      __pyx_t_2.block = __pyx_v_block;
      __pyx_t_2.timeout = __pyx_v_timeout;
      __pyx_t_1 = __pyx_vtabptr_6gevent_14_gevent_cevent_AsyncResult->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__24);
      __Pyx_GIVEREF(__pyx_tuple__24);
      __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 330, __pyx_L1_error)
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_15get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__26);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_get, __pyx_t_3) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
      __pyx_tuple__26 = PyTuple_Pack(2, Py_True, Py_None); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_tuple__26);
      __Pyx_GIVEREF(__pyx_tuple__26);

     331:         """Return the stored value or raise the exception.

     332:

     333:         If this instance already holds a value or an exception, return  or raise it immediately.

     334:         Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or

     335:         until the optional timeout occurs.

     336:

     337:         When the *timeout* argument is present and not ``None``, it should be a

     338:         floating point number specifying a timeout for the operation in seconds

     339:         (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will

     340:         be raised.

     341:

     342:         :keyword bool block: If set to ``False`` and this instance is not ready,

     343:             immediately raise a :class:`Timeout` exception.

     344:         """

    +345:         if self._value is not _NONE:

      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = (__pyx_v_self->_value != __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_6) {
    /* … */
      }

    +346:             return self._value

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_self->_value);
        __pyx_r = __pyx_v_self->_value;
        goto __pyx_L0;

    +347:         if self._exc_info:

      __pyx_t_6 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
      if (__pyx_t_6) {
    /* … */
      }

    +348:             return self._raise_exception()

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L0;

     349:

    +350:         if not block:

      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 350, __pyx_L1_error)
      __pyx_t_7 = (!__pyx_t_6);
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

     351:             # Not ready and not blocking, so immediately timeout

    +352:             raise Timeout()

        __Pyx_INCREF(__pyx_v_6gevent_14_gevent_cevent_Timeout);
        __pyx_t_2 = __pyx_v_6gevent_14_gevent_cevent_Timeout; __pyx_t_3 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 352, __pyx_L1_error)

     353:

    +354:         self._capture_hub(True)

      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._capture_hub(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     355:

     356:         # Wait, raising a timeout that elapses

    +357:         self._wait_core(timeout, ())

      __pyx_t_8.__pyx_n = 1;
      __pyx_t_8.catch = __pyx_empty_tuple;
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait_core(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), __pyx_v_timeout, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     358:

     359:         # by definition we are now ready

    +360:         return self.get(block=False)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9.__pyx_n = 1;
      __pyx_t_9.block = Py_False;
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     361:

    +362:     def get_nowait(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_16get_nowait, "AsyncResult.get_nowait(self)\n\n        Return the value or raise the exception without blocking.\n\n        If this object is not yet :meth:`ready <ready>`, raise\n        :class:`gevent.Timeout` immediately.\n        ");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_17get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_17get_nowait, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_16get_nowait};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_16get_nowait(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_16get_nowait(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_17get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get_nowait, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_get_nowait, __pyx_t_3) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_nowait, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 362, __pyx_L1_error)

     363:         """

     364:         Return the value or raise the exception without blocking.

     365:

     366:         If this object is not yet :meth:`ready <ready>`, raise

     367:         :class:`gevent.Timeout` immediately.

     368:         """

    +369:         return self.get(block=False)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2.__pyx_n = 1;
      __pyx_t_2.block = Py_False;
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     370:

    +371:     def _wait_return_value(self, waited, wait_success):

    static PyObject *__pyx_f_6gevent_14_gevent_cevent_11AsyncResult__wait_return_value(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, CYTHON_UNUSED int __pyx_v_waited, CYTHON_UNUSED int __pyx_v_wait_success) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     372:         # pylint:disable=unused-argument

     373:         # Always return the value. Since this is a one-shot event,

     374:         # no race condition should reset it.

    +375:         return self.value

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     376:

    +377:     def wait(self, timeout=None):

    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_19wait(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyObject *__pyx_f_6gevent_14_gevent_cevent_11AsyncResult_wait(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_14_gevent_cevent_11AsyncResult_wait *__pyx_optional_args) {
      PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
      PyObject *__pyx_r = NULL;
      if (__pyx_optional_args) {
        if (__pyx_optional_args->__pyx_n > 0) {
          __pyx_v_timeout = __pyx_optional_args->timeout;
        }
      }
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_19wait)) {
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_timeout};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_r = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_19wait(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_18wait, "AsyncResult.wait(self, timeout=None)\nBlock until the instance is ready.\n\n        If this instance already holds a value, it is returned immediately. If this\n        instance already holds an exception, ``None`` is returned immediately.\n\n        Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception`\n        (at which point either the value or ``None`` will be returned, respectively),\n        or until the optional timeout expires (at which point ``None`` will also be\n        returned).\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof).\n\n        .. note:: If a timeout is given and expires, ``None`` will be returned\n            (no timeout exception will be raised).\n\n        ");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_19wait = {"wait", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_19wait, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_18wait};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_19wait(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_timeout = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("wait (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
      PyObject* values[1] = {0};
        values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout);
              if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 377, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "wait") < 0)) __PYX_ERR(0, 377, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_timeout = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 377, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_18wait(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self), __pyx_v_timeout);

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_18wait(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2.__pyx_n = 1;
      __pyx_t_2.timeout = __pyx_v_timeout;
      __pyx_t_1 = __pyx_vtabptr_6gevent_14_gevent_cevent_AsyncResult->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_19wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_wait, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_wait, __pyx_t_3) < 0) __PYX_ERR(0, 377, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 377, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 377, __pyx_L1_error)

     378:         """Block until the instance is ready.

     379:

     380:         If this instance already holds a value, it is returned immediately. If this

     381:         instance already holds an exception, ``None`` is returned immediately.

     382:

     383:         Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception`

     384:         (at which point either the value or ``None`` will be returned, respectively),

     385:         or until the optional timeout expires (at which point ``None`` will also be

     386:         returned).

     387:

     388:         When the *timeout* argument is present and not ``None``, it should be a

     389:         floating point number specifying a timeout for the operation in seconds

     390:         (or fractions thereof).

     391:

     392:         .. note:: If a timeout is given and expires, ``None`` will be returned

     393:             (no timeout exception will be raised).

     394:

     395:         """

    +396:         return self._wait(timeout)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6.__pyx_n = 1;
      __pyx_t_6.timeout = __pyx_v_timeout;
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     397:

     398:     # link protocol

    +399:     def __call__(self, source):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_source = 0;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
      PyObject* values[1] = {0};
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_source)) != 0)) {
              (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
              kw_args--;
            }
            else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error)
            else goto __pyx_L5_argtuple_error;
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(0, 399, __pyx_L3_error)
          }
        } else if (unlikely(__pyx_nargs != 1)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        }
        __pyx_v_source = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 399, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_20__call__(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self), __pyx_v_source);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_20__call__(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, PyObject *__pyx_v_source) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +400:         if source.successful():

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 400, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {
    /* … */
        goto __pyx_L3;
      }

    +401:             self.set(source.value)

        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     402:         else:

    +403:             self.set_exception(source.exception, getattr(source, 'exc_info', None))

      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_source, __pyx_n_s_exc_info, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_3, __pyx_t_6};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L3:;

     404:

     405:     # Methods to make us more like concurrent.futures.Future

     406:

    +407:     def result(self, timeout=None):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_23result(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_22result, "AsyncResult.result(self, timeout=None)");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_23result = {"result", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_23result, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_22result};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_23result(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_timeout = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("result (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_MACROS
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
      PyObject* values[1] = {0};
        values[0] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
        if (__pyx_kwds) {
          Py_ssize_t kw_args;
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
          switch (__pyx_nargs) {
            case  0:
            if (kw_args > 0) {
              PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_timeout);
              if (value) { values[0] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
              else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error)
            }
          }
          if (unlikely(kw_args > 0)) {
            const Py_ssize_t kwd_pos_args = __pyx_nargs;
            if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "result") < 0)) __PYX_ERR(0, 407, __pyx_L3_error)
          }
        } else {
          switch (__pyx_nargs) {
            case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_timeout = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("result", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 407, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_22result(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self), __pyx_v_timeout);

      /* function exit code */
      {
        Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
          __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
        }
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_22result(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_23result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_result, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_result, __pyx_t_3) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_result, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 407, __pyx_L1_error)

    +408:         return self.get(timeout=timeout)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 408, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

     409:

    +410:     set_result = set

      __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_set_result, __pyx_t_3) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);

     411:

    +412:     def done(self):

    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static int __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_done(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
      int __pyx_r;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_25done)) {
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_r = __pyx_t_6;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_24done, "AsyncResult.done(self) -> bool");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_25done = {"done", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_25done, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_24done};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("done (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_24done(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_24done(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_done(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_25done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_done, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_done, __pyx_t_3) < 0) __PYX_ERR(0, 412, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_done, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 412, __pyx_L1_error)

    +413:         return self.ready()

      __pyx_t_6 = ((struct __pyx_vtabstruct_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L1_error)
      __pyx_r = __pyx_t_6;
      goto __pyx_L0;

     414:

     415:     # we don't support cancelling

     416:

    +417:     def cancel(self):

    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static int __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_cancel(CYTHON_UNUSED struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
      int __pyx_r;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_27cancel)) {
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_r = __pyx_t_6;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_26cancel, "AsyncResult.cancel(self) -> bool");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_27cancel = {"cancel", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_27cancel, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_26cancel};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("cancel (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_26cancel(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_26cancel(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_cancel(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_27cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancel, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_cancel, __pyx_t_3) < 0) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);
    /* … */
      __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_cancel, 417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 417, __pyx_L1_error)

    +418:         return False

      __pyx_r = 0;
      goto __pyx_L0;

     419:

    +420:     def cancelled(self):

    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static int __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_cancelled(CYTHON_UNUSED struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
      int __pyx_r;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_29cancelled)) {
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
            __pyx_t_5 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
                __pyx_t_5 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_r = __pyx_t_6;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_28cancelled, "AsyncResult.cancelled(self) -> bool");
    static PyMethodDef __pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_29cancelled = {"cancelled", (PyCFunction)__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_29cancelled, METH_NOARGS, __pyx_doc_6gevent_14_gevent_cevent_11AsyncResult_28cancelled};
    static PyObject *__pyx_pw_6gevent_14_gevent_cevent_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("cancelled (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_28cancelled(((struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_14_gevent_cevent_11AsyncResult_28cancelled(struct __pyx_obj_6gevent_14_gevent_cevent_AsyncResult *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_14_gevent_cevent_11AsyncResult_cancelled(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_cevent.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_14_gevent_cevent_11AsyncResult_29cancelled, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancelled, NULL, __pyx_n_s_gevent__gevent_cevent, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult, __pyx_n_s_cancelled, __pyx_t_3) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      PyType_Modified(__pyx_ptype_6gevent_14_gevent_cevent_AsyncResult);

    +421:         return False

      __pyx_r = 0;
      goto __pyx_L0;

     422:

     423:     # exception is a method, we use it as a property

     424:

     425:

    +426: from gevent._util import import_c_accel

      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_n_s_import_c_accel);
      __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_import_c_accel)) __PYX_ERR(0, 426, __pyx_L1_error);
      __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_3) < 0) __PYX_ERR(0, 426, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +427: import_c_accel(globals(), 'gevent._event')

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error);
      __Pyx_INCREF(__pyx_kp_s_gevent__event);
      __Pyx_GIVEREF(__pyx_kp_s_gevent__event);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_s_gevent__event)) __PYX_ERR(0, 427, __pyx_L1_error);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;