/* Generated by Cython 0.29.15 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "name": "cymock",
        "sources": [
            "/home/ashley/code/cymock/cymock.pyx"
        ]
    },
    "module_name": "cymock"
}
END: Cython Metadata */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_15"
#define CYTHON_HEX_VERSION 0x001D0FF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
  #define PyObject_Unicode             PyObject_Str
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__cymock
#define __PYX_HAVE_API__cymock
/* Early includes */
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "cymock.pyx",
};
/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/
struct __pyx_obj_6cymock___pyx_scope_struct___check_signature;
struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature;
struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func;
struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock;
struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__;
struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with;
struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls;
struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr;
struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr;
struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper;
struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable;
struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable;
struct __pyx_obj_6cymock___pyx_scope_struct_12_patched;
struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target;
struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object;
struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple;
struct __pyx_obj_6cymock___pyx_scope_struct_16___call__;
struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr;
struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr;
struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method;
struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq;
struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne;
struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter;
struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter;
struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call;
struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with;
struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits;
struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr;
struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr;
struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open;
struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect;
struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect;
struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults2;
typedef struct __pyx_defaults2 __pyx_defaults2;
struct __pyx_defaults3;
typedef struct __pyx_defaults3 __pyx_defaults3;
struct __pyx_defaults {
  PyObject *__pyx_arg_return_value;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_new;
};
struct __pyx_defaults2 {
  PyObject *__pyx_arg_name;
  PyObject *__pyx_arg__the_name;
};
struct __pyx_defaults3 {
  PyObject *__pyx_arg_name;
  PyObject *__pyx_arg__the_name;
};

/* "cymock.pyx":118
 * 
 * 
 * def _check_signature(func, mock, skipfirst, instance=False):             # <<<<<<<<<<<<<<
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:
 */
struct __pyx_obj_6cymock___pyx_scope_struct___check_signature {
  PyObject_HEAD
  PyObject *__pyx_v_sig;
};


/* "cymock.pyx":174
 * 
 * 
 * def _set_signature(mock, original, instance=False):             # <<<<<<<<<<<<<<
 *     # creates a function with signature (*args, **kwargs) that delegates to a
 *     # mock. It still does signature checking by calling a lambda with the same
 */
struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature {
  PyObject_HEAD
  PyObject *__pyx_v_sig;
};


/* "cymock.pyx":201
 * 
 * 
 * def _setup_func(funcopy, mock, sig):             # <<<<<<<<<<<<<<
 *     funcopy.mock = mock
 * 
 */
struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func {
  PyObject_HEAD
  PyObject *__pyx_v_funcopy;
  PyObject *__pyx_v_mock;
};


/* "cymock.pyx":250
 * 
 * 
 * def _setup_async_mock(mock):             # <<<<<<<<<<<<<<
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine
 *     mock.await_count = 0
 */
struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock {
  PyObject_HEAD
  PyObject *__pyx_v_mock;
};


/* "cymock.pyx":741
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         if name in _allowed_names:
 *             # property setters go through here
 */
struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ {
  PyObject_HEAD
  PyObject *__pyx_v_original;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":898
 *             raise AssertionError(msg)
 * 
 *     def assert_called_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the last call was made with the specified arguments.
 * 
 */
struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with {
  PyObject_HEAD
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_kwargs;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":932
 * 
 * 
 *     def assert_has_calls(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified calls.
 *         The `mock_calls` list is checked for the calls.
 */
struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls {
  PyObject_HEAD
  PyObject *__pyx_v_expected;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":943
 *         they must all appear in `mock_calls`."""
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)             # <<<<<<<<<<<<<<
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
 *         if not any_order:
 */
struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *__pyx_outer_scope;
  PyObject *__pyx_v_e;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "cymock.pyx":944
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)             # <<<<<<<<<<<<<<
 *         if not any_order:
 *             if expected not in all_calls:
 */
struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *__pyx_outer_scope;
  PyObject *__pyx_v_c;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "cymock.pyx":1309
 * 
 *     @contextlib.contextmanager
 *     def decoration_helper(self, patched, args, keywargs):             # <<<<<<<<<<<<<<
 *         extra_args = []
 *         entered_patchers = []
 */
struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper {
  PyObject_HEAD
  PyObject *__pyx_v_arg;
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_entered_patchers;
  PyObject *__pyx_v_exc_info;
  PyObject *__pyx_v_extra_args;
  PyObject *__pyx_v_keywargs;
  PyObject *__pyx_v_patched;
  PyObject *__pyx_v_patching;
  PyObject *__pyx_v_self;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
};


/* "cymock.pyx":1341
 * 
 * 
 *     def decorate_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):
 */
struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable {
  PyObject_HEAD
  PyObject *__pyx_v_func;
  PyObject *__pyx_v_patched;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":1358
 * 
 * 
 *     def decorate_async_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):
 */
struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable {
  PyObject_HEAD
  PyObject *__pyx_v_func;
  PyObject *__pyx_v_patched;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":1365
 * 
 *         @wraps(func)
 *         async def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */
struct __pyx_obj_6cymock___pyx_scope_struct_12_patched {
  PyObject_HEAD
  struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *__pyx_outer_scope;
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_keywargs;
  PyObject *__pyx_v_newargs;
  PyObject *__pyx_v_newkeywargs;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
};


/* "cymock.pyx":1572
 * 
 * 
 * def _get_target(target):             # <<<<<<<<<<<<<<
 *     try:
 *         target, attribute = target.rsplit('.', 1)
 */
struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target {
  PyObject_HEAD
  PyObject *__pyx_v_target;
};


/* "cymock.pyx":1582
 * 
 * 
 * def _patch_object(             # <<<<<<<<<<<<<<
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,
 */
struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object {
  PyObject_HEAD
  PyObject *__pyx_v_target;
};


/* "cymock.pyx":1611
 * 
 * 
 * def _patch_multiple(target, spec=None, create=False, spec_set=None,             # <<<<<<<<<<<<<<
 *                     autospec=None, new_callable=None, **kwargs):
 *     """Perform multiple patches in a single call. It takes the object to be
 */
struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple {
  PyObject_HEAD
  PyObject *__pyx_v_target;
};


/* "cymock.pyx":1784
 * 
 * 
 *     def __call__(self, f):             # <<<<<<<<<<<<<<
 *         if isinstance(f, type):
 *             return self.decorate_class(f)
 */
struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ {
  PyObject_HEAD
  PyObject *__pyx_v_f;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":1905
 *     "add sub mul matmul div floordiv mod lshift rshift and xor or pow truediv"
 * )
 * inplace = ' '.join('i%s' % n for n in numerics.split())             # <<<<<<<<<<<<<<
 * right = ' '.join('r%s' % n for n in numerics.split())
 * 
 */
struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr {
  PyObject_HEAD
  PyObject *__pyx_v_n;
};


/* "cymock.pyx":1906
 * )
 * inplace = ' '.join('i%s' % n for n in numerics.split())
 * right = ' '.join('r%s' % n for n in numerics.split())             # <<<<<<<<<<<<<<
 * 
 * # not including __prepare__, __instancecheck__, __subclasscheck__
 */
struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr {
  PyObject_HEAD
  PyObject *__pyx_v_n;
};


/* "cymock.pyx":1921
 * 
 * 
 * def _get_method(name, func):             # <<<<<<<<<<<<<<
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):
 */
struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method {
  PyObject_HEAD
  PyObject *__pyx_v_func;
};


/* "cymock.pyx":1974
 * 
 * 
 * def _get_eq(self):             # <<<<<<<<<<<<<<
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value
 */
struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":1984
 *     return __eq__
 * 
 * def _get_ne(self):             # <<<<<<<<<<<<<<
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:
 */
struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":1993
 *     return __ne__
 * 
 * def _get_iter(self):             # <<<<<<<<<<<<<<
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value
 */
struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":2003
 *     return __iter__
 * 
 * def _get_async_iter(self):             # <<<<<<<<<<<<<<
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value
 */
struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":2148
 *         self.__dict__['__code__'] = code_mock
 * 
 *     async def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # This is nearly just like super(), except for sepcial handling
 *         # of coroutines
 */
struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call {
  PyObject_HEAD
  PyObject *__pyx_v__call;
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_effect;
  PyObject *__pyx_v_kwargs;
  PyObject *__pyx_v_result;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":2205
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the last await was with the specified arguments.
 */
struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with {
  PyObject_HEAD
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_kwargs;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":2247
 *             ) from cause
 * 
 *     def assert_has_awaits(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has been awaited with the specified calls.
 */
struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits {
  PyObject_HEAD
  PyObject *__pyx_v_expected;
  PyObject *__pyx_v_self;
};


/* "cymock.pyx":2260
 *         """
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)             # <<<<<<<<<<<<<<
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
 *         if not any_order:
 */
struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *__pyx_outer_scope;
  PyObject *__pyx_v_e;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "cymock.pyx":2261
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)             # <<<<<<<<<<<<<<
 *         if not any_order:
 *             if expected not in all_awaits:
 */
struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *__pyx_outer_scope;
  PyObject *__pyx_v_c;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "cymock.pyx":2772
 * 
 * 
 * def mock_open(mock=None, read_data=''):             # <<<<<<<<<<<<<<
 *     """
 *     A helper function to create a mock to replace the use of `open`. It works
 */
struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open {
  PyObject_HEAD
  PyObject *__pyx_v__iter_side_effect;
  PyObject *__pyx_v__readline_side_effect;
  PyObject *__pyx_v__state;
  PyObject *__pyx_v_handle;
  PyObject *__pyx_v_read_data;
};


/* "cymock.pyx":2797
 *         return _state[0].read(*args, **kwargs)
 * 
 *     def _readline_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         yield from _iter_side_effect()
 *         while True:
 */
struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect {
  PyObject_HEAD
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_outer_scope;
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_kwargs;
};


/* "cymock.pyx":2802
 *             yield _state[0].readline(*args, **kwargs)
 * 
 *     def _iter_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             while True:
 */
struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect {
  PyObject_HEAD
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_outer_scope;
  PyObject *__pyx_v_line;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "cymock.pyx":2903
 *         return self
 * 
 *     async def __anext__(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return next(self.iterator)
 */
struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif PY_MAJOR_VERSION < 3
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

/* IncludeStringH.proto */
#include <string.h>

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

/* PyExec.proto */
static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*);

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* IterNext.proto */
#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* CallableCheck.proto */
#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   ((obj)->ob_type->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* py_dict_items.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    (likely((cfunc)->func) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
            (PY_VERSION_HEX >= 0x030700A0 ?\
                (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
                (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
          (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
            (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
            (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
               ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) :\
               __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* pop.proto */
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L);
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L);
#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\
    __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L))
#else
#define __Pyx_PyList_Pop(L)  __Pyx__PyObject_Pop(L)
#define __Pyx_PyObject_Pop(L)  __Pyx__PyObject_Pop(L)
#endif

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* CallUnboundCMethod1.proto */
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

/* CallUnboundCMethod2.proto */
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

/* PyDictContains.proto */
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
    int result = PyDict_Contains(dict, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* pop_index.proto */
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix);
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix);
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix);
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\
        __Pyx__PyList_PopIndex(L, py_ix, ix) : (\
        (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
            __Pyx__PyObject_PopIndex(L, py_ix)))
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\
        __Pyx__PyList_PopIndex(L, py_ix, ix) : (\
        (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
            __Pyx__PyObject_PopIndex(L, py_ix)))
#else
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\
    __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
        __Pyx__PyObject_PopIndex(L, py_ix))
#endif

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Coroutine.proto */
#define __Pyx_Coroutine_USED
static PyTypeObject *__pyx_CoroutineType = 0;
static PyTypeObject *__pyx_CoroutineAwaitType = 0;
#define __Pyx_Coroutine_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineType)
#define __Pyx_Coroutine_Check(obj) __Pyx_Coroutine_CheckExact(obj)
#define __Pyx_CoroutineAwait_CheckExact(obj) (Py_TYPE(obj) == __pyx_CoroutineAwaitType)
#define __Pyx_Coroutine_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_CoroutineType, body, code, closure, name, qualname, module_name)
static int __pyx_Coroutine_init(void);
static PyObject *__Pyx__Coroutine_await(PyObject *coroutine);
typedef struct {
    PyObject_HEAD
    PyObject *coroutine;
} __pyx_CoroutineAwaitObject;
static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, PyObject *arg);
static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args);

/* GetAwaitIter.proto */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o);
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o);

/* CoroutineYieldFrom.proto */
static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source);

/* ReturnWithStopIteration.proto */
#define __Pyx_ReturnWithStopIteration(value)\
    if (value == Py_None) PyErr_SetNone(PyExc_StopIteration); else __Pyx__ReturnWithStopIteration(value)
static void __Pyx__ReturnWithStopIteration(PyObject* value);

/* py_dict_pop.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value);

/* MergeKeywords.proto */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

/* SliceTupleAndList.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
#else
#define __Pyx_PyList_GetSlice(seq, start, stop)   PySequence_GetSlice(seq, start, stop)
#define __Pyx_PyTuple_GetSlice(seq, start, stop)  PySequence_GetSlice(seq, start, stop)
#endif

/* StopAsyncIteration.proto */
#define __Pyx_StopAsyncIteration_USED
static PyObject *__Pyx_PyExc_StopAsyncIteration;
static int __pyx_StopAsyncIteration_init(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* GeneratorYieldFrom.proto */
static CYTHON_INLINE PyObject* __Pyx_Generator_Yield_From(__pyx_CoroutineObject *gen, PyObject *source);

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* PatchInspect.proto */
static PyObject* __Pyx_patch_inspect(PyObject* module);

/* PatchAsyncIO.proto */
static PyObject* __Pyx_patch_asyncio(PyObject* module);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CyFunctionClassCell.proto */
static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


/* Module declarations from 'cymock' */
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct___check_signature = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_1__set_signature = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_2__setup_func = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_3__setup_async_mock = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_4___setattr__ = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_5_assert_called_with = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_6_assert_has_calls = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_7_genexpr = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_8_genexpr = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_9_decoration_helper = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_10_decorate_callable = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_11_decorate_async_callable = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_12_patched = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_13__get_target = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_14__patch_object = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_15__patch_multiple = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_16___call__ = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_17_genexpr = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_18_genexpr = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_19__get_method = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_20__get_eq = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_21__get_ne = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_22__get_iter = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_23__get_async_iter = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_24__execute_mock_call = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_25_assert_awaited_with = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_26_assert_has_awaits = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_27_genexpr = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_28_genexpr = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_29_mock_open = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_30__readline_side_effect = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_31__iter_side_effect = 0;
static PyTypeObject *__pyx_ptype_6cymock___pyx_scope_struct_32___anext__ = 0;
static PyObject *__pyx_7genexpr__pyx_v_6cymock_name;
static PyObject *__pyx_9genexpr13__pyx_v_6cymock_method;
#define __Pyx_MODULE_NAME "cymock"
extern int __pyx_module_is_main_cymock;
int __pyx_module_is_main_cymock = 0;

/* Implementation of 'cymock' */
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_BaseException;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_classmethod;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_reversed;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_open;
static const char __pyx_k_[] = "/";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_s[] = "__%s__";
static const char __pyx_k_eq[] = "__eq__";
static const char __pyx_k_ge[] = "__ge__";
static const char __pyx_k_gt[] = "__gt__";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_io[] = "io";
static const char __pyx_k_kw[] = "kw";
static const char __pyx_k_le[] = "__le__";
static const char __pyx_k_lt[] = "__lt__";
static const char __pyx_k_ne[] = "__ne__";
static const char __pyx_k_sf[] = "sf";
static const char __pyx_k_1_0[] = "1.0";
static const char __pyx_k_ANY[] = "<ANY>";
static const char __pyx_k__31[] = "";
static const char __pyx_k__32[] = "()";
static const char __pyx_k__33[] = ".";
static const char __pyx_k__36[] = "().";
static const char __pyx_k__37[] = "<";
static const char __pyx_k__38[] = "'>";
static const char __pyx_k__39[] = "_";
static const char __pyx_k__43[] = "\n";
static const char __pyx_k__44[] = ": ";
static const char __pyx_k__77[] = ", ";
static const char __pyx_k__78[] = "=";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_all[] = "__all__";
static const char __pyx_k_arg[] = "arg";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_del[] = "__del__";
static const char __pyx_k_dir[] = "__dir__";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dot[] = "dot";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_i_s[] = "i%s";
static const char __pyx_k_ids[] = "ids";
static const char __pyx_k_int[] = "__int__";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_len[] = "__len__";
static const char __pyx_k_mro[] = "__mro__";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_r_s[] = "r%s";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_ret[] = "ret";
static const char __pyx_k_s_2[] = ".%s";
static const char __pyx_k_s_s[] = "%s(%%s)";
static const char __pyx_k_set[] = "_set";
static const char __pyx_k_sig[] = "sig";
static const char __pyx_k_src[] = "src";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_two[] = "two";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_Base[] = "Base";
static const char __pyx_k_Call[] = "_Call";
static const char __pyx_k_Mock[] = "Mock";
static const char __pyx_k__294[] = " ";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_attr[] = "attr";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_bind[] = "bind";
static const char __pyx_k_bool[] = "__bool__";
static const char __pyx_k_call[] = "__call__";
static const char __pyx_k_code[] = "__code__";
static const char __pyx_k_comp[] = "comp";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_func[] = "__func__";
static const char __pyx_k_hash[] = "__hash__";
static const char __pyx_k_id_2[] = " id='";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_io_2[] = "_io";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_kall[] = "kall";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_last[] = "last";
static const char __pyx_k_line[] = "line";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mock[] = "mock";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_next[] = "__next__";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_seal[] = "seal";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_spec[] = "spec";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_test[] = "test";
static const char __pyx_k_type[] = "_type";
static const char __pyx_k_vals[] = "vals";
static const char __pyx_k_ANY_2[] = "ANY";
static const char __pyx_k_ANY_3[] = "_ANY";
static const char __pyx_k_Calls[] = "Calls";
static const char __pyx_k_Klass[] = "Klass";
static const char __pyx_k_aexit[] = "__aexit__";
static const char __pyx_k_aiter[] = "__aiter__";
static const char __pyx_k_anext[] = "__anext__";
static const char __pyx_k_await[] = "__await__";
static const char __pyx_k_bases[] = "__bases__";
static const char __pyx_k_calls[] = "calls";
static const char __pyx_k_cause[] = "cause";
static const char __pyx_k_child[] = "child";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_entry[] = "entry";
static const char __pyx_k_final[] = "final";
static const char __pyx_k_first[] = "_first";
static const char __pyx_k_fixed[] = "fixed";
static const char __pyx_k_float[] = "__float__";
static const char __pyx_k_get_2[] = "_get";
static const char __pyx_k_get_3[] = "__get__";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_inner[] = "_inner";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_klass[] = "klass";
static const char __pyx_k_len_2[] = "_len";
static const char __pyx_k_local[] = "local";
static const char __pyx_k_names[] = "names";
static const char __pyx_k_new_2[] = "new";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_patch[] = "_patch";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_right[] = "right";
static const char __pyx_k_set_2[] = "__set__";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "_state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_thing[] = "thing";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_times[] = " times.";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_union[] = "union";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_wraps[] = "wraps";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_Actual[] = "\nActual: ";
static const char __pyx_k_action[] = "action";
static const char __pyx_k_actual[] = "actual";
static const char __pyx_k_aenter[] = "__aenter__";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_assert[] = "assert";
static const char __pyx_k_assret[] = "assret";
static const char __pyx_k_call_2[] = "call";
static const char __pyx_k_call_3[] = "_call";
static const char __pyx_k_call_s[] = "call%s";
static const char __pyx_k_called[] = "called";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_cymock[] = "cymock";
static const char __pyx_k_delete[] = "__delete__";
static const char __pyx_k_dict_2[] = "dict";
static const char __pyx_k_effect[] = "effect";
static const char __pyx_k_extras[] = "extras";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_fspath[] = "__fspath__";
static const char __pyx_k_func_2[] = "func";
static const char __pyx_k_get_eq[] = "_get_eq";
static const char __pyx_k_get_ne[] = "_get_ne";
static const char __pyx_k_getter[] = "getter";
static const char __pyx_k_handle[] = "handle";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_lambda[] = "<lambda>";
static const char __pyx_k_m_name[] = "m_name";
static const char __pyx_k_magics[] = "_magics";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_mock_2[] = "_mock_";
static const char __pyx_k_mock_3[] = "mock.";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_name_3[] = "_name";
static const char __pyx_k_name_r[] = " name=%r";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_pprint[] = "pprint";
static const char __pyx_k_prefix[] = "prefix";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_remove[] = "remove";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_rsplit[] = "rsplit";
static const char __pyx_k_rstrip[] = "rstrip";
static const char __pyx_k_second[] = "second";
static const char __pyx_k_sizeof[] = "__sizeof__";
static const char __pyx_k_sorted[] = "sorted";
static const char __pyx_k_spec_r[] = " spec=%r";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_test_2[] = "__test__";
static const char __pyx_k_unsafe[] = "unsafe";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_BytesIO[] = "BytesIO";
static const char __pyx_k_DEFAULT[] = "DEFAULT";
static const char __pyx_k_DELETED[] = "DELETED";
static const char __pyx_k_MISSING[] = "MISSING";
static const char __pyx_k_asyncio[] = "asyncio";
static const char __pyx_k_await_2[] = "await";
static const char __pyx_k_bases_2[] = "bases";
static const char __pyx_k_complex[] = "__complex__";
static const char __pyx_k_context[] = "context";
static const char __pyx_k_delattr[] = "__delattr__";
static const char __pyx_k_deleted[] = "_deleted";
static const char __pyx_k_first_2[] = "first";
static const char __pyx_k_funcopy[] = "funcopy";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_getattr[] = "__getattr__";
static const char __pyx_k_in_dict[] = "in_dict";
static const char __pyx_k_index_2[] = "__index__";
static const char __pyx_k_inherit[] = "inherit";
static const char __pyx_k_inplace[] = "inplace";
static const char __pyx_k_inspect[] = "inspect";
static const char __pyx_k_instead[] = " instead";
static const char __pyx_k_is_list[] = "_is_list";
static const char __pyx_k_is_type[] = "is_type";
static const char __pyx_k_m_value[] = "m_value";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_missing[] = "_missing";
static const char __pyx_k_newargs[] = "newargs";
static const char __pyx_k_partial[] = "partial";
static const char __pyx_k_patch_2[] = "patch";
static const char __pyx_k_patched[] = "patched";
static const char __pyx_k_patcher[] = "patcher";
static const char __pyx_k_pformat[] = "pformat";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_problem[] = "problem";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_ret_val[] = "ret_val";
static const char __pyx_k_setattr[] = "__setattr__";
static const char __pyx_k_stopall[] = "stopall";
static const char __pyx_k_version[] = "__version__";
static const char __pyx_k_visited[] = "visited";
static const char __pyx_k_wrapper[] = "wrapper";
static const char __pyx_k_ANY___eq[] = "_ANY.__eq__";
static const char __pyx_k_ANY___ne[] = "_ANY.__ne__";
static const char __pyx_k_Actual_2[] = "Actual";
static const char __pyx_k_CallList[] = "_CallList";
static const char __pyx_k_CodeType[] = "CodeType";
static const char __pyx_k_Expected[] = "Expected '";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_MockIter[] = "_MockIter";
static const char __pyx_k_Sentinel[] = "_Sentinel";
static const char __pyx_k_StringIO[] = "StringIO";
static const char __pyx_k_autospec[] = "autospec";
static const char __pyx_k_builtins[] = "__builtins__";
static const char __pyx_k_call_s_2[] = "call.%s";
static const char __pyx_k_callable[] = "_callable";
static const char __pyx_k_checksig[] = "checksig";
static const char __pyx_k_children[] = "children";
static const char __pyx_k_co_flags[] = "co_flags";
static const char __pyx_k_contains[] = "__contains__";
static const char __pyx_k_defaults[] = "__defaults__";
static const char __pyx_k_eat_self[] = "eat_self";
static const char __pyx_k_exc_info[] = "exc_info";
static const char __pyx_k_expected[] = "expected";
static const char __pyx_k_format_2[] = "__format__";
static const char __pyx_k_get_iter[] = "_get_iter";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_importer[] = "_importer";
static const char __pyx_k_instance[] = "instance";
static const char __pyx_k_is_local[] = "is_local";
static const char __pyx_k_is_magic[] = "_is_magic";
static const char __pyx_k_iterator[] = "iterator";
static const char __pyx_k_keywargs[] = "keywargs";
static const char __pyx_k_kwargs_2[] = "_kwargs";
static const char __pyx_k_len_self[] = "len_self";
static const char __pyx_k_multiple[] = "multiple";
static const char __pyx_k_new_attr[] = "new_attr";
static const char __pyx_k_new_name[] = "new_name";
static const char __pyx_k_numerics[] = "numerics";
static const char __pyx_k_obj_type[] = "obj_type";
static const char __pyx_k_original[] = "original";
static const char __pyx_k_parent_2[] = "_parent";
static const char __pyx_k_patching[] = "patching";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_readline[] = "readline";
static const char __pyx_k_reversed[] = "reversed";
static const char __pyx_k_sentinel[] = "sentinel";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_sig_func[] = "sig_func";
static const char __pyx_k_spec_arg[] = "spec_arg";
static const char __pyx_k_spec_set[] = "spec_set";
static const char __pyx_k_sub_list[] = "sub_list";
static const char __pyx_k_the_name[] = "_the_name";
static const char __pyx_k_try_iter[] = "_try_iter";
static const char __pyx_k_AsyncMock[] = "AsyncMock";
static const char __pyx_k_Call___eq[] = "_Call.__eq__";
static const char __pyx_k_Call_args[] = "_Call.args";
static const char __pyx_k_MagicMock[] = "MagicMock";
static const char __pyx_k_SpecState[] = "_SpecState";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_all_calls[] = "all_calls";
static const char __pyx_k_any_order[] = "any_order";
static const char __pyx_k_arguments[] = "arguments";
static const char __pyx_k_attribute[] = "attribute";
static const char __pyx_k_call_args[] = "call_args";
static const char __pyx_k_call_list[] = "call_list";
static const char __pyx_k_code_mock[] = "code_mock";
static const char __pyx_k_decorated[] = "decorated";
static const char __pyx_k_decorator[] = "decorator";
static const char __pyx_k_delegated[] = "delegated";
static const char __pyx_k_file_spec[] = "file_spec";
static const char __pyx_k_from_dict[] = "from_dict";
static const char __pyx_k_from_kall[] = "from_kall";
static const char __pyx_k_from_type[] = "from_type";
static const char __pyx_k_functools[] = "functools";
static const char __pyx_k_getformat[] = "__getformat__";
static const char __pyx_k_has_local[] = "has_local";
static const char __pyx_k_is_a_call[] = "is_a_call";
static const char __pyx_k_len_other[] = "len_other";
static const char __pyx_k_len_value[] = "len_value";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_missing_2[] = "__missing__";
static const char __pyx_k_mock_call[] = "_mock_call";
static const char __pyx_k_mock_name[] = "_mock_name";
static const char __pyx_k_mock_open[] = "mock_open";
static const char __pyx_k_must_skip[] = "_must_skip";
static const char __pyx_k_name_list[] = "_name_list";
static const char __pyx_k_not_found[] = "not_found";
static const char __pyx_k_patchings[] = "patchings";
static const char __pyx_k_read_data[] = "read_data";
static const char __pyx_k_readlines[] = "readlines";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_safe_repr[] = "safe_repr";
static const char __pyx_k_self_args[] = "self_args";
static const char __pyx_k_self_name[] = "self_name";
static const char __pyx_k_sentinels[] = "_sentinels";
static const char __pyx_k_setformat[] = "__setformat__";
static const char __pyx_k_signature[] = "signature";
static const char __pyx_k_skipfirst[] = "skipfirst";
static const char __pyx_k_this_spec[] = "this_spec";
static const char __pyx_k_to_stream[] = "_to_stream";
static const char __pyx_k_ANY___repr[] = "_ANY.__repr__";
static const char __pyx_k_Call___new[] = "_Call.__new__";
static const char __pyx_k_Call_count[] = "_Call.count";
static const char __pyx_k_Call_index[] = "_Call.index";
static const char __pyx_k_Cannot_set[] = "Cannot set ";
static const char __pyx_k_Expected_2[] = "\nExpected: ";
static const char __pyx_k_Expected_3[] = "Expected ";
static const char __pyx_k_FILTER_DIR[] = "FILTER_DIR";
static const char __pyx_k_MagicMixin[] = "MagicMixin";
static const char __pyx_k_MagicProxy[] = "MagicProxy";
static const char __pyx_k_MethodType[] = "MethodType";
static const char __pyx_k_ModuleType[] = "ModuleType";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_all_awaits[] = "all_awaits";
static const char __pyx_k_all_magics[] = "_all_magics";
static const char __pyx_k_attr_value[] = "attr_value";
static const char __pyx_k_await_args[] = "await_args";
static const char __pyx_k_bound_args[] = "bound_args";
static const char __pyx_k_builtins_2[] = "_builtins";
static const char __pyx_k_builtins_3[] = "builtins";
static const char __pyx_k_call_count[] = "call_count";
static const char __pyx_k_calls_repr[] = "_calls_repr";
static const char __pyx_k_checksig_2[] = "_checksig_";
static const char __pyx_k_clear_dict[] = "_clear_dict";
static const char __pyx_k_components[] = "components";
static const char __pyx_k_contextlib[] = "contextlib";
static const char __pyx_k_coroutines[] = "coroutines";
static const char __pyx_k_cymock_pyx[] = "cymock.pyx";
static const char __pyx_k_dot_lookup[] = "_dot_lookup";
static const char __pyx_k_eat_self_2[] = "_eat_self";
static const char __pyx_k_extra_args[] = "extra_args";
static const char __pyx_k_get_method[] = "_get_method";
static const char __pyx_k_get_target[] = "_get_target";
static const char __pyx_k_getnewargs[] = "__getnewargs__";
static const char __pyx_k_inner_mock[] = "inner_mock";
static const char __pyx_k_is_started[] = "_is_started";
static const char __pyx_k_kwdefaults[] = "__kwdefaults__";
static const char __pyx_k_mock_calls[] = "mock_calls";
static const char __pyx_k_mock_wraps[] = "_mock_wraps";
static const char __pyx_k_new_name_2[] = "_new_name";
static const char __pyx_k_new_parent[] = "_new_parent";
static const char __pyx_k_not_called[] = "not called.";
static const char __pyx_k_original_2[] = "_original";
static const char __pyx_k_other_args[] = "other_args";
static const char __pyx_k_other_name[] = "other_name";
static const char __pyx_k_patch_copy[] = "_patch.copy";
static const char __pyx_k_patch_dict[] = "_patch_dict";
static const char __pyx_k_patch_stop[] = "_patch.stop";
static const char __pyx_k_reset_data[] = "reset_data";
static const char __pyx_k_reset_mock[] = "reset_mock";
static const char __pyx_k_reversed_2[] = "__reversed__";
static const char __pyx_k_safe_super[] = "_safe_super";
static const char __pyx_k_sentinel_s[] = "sentinel.%s";
static const char __pyx_k_setdefault[] = "setdefault";
static const char __pyx_k_setup_func[] = "_setup_func";
static const char __pyx_k_spec_class[] = "_spec_class";
static const char __pyx_k_spec_set_2[] = "_spec_set";
static const char __pyx_k_spec_set_r[] = " spec_set=%r";
static const char __pyx_k_spec_state[] = "_spec_state";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_subclasses[] = "__subclasses__";
static const char __pyx_k_Base___init[] = "Base.__init__";
static const char __pyx_k_Call___call[] = "_Call.__call__";
static const char __pyx_k_Call___init[] = "_Call.__init__";
static const char __pyx_k_Call___repr[] = "_Call.__repr__";
static const char __pyx_k_Call_kwargs[] = "_Call.kwargs";
static const char __pyx_k_Not_awaited[] = "\nNot awaited";
static const char __pyx_k_TEST_PREFIX[] = "TEST_PREFIX";
static const char __pyx_k_annotations[] = "__annotations__";
static const char __pyx_k_args_string[] = "args_string";
static const char __pyx_k_as_instance[] = "as_instance";
static const char __pyx_k_attach_mock[] = "attach_mock";
static const char __pyx_k_await_count[] = "await_count";
static const char __pyx_k_child_klass[] = "child_klass";
static const char __pyx_k_classmethod[] = "classmethod";
static const char __pyx_k_create_mock[] = "create_mock";
static const char __pyx_k_getinitargs[] = "__getinitargs__";
static const char __pyx_k_import_path[] = "import_path";
static const char __pyx_k_isawaitable[] = "isawaitable";
static const char __pyx_k_mock_called[] = "_mock_called";
static const char __pyx_k_mock_name_2[] = "mock_name";
static const char __pyx_k_mock_parent[] = "_mock_parent";
static const char __pyx_k_mock_sealed[] = "_mock_sealed";
static const char __pyx_k_mock_unsafe[] = "_mock_unsafe";
static const char __pyx_k_name_string[] = "name_string";
static const char __pyx_k_newkeywargs[] = "newkeywargs";
static const char __pyx_k_orig_magics[] = "orig_magics";
static const char __pyx_k_patch___new[] = "patch.__new__";
static const char __pyx_k_patch_start[] = "_patch.start";
static const char __pyx_k_read_data_2[] = "_read_data";
static const char __pyx_k_self_kwargs[] = "self_kwargs";
static const char __pyx_k_side_effect[] = "side_effect";
static const char __pyx_k_signature_2[] = "__signature__";
static const char __pyx_k_spec_asyncs[] = "_spec_asyncs";
static const char __pyx_k_spec_string[] = "spec_string";
static const char __pyx_k_CO_COROUTINE[] = "CO_COROUTINE";
static const char __pyx_k_PropertyMock[] = "PropertyMock";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_async_magics[] = "_async_magics";
static const char __pyx_k_bind_partial[] = "bind_partial";
static const char __pyx_k_call_matcher[] = "_call_matcher";
static const char __pyx_k_extract_mock[] = "_extract_mock";
static const char __pyx_k_get_original[] = "get_original";
static const char __pyx_k_getattribute[] = "__getattribute__";
static const char __pyx_k_intersection[] = "intersection";
static const char __pyx_k_is_async_obj[] = "_is_async_obj";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_is_exception[] = "_is_exception";
static const char __pyx_k_isidentifier[] = "isidentifier";
static const char __pyx_k_method_calls[] = "method_calls";
static const char __pyx_k_mock_methods[] = "_mock_methods";
static const char __pyx_k_new_callable[] = "new_callable";
static const char __pyx_k_non_defaults[] = "_non_defaults";
static const char __pyx_k_not_callable[] = "not_callable";
static const char __pyx_k_other_kwargs[] = "other_kwargs";
static const char __pyx_k_patch___call[] = "_patch.__call__";
static const char __pyx_k_patch___exit[] = "_patch.__exit__";
static const char __pyx_k_patch___init[] = "_patch.__init__";
static const char __pyx_k_patch_object[] = "_patch_object";
static const char __pyx_k_return_value[] = "return_value";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_these_magics[] = "these_magics";
static const char __pyx_k_this_patcher[] = "this_patcher";
static const char __pyx_k_unpatch_dict[] = "_unpatch_dict";
static const char __pyx_k_AsyncIterator[] = "_AsyncIterator";
static const char __pyx_k_BaseException[] = "BaseException";
static const char __pyx_k_CallableMixin[] = "CallableMixin";
static const char __pyx_k_FunctionTypes[] = "FunctionTypes";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_TextIOWrapper[] = "TextIOWrapper";
static const char __pyx_k_actual_string[] = "actual_string";
static const char __pyx_k_allowed_names[] = "_allowed_names";
static const char __pyx_k_assert_called[] = "assert_called";
static const char __pyx_k_asyncio_tasks[] = "asyncio.tasks";
static const char __pyx_k_error_message[] = "_error_message";
static const char __pyx_k_getnewargs_ex[] = "__getnewargs_ex__";
static const char __pyx_k_instancecheck[] = "__instancecheck__";
static const char __pyx_k_is_async_func[] = "_is_async_func";
static const char __pyx_k_kwargs_string[] = "kwargs_string";
static const char __pyx_k_magic_methods[] = "magic_methods";
static const char __pyx_k_mock_add_spec[] = "_mock_add_spec";
static const char __pyx_k_mock_children[] = "_mock_children";
static const char __pyx_k_mock_delegate[] = "_mock_delegate";
static const char __pyx_k_mock_new_name[] = "_mock_new_name";
static const char __pyx_k_patch___enter[] = "_patch.__enter__";
static const char __pyx_k_patch_stopall[] = "_patch_stopall";
static const char __pyx_k_remove_magics[] = "remove_magics";
static const char __pyx_k_return_values[] = "_return_values";
static const char __pyx_k_set_signature[] = "_set_signature";
static const char __pyx_k_side_effector[] = "side_effector";
static const char __pyx_k_subclasscheck[] = "__subclasscheck__";
static const char __pyx_k_temp_original[] = "temp_original";
static const char __pyx_k_unittest_util[] = "unittest.util";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_AsyncMockMixin[] = "AsyncMockMixin";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_Call___getattr[] = "_Call.__getattr__";
static const char __pyx_k_Call_call_list[] = "_Call.call_list";
static const char __pyx_k_Expected_await[] = "Expected await: ";
static const char __pyx_k_NotImplemented[] = "NotImplemented";
static const char __pyx_k_SentinelObject[] = "_SentinelObject";
static const char __pyx_k_active_patches[] = "_active_patches";
static const char __pyx_k_assert_awaited[] = "assert_awaited";
static const char __pyx_k_attribute_name[] = "attribute_name";
static const char __pyx_k_call_args_list[] = "call_args_list";
static const char __pyx_k_configure_mock[] = "configure_mock";
static const char __pyx_k_contextmanager[] = "contextmanager";
static const char __pyx_k_decorate_class[] = "decorate_class";
static const char __pyx_k_formatted_args[] = "formatted_args";
static const char __pyx_k_get_async_iter[] = "_get_async_iter";
static const char __pyx_k_get_child_mock[] = "_get_child_mock";
static const char __pyx_k_mock_call_args[] = "_mock_call_args";
static const char __pyx_k_mock_call_name[] = "mock_call_name";
static const char __pyx_k_mock_check_sig[] = "_mock_check_sig";
static const char __pyx_k_mock_from_kall[] = "_mock_from_kall";
static const char __pyx_k_patch_multiple[] = "_patch_multiple";
static const char __pyx_k_spec_signature[] = "_spec_signature";
static const char __pyx_k_text_signature[] = "__text_signature__";
static const char __pyx_k_this_mock_call[] = "this_mock_call";
static const char __pyx_k_with_traceback[] = "with_traceback";
static const char __pyx_k_AsyncMagicMixin[] = "AsyncMagicMixin";
static const char __pyx_k_CallList___repr[] = "_CallList.__repr__";
static const char __pyx_k_Calls_not_found[] = "Calls not found.";
static const char __pyx_k_MockIter___init[] = "_MockIter.__init__";
static const char __pyx_k_MockIter___next[] = "_MockIter.__next__";
static const char __pyx_k_NonCallableMock[] = "NonCallableMock";
static const char __pyx_k_Sentinel___init[] = "_Sentinel.__init__";
static const char __pyx_k_all_sync_magics[] = "_all_sync_magics";
static const char __pyx_k_assert_any_call[] = "assert_any_call";
static const char __pyx_k_await_args_list[] = "await_args_list";
static const char __pyx_k_check_signature[] = "_check_signature";
static const char __pyx_k_create_autospec[] = "create_autospec";
static const char __pyx_k_do_method_calls[] = "do_method_calls";
static const char __pyx_k_error_message_2[] = "error_message";
static const char __pyx_k_expected_string[] = "expected_string";
static const char __pyx_k_get_side_effect[] = "__get_side_effect";
static const char __pyx_k_is_async_func_2[] = "is_async_func";
static const char __pyx_k_mock_add_spec_2[] = "mock_add_spec";
static const char __pyx_k_mock_await_args[] = "_mock_await_args";
static const char __pyx_k_mock_call_count[] = "_mock_call_count";
static const char __pyx_k_mock_mock_calls[] = "_mock_mock_calls";
static const char __pyx_k_mock_new_parent[] = "_mock_new_parent";
static const char __pyx_k_mock_set_magics[] = "_mock_set_magics";
static const char __pyx_k_set_side_effect[] = "__set_side_effect";
static const char __pyx_k_Awaits_not_found[] = "Awaits not found.";
static const char __pyx_k_MagicProxy___get[] = "MagicProxy.__get__";
static const char __pyx_k_SpecState___init[] = "_SpecState.__init__";
static const char __pyx_k_assert_any_await[] = "assert_any_await";
static const char __pyx_k_assert_has_calls[] = "assert_has_calls";
static const char __pyx_k_entered_patchers[] = "entered_patchers";
static const char __pyx_k_from_child_mocks[] = "from_child_mocks";
static const char __pyx_k_get_return_value[] = "__get_return_value";
static const char __pyx_k_is_instance_mock[] = "_is_instance_mock";
static const char __pyx_k_isdatadescriptor[] = "isdatadescriptor";
static const char __pyx_k_iter_side_effect[] = "_iter_side_effect";
static const char __pyx_k_method_call_name[] = "method_call_name";
static const char __pyx_k_mock_await_count[] = "_mock_await_count";
static const char __pyx_k_mock_side_effect[] = "_mock_side_effect";
static const char __pyx_k_next_side_effect[] = "_next_side_effect";
static const char __pyx_k_read_side_effect[] = "_read_side_effect";
static const char __pyx_k_s_call_not_found[] = "%s call not found";
static const char __pyx_k_set_return_value[] = "_set_return_value";
static const char __pyx_k_setup_async_mock[] = "_setup_async_mock";
static const char __pyx_k_spec_as_instance[] = "_spec_as_instance";
static const char __pyx_k_MagicMixin___init[] = "MagicMixin.__init__";
static const char __pyx_k_MagicProxy___init[] = "MagicProxy.__init__";
static const char __pyx_k_Sentinel___reduce[] = "_Sentinel.__reduce__";
static const char __pyx_k_assert_has_awaits[] = "assert_has_awaits";
static const char __pyx_k_assert_not_called[] = "assert_not_called";
static const char __pyx_k_copy_func_details[] = "_copy_func_details";
static const char __pyx_k_decorate_callable[] = "decorate_callable";
static const char __pyx_k_decoration_helper[] = "decoration_helper";
static const char __pyx_k_execute_mock_call[] = "_execute_mock_call";
static const char __pyx_k_extract_mock_name[] = "_extract_mock_name";
static const char __pyx_k_instance_callable[] = "_instance_callable";
static const char __pyx_k_mock_return_value[] = "_mock_return_value";
static const char __pyx_k_patch_dict___call[] = "_patch_dict.__call__";
static const char __pyx_k_patch_dict___exit[] = "_patch_dict.__exit__";
static const char __pyx_k_patch_dict___init[] = "_patch_dict.__init__";
static const char __pyx_k_return_calculator[] = "return_calculator";
static const char __pyx_k_s_await_not_found[] = "%s await not found";
static const char __pyx_k_sync_async_magics[] = "_sync_async_magics";
static const char __pyx_k_PropertyMock___get[] = "PropertyMock.__get__";
static const char __pyx_k_PropertyMock___set[] = "PropertyMock.__set__";
static const char __pyx_k_Sentinel___getattr[] = "_Sentinel.__getattr__";
static const char __pyx_k_assert_called_once[] = "assert_called_once";
static const char __pyx_k_assert_called_with[] = "assert_called_with";
static const char __pyx_k_assert_not_awaited[] = "assert_not_awaited";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_get_call_arguments[] = "_get_call_arguments";
static const char __pyx_k_get_eq_locals___eq[] = "_get_eq.<locals>.__eq__";
static const char __pyx_k_get_ne_locals___ne[] = "_get_ne.<locals>.__ne__";
static const char __pyx_k_patch_dict___enter[] = "_patch_dict.__enter__";
static const char __pyx_k_patch_get_original[] = "_patch.get_original";
static const char __pyx_k_set_return_value_2[] = "__set_return_value";
static const char __pyx_k_unsupported_magics[] = "_unsupported_magics";
static const char __pyx_k_CallList___contains[] = "_CallList.__contains__";
static const char __pyx_k_Call___getattribute[] = "_Call.__getattribute__";
static const char __pyx_k_additional_patchers[] = "additional_patchers";
static const char __pyx_k_assert_awaited_once[] = "assert_awaited_once";
static const char __pyx_k_assert_awaited_with[] = "assert_awaited_with";
static const char __pyx_k_async_method_magics[] = "_async_method_magics";
static const char __pyx_k_delegating_property[] = "_delegating_property";
static const char __pyx_k_increment_mock_call[] = "_increment_mock_call";
static const char __pyx_k_iscoroutinefunction[] = "iscoroutinefunction";
static const char __pyx_k_mock_call_args_list[] = "_mock_call_args_list";
static const char __pyx_k_side_effect_methods[] = "_side_effect_methods";
static const char __pyx_k_AsyncIterator___init[] = "_AsyncIterator.__init__";
static const char __pyx_k_CallableMixin___call[] = "CallableMixin.__call__";
static const char __pyx_k_CallableMixin___init[] = "CallableMixin.__init__";
static const char __pyx_k_NonCallableMagicMock[] = "NonCallableMagicMock";
static const char __pyx_k_check_and_set_parent[] = "_check_and_set_parent";
static const char __pyx_k_get_signature_object[] = "_get_signature_object";
static const char __pyx_k_mock_await_args_list[] = "_mock_await_args_list";
static const char __pyx_k_patch_decorate_class[] = "_patch.decorate_class";
static const char __pyx_k_readline_side_effect[] = "_readline_side_effect";
static const char __pyx_k_to_have_been_awaited[] = " to have been awaited.";
static const char __pyx_k_AsyncIterator___aiter[] = "_AsyncIterator.__aiter__";
static const char __pyx_k_AsyncIterator___anext[] = "_AsyncIterator.__anext__";
static const char __pyx_k_AsyncMockMixin___init[] = "AsyncMockMixin.__init__";
static const char __pyx_k_CO_ITERABLE_COROUTINE[] = "CO_ITERABLE_COROUTINE";
static const char __pyx_k_NonCallableMock___dir[] = "NonCallableMock.__dir__";
static const char __pyx_k_NonCallableMock___new[] = "NonCallableMock.__new__";
static const char __pyx_k_SentinelObject___init[] = "_SentinelObject.__init__";
static const char __pyx_k_SentinelObject___repr[] = "_SentinelObject.__repr__";
static const char __pyx_k_format_call_signature[] = "_format_call_signature";
static const char __pyx_k_readlines_side_effect[] = "_readlines_side_effect";
static const char __pyx_k_AsyncMagicMixin___init[] = "AsyncMagicMixin.__init__";
static const char __pyx_k_MagicProxy_create_mock[] = "MagicProxy.create_mock";
static const char __pyx_k_NonCallableMock___init[] = "NonCallableMock.__init__";
static const char __pyx_k_NonCallableMock___repr[] = "NonCallableMock.__repr__";
static const char __pyx_k_calculate_return_value[] = "_calculate_return_value";
static const char __pyx_k_get_iter_locals___iter[] = "_get_iter.<locals>.__iter__";
static const char __pyx_k_in_its_call_list_found[] = " in its call list, found ";
static const char __pyx_k_patch_dict__patch_dict[] = "_patch_dict._patch_dict";
static const char __pyx_k_MagicMock_mock_add_spec[] = "MagicMock.mock_add_spec";
static const char __pyx_k_NonCallableMock___class[] = "NonCallableMock.__class__";
static const char __pyx_k_SentinelObject___reduce[] = "_SentinelObject.__reduce__";
static const char __pyx_k_assert_called_once_with[] = "assert_called_once_with";
static const char __pyx_k_decorate_async_callable[] = "decorate_async_callable";
static const char __pyx_k_does_not_contain_all_of[] = " does not contain all of ";
static const char __pyx_k_patch_decorate_callable[] = "_patch.decorate_callable";
static const char __pyx_k_patch_decoration_helper[] = "_patch.decoration_helper";
static const char __pyx_k_Call__get_call_arguments[] = "_Call._get_call_arguments";
static const char __pyx_k_CallableMixin__mock_call[] = "CallableMixin._mock_call";
static const char __pyx_k_assert_awaited_once_with[] = "assert_awaited_once_with";
static const char __pyx_k_get_method_locals_method[] = "_get_method.<locals>.method";
static const char __pyx_k_get_target_locals_lambda[] = "_get_target.<locals>.<lambda>";
static const char __pyx_k_patch_dict__unpatch_dict[] = "_patch_dict._unpatch_dict";
static const char __pyx_k_to_be_called_once_Called[] = "' to be called once. Called ";
static const char __pyx_k_AsyncMockMixin_reset_mock[] = "AsyncMockMixin.reset_mock";
static const char __pyx_k_NonCallableMock___delattr[] = "NonCallableMock.__delattr__";
static const char __pyx_k_NonCallableMock___getattr[] = "NonCallableMock.__getattr__";
static const char __pyx_k_NonCallableMock___setattr[] = "NonCallableMock.__setattr__";
static const char __pyx_k_patch_dict_decorate_class[] = "_patch_dict.decorate_class";
static const char __pyx_k_NonCallableMock_reset_mock[] = "NonCallableMock.reset_mock";
static const char __pyx_k_format_mock_call_signature[] = "_format_mock_call_signature";
static const char __pyx_k_patch_object_locals_lambda[] = "_patch_object.<locals>.<lambda>";
static const char __pyx_k_MagicMixin__mock_set_magics[] = "MagicMixin._mock_set_magics";
static const char __pyx_k_NonCallableMock__calls_repr[] = "NonCallableMock._calls_repr";
static const char __pyx_k_NonCallableMock_attach_mock[] = "NonCallableMock.attach_mock";
static const char __pyx_k_does_not_have_the_attribute[] = " does not have the attribute ";
static const char __pyx_k_format_mock_failure_message[] = "_format_mock_failure_message";
static const char __pyx_k_mock_open_locals_reset_data[] = "mock_open.<locals>.reset_data";
static const char __pyx_k_not_all_found_in_await_list[] = " not all found in await list";
static const char __pyx_k_PropertyMock__get_child_mock[] = "PropertyMock._get_child_mock";
static const char __pyx_k_get_call_signature_from_name[] = "_get_call_signature_from_name";
static const char __pyx_k_patch_multiple_locals_lambda[] = "_patch_multiple.<locals>.<lambda>";
static const char __pyx_k_setup_func_locals_reset_mock[] = "_setup_func.<locals>.reset_mock";
static const char __pyx_k_AsyncMockMixin_assert_awaited[] = "AsyncMockMixin.assert_awaited";
static const char __pyx_k_CallableMixin__mock_check_sig[] = "CallableMixin._mock_check_sig";
static const char __pyx_k_NonCallableMock__call_matcher[] = "NonCallableMock._call_matcher";
static const char __pyx_k_NonCallableMock_assert_called[] = "NonCallableMock.assert_called";
static const char __pyx_k_NonCallableMock_mock_add_spec[] = "NonCallableMock.mock_add_spec";
static const char __pyx_k_get_async_iter_locals___aiter[] = "_get_async_iter.<locals>.__aiter__";
static const char __pyx_k_patch_decorate_async_callable[] = "_patch.decorate_async_callable";
static const char __pyx_k_set_signature_locals_checksig[] = "_set_signature.<locals>.checksig";
static const char __pyx_k_A_non_callable_version_of_Mock[] = "A non-callable version of `Mock`";
static const char __pyx_k_A_unique_named_sentinel_object[] = "A unique, named, sentinel object.";
static const char __pyx_k_Expected_s_to_have_been_called[] = "Expected '%s' to have been called.";
static const char __pyx_k_Mock_object_has_no_attribute_r[] = "Mock object has no attribute %r";
static const char __pyx_k_Mock_object_has_no_attribute_s[] = "Mock object has no attribute '%s'";
static const char __pyx_k_NonCallableMock__mock_add_spec[] = "NonCallableMock._mock_add_spec";
static const char __pyx_k_NonCallableMock_configure_mock[] = "NonCallableMock.configure_mock";
static const char __pyx_k_patch_decorate_callable_locals[] = "_patch.decorate_callable.<locals>.patched";
static const char __pyx_k_to_not_have_been_called_Called[] = "' to not have been called. Called ";
static const char __pyx_k_A_mock_intended_to_be_used_as_a[] = "\n    A mock intended to be used as a property, or other descriptor, on a class.\n    `PropertyMock` provides `__get__` and `__set__` methods so you can specify\n    a return value when it is fetched.\n\n    Fetching a `PropertyMock` instance from an object calls the mock, with\n    no args. Setting it calls the mock with the value being set.\n    ";
static const char __pyx_k_A_tuple_for_holding_the_results[] = "\n    A tuple for holding the results of a call to a mock, either in the form\n    `(args, kwargs)` or `(name, args, kwargs)`.\n\n    If args or kwargs are empty then a call tuple will compare equal to\n    a tuple without those values. This makes comparisons less verbose::\n\n        _Call(('name', (), {})) == ('name',)\n        _Call(('name', (1,), {})) == ('name', (1,))\n        _Call(((), {'a': 'b'})) == ({'a': 'b'},)\n\n    The `_Call` object provides a useful shortcut for comparing with call::\n\n        _Call(((1, 2), {'a': 3})) == call(1, 2, a=3)\n        _Call(('foo', (1, 2), {'a': 3})) == call.foo(1, 2, a=3)\n\n    If the _Call has no name then it will match any name.\n    ";
static const char __pyx_k_A_version_of_MagicMock_that_isn[] = "A version of `MagicMock` that isn't callable.";
static const char __pyx_k_AsyncMockMixin_assert_any_await[] = "AsyncMockMixin.assert_any_await";
static const char __pyx_k_Can_t_provide_explicit_spec_set[] = "Can't provide explicit spec_set *and* spec or autospec";
static const char __pyx_k_Can_t_specify_spec_and_autospec[] = "Can't specify spec and autospec";
static const char __pyx_k_Can_t_use_spec_with_create_True[] = "Can't use 'spec' with create=True";
static const char __pyx_k_Cannot_use_new_and_new_callable[] = "Cannot use 'new' and 'new_callable' together";
static const char __pyx_k_Create_a_new_Mock_object_Mock_t[] = "\n    Create a new `Mock` object. `Mock` takes several optional arguments\n    that specify the behaviour of the Mock object:\n\n    * `spec`: This can be either a list of strings or an existing object (a\n      class or instance) that acts as the specification for the mock object. If\n      you pass in an object then a list of strings is formed by calling dir on\n      the object (excluding unsupported magic attributes and methods). Accessing\n      any attribute not in this list will raise an `AttributeError`.\n\n      If `spec` is an object (rather than a list of strings) then\n      `mock.__class__` returns the class of the spec object. This allows mocks\n      to pass `isinstance` tests.\n\n    * `spec_set`: A stricter variant of `spec`. If used, attempting to *set*\n      or get an attribute on the mock that isn't on the object passed as\n      `spec_set` will raise an `AttributeError`.\n\n    * `side_effect`: A function to be called whenever the Mock is called. See\n      the `side_effect` attribute. Useful for raising exceptions or\n      dynamically changing return values. The function is called with the same\n      arguments as the mock, and unless it returns `DEFAULT`, the return\n      value of this function is used as the return value.\n\n      If `side_effect` is an iterable then each call to the mock will return\n      the next value from the iterable. If any of the members of the iterable\n      are exceptions they will be raised instead of returned.\n\n    * `return_value`: The value returned when the mock is called. By default\n      this is a new Mock (created on first access). See the\n      `return_value` attribute.\n\n    * `wraps`: Item for the mock object to wrap. If `wraps` is not None then\n      calling the Mock will pass the call through to the wrapped object\n      (returning the real result). Attribute access on the mock will return a\n      Mock object that wraps the corresponding attribute of the wrapped object\n      (so attempting t""o access an attribute that doesn't exist will raise an\n      `AttributeError`).\n\n      If the mock has an explicit `return_value` set then calls are not passed\n      to the wrapped object and the `return_value` is returned instead.\n\n    * `name`: If the mock has a name then it will be used in the repr of the\n      mock. This can be useful for debugging. The name is propagated to child\n      mocks.\n\n    Mocks can also be called with arbitrary keyword arguments. These will be\n    used to set attributes on the mock after it is created.\n    ";
static const char __pyx_k_Enhance_class_Mock_with_feature[] = "\n    Enhance :class:`Mock` with features allowing to mock\n    an async function.\n\n    The :class:`AsyncMock` object will behave so the object is\n    recognized as an async function, and the result of a call is an awaitable:\n\n    >>> mock = AsyncMock()\n    >>> asyncio.iscoroutinefunction(mock)\n    True\n    >>> inspect.isawaitable(mock())\n    True\n\n\n    The result of ``mock()`` is an async function which will have the outcome\n    of ``side_effect`` or ``return_value``:\n\n    - if ``side_effect`` is a function, the async function will return the\n      result of that function,\n    - if ``side_effect`` is an exception, the async function will raise the\n      exception,\n    - if ``side_effect`` is an iterable, the async function will return the\n      next value of the iterable, however, if the sequence of result is\n      exhausted, ``StopIteration`` is raised immediately,\n    - if ``side_effect`` is not defined, the async function will return the\n      value defined by ``return_value``, hence, by default, the async function\n      returns a new :class:`AsyncMock` object.\n\n    If the outcome of ``side_effect`` or ``return_value`` is an async function,\n    the mock async function obtained when the mock object is called will be this\n    async function itself (and not an async function returning an async\n    function).\n\n    The test author can also specify a wrapped object with ``wraps``. In this\n    case, the :class:`Mock` object behavior is the same as with an\n    :class:`.Mock` object: the wrapped object may have methods\n    defined as async function functions.\n\n    Based on Martin Richard's asynctest project.\n    ";
static const char __pyx_k_Error_processing_expected_calls[] = "Error processing expected calls.\nErrors: {}";
static const char __pyx_k_MagicMock_is_a_subclass_of_Mock[] = "\n    MagicMock is a subclass of Mock with default implementations\n    of most of the magic methods. You can use MagicMock without having to\n    configure the magic methods yourself.\n\n    If you use the `spec` or `spec_set` arguments then *only* magic\n    methods that exist in the spec will be created.\n\n    Attributes and the return value of a `MagicMock` will also be `MagicMocks`.\n    ";
static const char __pyx_k_NonCallableMock__get_child_mock[] = "NonCallableMock._get_child_mock";
static const char __pyx_k_NonCallableMock__get_return_val[] = "_NonCallableMock__get_return_value";
static const char __pyx_k_NonCallableMock__get_side_effec[] = "_NonCallableMock__get_side_effect";
static const char __pyx_k_NonCallableMock__return_value_d[] = "_NonCallableMock__return_value_doc";
static const char __pyx_k_NonCallableMock__set_return_val[] = "_NonCallableMock__set_return_value";
static const char __pyx_k_NonCallableMock__set_side_effec[] = "_NonCallableMock__set_side_effect";
static const char __pyx_k_NonCallableMock_assert_any_call[] = "NonCallableMock.assert_any_call";
static const char __pyx_k_Patch_a_dictionary_or_dictionar[] = "\n    Patch a dictionary, or dictionary like object, and restore the dictionary\n    to its original state after the test.\n\n    `in_dict` can be a dictionary or a mapping like container. If it is a\n    mapping then it must at least support getting, setting and deleting items\n    plus iterating over keys.\n\n    `in_dict` can also be a string specifying the name of the dictionary, which\n    will then be fetched by importing it.\n\n    `values` can be a dictionary of values to set in the dictionary. `values`\n    can also be an iterable of `(key, value)` pairs.\n\n    If `clear` is True then the dictionary will be cleared before the new\n    values are set.\n\n    `patch.dict` can also be called with arbitrary keyword arguments to set\n    values in the dictionary::\n\n        with patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()):\n            ...\n\n    `patch.dict` can be used as a context manager, decorator or class\n    decorator. When used as a class decorator `patch.dict` honours\n    `patch.TEST_PREFIX` for choosing which methods to wrap.\n    ";
static const char __pyx_k_Wraps_an_iterator_in_an_asynchr[] = "\n    Wraps an iterator in an asynchronous iterator.\n    ";
static const char __pyx_k_add_sub_mul_matmul_div_floordiv[] = "add sub mul matmul div floordiv mod lshift rshift and xor or pow truediv";
static const char __pyx_k_check_signature_locals_checksig[] = "_check_signature.<locals>.checksig";
static const char __pyx_k_delegating_property_locals__get[] = "_delegating_property.<locals>._get";
static const char __pyx_k_delegating_property_locals__set[] = "_delegating_property.<locals>._set";
static const char __pyx_k_expected_s_not_found_Expected_s[] = "expected %s not found.\nExpected: %s\nActual: %s";
static const char __pyx_k_mock_open_locals__readline_side[] = "mock_open.<locals>._readline_side_effect";
static const char __pyx_k_must_be_the_actual_object_to_be[] = " must be the actual object to be patched, not a str";
static const char __pyx_k_patch_decorate_async_callable_l[] = "_patch.decorate_async_callable.<locals>.patched";
static const char __pyx_k_patch_dict___call___locals__inn[] = "_patch_dict.__call__.<locals>._inner";
static const char __pyx_k_setup_async_mock_locals_wrapper[] = "_setup_async_mock.<locals>.wrapper";
static const char __pyx_k_setup_func_locals_assert_any_ca[] = "_setup_func.<locals>.assert_any_call";
static const char __pyx_k_setup_func_locals_assert_called[] = "_setup_func.<locals>.assert_called_with";
static const char __pyx_k_setup_func_locals_assert_has_ca[] = "_setup_func.<locals>.assert_has_calls";
static const char __pyx_k_setup_func_locals_assert_not_ca[] = "_setup_func.<locals>.assert_not_called";
static const char __pyx_k_to_have_been_awaited_once_Await[] = " to have been awaited once. Awaited ";
static const char __pyx_k_to_have_been_called_once_Called[] = "' to have been called once. Called ";
static const char __pyx_k_to_not_have_been_awaited_Awaite[] = " to not have been awaited. Awaited ";
static const char __pyx_k_A_helper_object_that_compares_eq[] = "A helper object that compares equal to everything.";
static const char __pyx_k_Access_attributes_to_return_a_na[] = "Access attributes to return a named object, usable as a sentinel.";
static const char __pyx_k_AsyncMockMixin__execute_mock_cal[] = "AsyncMockMixin._execute_mock_call";
static const char __pyx_k_AsyncMockMixin_assert_awaited_on[] = "AsyncMockMixin.assert_awaited_once";
static const char __pyx_k_AsyncMockMixin_assert_awaited_wi[] = "AsyncMockMixin.assert_awaited_with.<locals>._error_message";
static const char __pyx_k_AsyncMockMixin_assert_has_awaits[] = "AsyncMockMixin.assert_has_awaits.<locals>.genexpr";
static const char __pyx_k_AsyncMockMixin_assert_not_awaite[] = "AsyncMockMixin.assert_not_awaited";
static const char __pyx_k_Attempting_to_set_unsupported_ma[] = "Attempting to set unsupported magic method %r.";
static const char __pyx_k_Attributes_cannot_start_with_ass[] = "Attributes cannot start with 'assert' or 'assret'";
static const char __pyx_k_CallableMixin__execute_mock_call[] = "CallableMixin._execute_mock_call";
static const char __pyx_k_CallableMixin__increment_mock_ca[] = "CallableMixin._increment_mock_call";
static const char __pyx_k_Can_t_pass_kwargs_to_a_mock_we_a[] = "Can't pass kwargs to a mock we aren't creating";
static const char __pyx_k_Can_t_use_autospec_with_create_T[] = "Can't use 'autospec' with create=True";
static const char __pyx_k_Cannot_use_autospec_and_new_call[] = "Cannot use 'autospec' and 'new_callable' together";
static const char __pyx_k_Error_processing_expected_awaits[] = "Error processing expected awaits.\nErrors: {}";
static const char __pyx_k_Instance_can_not_be_True_when_cr[] = "Instance can not be True when create_autospec is mocking an async function";
static const char __pyx_k_Must_supply_at_least_one_keyword[] = "Must supply at least one keyword argument with patch.multiple";
static const char __pyx_k_Need_a_valid_target_to_patch_You[] = "Need a valid target to patch. You supplied: ";
static const char __pyx_k_NonCallableMagicMock_mock_add_sp[] = "NonCallableMagicMock.mock_add_spec";
static const char __pyx_k_NonCallableMock___get_return_val[] = "NonCallableMock.__get_return_value";
static const char __pyx_k_NonCallableMock___get_side_effec[] = "NonCallableMock.__get_side_effect";
static const char __pyx_k_NonCallableMock___set_return_val[] = "NonCallableMock.__set_return_value";
static const char __pyx_k_NonCallableMock___set_side_effec[] = "NonCallableMock.__set_side_effect";
static const char __pyx_k_NonCallableMock___setattr___loca[] = "NonCallableMock.__setattr__.<locals>.<lambda>";
static const char __pyx_k_NonCallableMock__extract_mock_na[] = "NonCallableMock._extract_mock_name";
static const char __pyx_k_NonCallableMock__format_mock_cal[] = "NonCallableMock._format_mock_call_signature";
static const char __pyx_k_NonCallableMock__format_mock_fai[] = "NonCallableMock._format_mock_failure_message";
static const char __pyx_k_NonCallableMock__get_call_signat[] = "NonCallableMock._get_call_signature_from_name";
static const char __pyx_k_NonCallableMock_assert_called_on[] = "NonCallableMock.assert_called_once";
static const char __pyx_k_NonCallableMock_assert_called_wi[] = "NonCallableMock.assert_called_with.<locals>._error_message";
static const char __pyx_k_NonCallableMock_assert_has_calls[] = "NonCallableMock.assert_has_calls.<locals>.genexpr";
static const char __pyx_k_NonCallableMock_assert_not_calle[] = "NonCallableMock.assert_not_called";
static const char __pyx_k_NonCallableMock_configure_mock_l[] = "NonCallableMock.configure_mock.<locals>.<lambda>";
static const char __pyx_k_Set_attributes_on_the_mock_throu[] = "Set attributes on the mock through keyword arguments.\n\n        Attributes plus return values and side effects can be set on child\n        mocks using standard dot notation and unpacking a dictionary in the\n        method call:\n\n        >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}\n        >>> mock.configure_mock(**attrs)";
static const char __pyx_k_The_value_to_be_returned_when_th[] = "The value to be returned when the mock is called.";
static const char __pyx_k_autospec_creates_the_mock_for_yo[] = "autospec creates the mock for you. Can't specify autospec and new.";
static const char __pyx_k_def_s_args_kwargs__checksig__arg[] = "def %s(*args, **kwargs):\n    _checksig_(*args, **kwargs)\n    return mock(*args, **kwargs)";
static const char __pyx_k_expected_call_not_found_Expected[] = "expected call not found.\nExpected: ";
static const char __pyx_k_lt_le_gt_ge_eq_ne_getitem_setite[] = "lt le gt ge eq ne getitem setitem delitem len contains iter hash str sizeof enter exit divmod rdivmod neg pos abs invert complex int float index round trunc floor ceil bool next fspath aiter ";
static const char __pyx_k_mock_open_locals__iter_side_effe[] = "mock_open.<locals>._iter_side_effect";
static const char __pyx_k_mock_open_locals__next_side_effe[] = "mock_open.<locals>._next_side_effect";
static const char __pyx_k_mock_open_locals__read_side_effe[] = "mock_open.<locals>._read_side_effect";
static const char __pyx_k_mock_open_locals__readlines_side[] = "mock_open.<locals>._readlines_side_effect";
static const char __pyx_k_setup_func_locals_assert_called_2[] = "_setup_func.<locals>.assert_called";
static const char __pyx_k_setup_func_locals_assert_called_3[] = "_setup_func.<locals>.assert_called_once";
static const char __pyx_k_setup_func_locals_assert_called_4[] = "_setup_func.<locals>.assert_called_once_with";
static const char __pyx_k_AsyncMockMixin_assert_awaited_on_2[] = "AsyncMockMixin.assert_awaited_once_with";
static const char __pyx_k_AsyncMockMixin_assert_awaited_wi_2[] = "AsyncMockMixin.assert_awaited_with";
static const char __pyx_k_AsyncMockMixin_assert_has_awaits_2[] = "AsyncMockMixin.assert_has_awaits";
static const char __pyx_k_NonCallableMock_assert_called_on_2[] = "NonCallableMock.assert_called_once_with";
static const char __pyx_k_NonCallableMock_assert_called_wi_2[] = "NonCallableMock.assert_called_with";
static const char __pyx_k_NonCallableMock_assert_has_calls_2[] = "NonCallableMock.assert_has_calls";
static const char __pyx_k_NonCallableMock_configure_mock_l_2[] = "NonCallableMock.configure_mock (line 614)";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_kp_u_1_0;
static PyObject *__pyx_kp_u_ANY;
static PyObject *__pyx_n_s_ANY_2;
static PyObject *__pyx_n_u_ANY_2;
static PyObject *__pyx_n_s_ANY_3;
static PyObject *__pyx_n_s_ANY___eq;
static PyObject *__pyx_n_s_ANY___ne;
static PyObject *__pyx_n_s_ANY___repr;
static PyObject *__pyx_kp_s_A_helper_object_that_compares_eq;
static PyObject *__pyx_kp_s_A_mock_intended_to_be_used_as_a;
static PyObject *__pyx_kp_s_A_non_callable_version_of_Mock;
static PyObject *__pyx_kp_s_A_tuple_for_holding_the_results;
static PyObject *__pyx_kp_s_A_unique_named_sentinel_object;
static PyObject *__pyx_kp_s_A_version_of_MagicMock_that_isn;
static PyObject *__pyx_kp_s_Access_attributes_to_return_a_na;
static PyObject *__pyx_kp_u_Actual;
static PyObject *__pyx_n_u_Actual_2;
static PyObject *__pyx_n_s_AssertionError;
static PyObject *__pyx_n_s_AsyncIterator;
static PyObject *__pyx_n_s_AsyncIterator___aiter;
static PyObject *__pyx_n_s_AsyncIterator___anext;
static PyObject *__pyx_n_s_AsyncIterator___init;
static PyObject *__pyx_n_s_AsyncMagicMixin;
static PyObject *__pyx_n_s_AsyncMagicMixin___init;
static PyObject *__pyx_n_s_AsyncMock;
static PyObject *__pyx_n_u_AsyncMock;
static PyObject *__pyx_n_s_AsyncMockMixin;
static PyObject *__pyx_n_s_AsyncMockMixin___init;
static PyObject *__pyx_n_s_AsyncMockMixin__execute_mock_cal;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_any_await;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_awaited;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_awaited_on;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_awaited_on_2;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_awaited_wi;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_awaited_wi_2;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_has_awaits;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_has_awaits_2;
static PyObject *__pyx_n_s_AsyncMockMixin_assert_not_awaite;
static PyObject *__pyx_n_s_AsyncMockMixin_reset_mock;
static PyObject *__pyx_kp_u_Attempting_to_set_unsupported_ma;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_kp_u_Attributes_cannot_start_with_ass;
static PyObject *__pyx_kp_u_Awaits_not_found;
static PyObject *__pyx_n_s_Base;
static PyObject *__pyx_n_s_BaseException;
static PyObject *__pyx_n_s_Base___init;
static PyObject *__pyx_n_s_BytesIO;
static PyObject *__pyx_n_s_CO_COROUTINE;
static PyObject *__pyx_n_s_CO_ITERABLE_COROUTINE;
static PyObject *__pyx_n_s_Call;
static PyObject *__pyx_n_s_CallList;
static PyObject *__pyx_n_s_CallList___contains;
static PyObject *__pyx_n_s_CallList___repr;
static PyObject *__pyx_n_s_Call___call;
static PyObject *__pyx_n_s_Call___eq;
static PyObject *__pyx_n_s_Call___getattr;
static PyObject *__pyx_n_s_Call___getattribute;
static PyObject *__pyx_n_s_Call___init;
static PyObject *__pyx_n_s_Call___new;
static PyObject *__pyx_n_s_Call___repr;
static PyObject *__pyx_n_s_Call__get_call_arguments;
static PyObject *__pyx_n_s_Call_args;
static PyObject *__pyx_n_s_Call_call_list;
static PyObject *__pyx_n_s_Call_count;
static PyObject *__pyx_n_s_Call_index;
static PyObject *__pyx_n_s_Call_kwargs;
static PyObject *__pyx_n_s_CallableMixin;
static PyObject *__pyx_n_s_CallableMixin___call;
static PyObject *__pyx_n_s_CallableMixin___init;
static PyObject *__pyx_n_s_CallableMixin__execute_mock_call;
static PyObject *__pyx_n_s_CallableMixin__increment_mock_ca;
static PyObject *__pyx_n_s_CallableMixin__mock_call;
static PyObject *__pyx_n_s_CallableMixin__mock_check_sig;
static PyObject *__pyx_n_u_Calls;
static PyObject *__pyx_kp_u_Calls_not_found;
static PyObject *__pyx_kp_u_Can_t_pass_kwargs_to_a_mock_we_a;
static PyObject *__pyx_kp_u_Can_t_provide_explicit_spec_set;
static PyObject *__pyx_kp_u_Can_t_specify_spec_and_autospec;
static PyObject *__pyx_kp_u_Can_t_use_autospec_with_create_T;
static PyObject *__pyx_kp_u_Can_t_use_spec_with_create_True;
static PyObject *__pyx_kp_u_Cannot_set;
static PyObject *__pyx_kp_u_Cannot_use_autospec_and_new_call;
static PyObject *__pyx_kp_u_Cannot_use_new_and_new_callable;
static PyObject *__pyx_n_s_CodeType;
static PyObject *__pyx_kp_s_Create_a_new_Mock_object_Mock_t;
static PyObject *__pyx_n_s_DEFAULT;
static PyObject *__pyx_n_u_DEFAULT;
static PyObject *__pyx_n_s_DELETED;
static PyObject *__pyx_kp_s_Enhance_class_Mock_with_feature;
static PyObject *__pyx_kp_u_Error_processing_expected_awaits;
static PyObject *__pyx_kp_u_Error_processing_expected_calls;
static PyObject *__pyx_kp_u_Expected;
static PyObject *__pyx_kp_u_Expected_2;
static PyObject *__pyx_kp_u_Expected_3;
static PyObject *__pyx_kp_u_Expected_await;
static PyObject *__pyx_kp_u_Expected_s_to_have_been_called;
static PyObject *__pyx_n_s_FILTER_DIR;
static PyObject *__pyx_n_u_FILTER_DIR;
static PyObject *__pyx_n_s_FunctionTypes;
static PyObject *__pyx_kp_u_Instance_can_not_be_True_when_cr;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_Klass;
static PyObject *__pyx_n_s_MISSING;
static PyObject *__pyx_n_s_MagicMixin;
static PyObject *__pyx_n_s_MagicMixin___init;
static PyObject *__pyx_n_s_MagicMixin__mock_set_magics;
static PyObject *__pyx_n_s_MagicMock;
static PyObject *__pyx_n_u_MagicMock;
static PyObject *__pyx_kp_s_MagicMock_is_a_subclass_of_Mock;
static PyObject *__pyx_n_s_MagicMock_mock_add_spec;
static PyObject *__pyx_n_s_MagicProxy;
static PyObject *__pyx_n_s_MagicProxy___get;
static PyObject *__pyx_n_s_MagicProxy___init;
static PyObject *__pyx_n_s_MagicProxy_create_mock;
static PyObject *__pyx_n_s_MethodType;
static PyObject *__pyx_n_s_Mock;
static PyObject *__pyx_n_u_Mock;
static PyObject *__pyx_n_s_MockIter;
static PyObject *__pyx_n_s_MockIter___init;
static PyObject *__pyx_n_s_MockIter___next;
static PyObject *__pyx_kp_u_Mock_object_has_no_attribute_r;
static PyObject *__pyx_kp_u_Mock_object_has_no_attribute_s;
static PyObject *__pyx_n_s_ModuleType;
static PyObject *__pyx_kp_u_Must_supply_at_least_one_keyword;
static PyObject *__pyx_kp_u_Need_a_valid_target_to_patch_You;
static PyObject *__pyx_n_s_NonCallableMagicMock;
static PyObject *__pyx_n_u_NonCallableMagicMock;
static PyObject *__pyx_n_s_NonCallableMagicMock_mock_add_sp;
static PyObject *__pyx_n_s_NonCallableMock;
static PyObject *__pyx_n_u_NonCallableMock;
static PyObject *__pyx_n_s_NonCallableMock___class;
static PyObject *__pyx_n_s_NonCallableMock___delattr;
static PyObject *__pyx_n_s_NonCallableMock___dir;
static PyObject *__pyx_n_s_NonCallableMock___get_return_val;
static PyObject *__pyx_n_s_NonCallableMock___get_side_effec;
static PyObject *__pyx_n_s_NonCallableMock___getattr;
static PyObject *__pyx_n_s_NonCallableMock___init;
static PyObject *__pyx_n_s_NonCallableMock___new;
static PyObject *__pyx_n_s_NonCallableMock___repr;
static PyObject *__pyx_n_s_NonCallableMock___set_return_val;
static PyObject *__pyx_n_s_NonCallableMock___set_side_effec;
static PyObject *__pyx_n_s_NonCallableMock___setattr;
static PyObject *__pyx_n_s_NonCallableMock___setattr___loca;
static PyObject *__pyx_n_s_NonCallableMock__call_matcher;
static PyObject *__pyx_n_s_NonCallableMock__calls_repr;
static PyObject *__pyx_n_s_NonCallableMock__extract_mock_na;
static PyObject *__pyx_n_s_NonCallableMock__format_mock_cal;
static PyObject *__pyx_n_s_NonCallableMock__format_mock_fai;
static PyObject *__pyx_n_s_NonCallableMock__get_call_signat;
static PyObject *__pyx_n_s_NonCallableMock__get_child_mock;
static PyObject *__pyx_n_s_NonCallableMock__get_return_val;
static PyObject *__pyx_n_s_NonCallableMock__get_side_effec;
static PyObject *__pyx_n_s_NonCallableMock__mock_add_spec;
static PyObject *__pyx_n_s_NonCallableMock__return_value_d;
static PyObject *__pyx_n_s_NonCallableMock__set_return_val;
static PyObject *__pyx_n_s_NonCallableMock__set_side_effec;
static PyObject *__pyx_n_s_NonCallableMock_assert_any_call;
static PyObject *__pyx_n_s_NonCallableMock_assert_called;
static PyObject *__pyx_n_s_NonCallableMock_assert_called_on;
static PyObject *__pyx_n_s_NonCallableMock_assert_called_on_2;
static PyObject *__pyx_n_s_NonCallableMock_assert_called_wi;
static PyObject *__pyx_n_s_NonCallableMock_assert_called_wi_2;
static PyObject *__pyx_n_s_NonCallableMock_assert_has_calls;
static PyObject *__pyx_n_s_NonCallableMock_assert_has_calls_2;
static PyObject *__pyx_n_s_NonCallableMock_assert_not_calle;
static PyObject *__pyx_n_s_NonCallableMock_attach_mock;
static PyObject *__pyx_n_s_NonCallableMock_configure_mock;
static PyObject *__pyx_n_s_NonCallableMock_configure_mock_l;
static PyObject *__pyx_kp_u_NonCallableMock_configure_mock_l_2;
static PyObject *__pyx_n_s_NonCallableMock_mock_add_spec;
static PyObject *__pyx_n_s_NonCallableMock_reset_mock;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_kp_u_Not_awaited;
static PyObject *__pyx_kp_s_Patch_a_dictionary_or_dictionar;
static PyObject *__pyx_n_s_PropertyMock;
static PyObject *__pyx_n_u_PropertyMock;
static PyObject *__pyx_n_s_PropertyMock___get;
static PyObject *__pyx_n_s_PropertyMock___set;
static PyObject *__pyx_n_s_PropertyMock__get_child_mock;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_Sentinel;
static PyObject *__pyx_n_s_SentinelObject;
static PyObject *__pyx_n_s_SentinelObject___init;
static PyObject *__pyx_n_s_SentinelObject___reduce;
static PyObject *__pyx_n_s_SentinelObject___repr;
static PyObject *__pyx_n_s_Sentinel___getattr;
static PyObject *__pyx_n_s_Sentinel___init;
static PyObject *__pyx_n_s_Sentinel___reduce;
static PyObject *__pyx_kp_u_Set_attributes_on_the_mock_throu;
static PyObject *__pyx_n_s_SpecState;
static PyObject *__pyx_n_s_SpecState___init;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_n_s_StringIO;
static PyObject *__pyx_n_s_TEST_PREFIX;
static PyObject *__pyx_n_s_TextIOWrapper;
static PyObject *__pyx_kp_u_The_value_to_be_returned_when_th;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s_Wraps_an_iterator_in_an_asynchr;
static PyObject *__pyx_kp_u__294;
static PyObject *__pyx_kp_u__31;
static PyObject *__pyx_kp_u__32;
static PyObject *__pyx_kp_u__33;
static PyObject *__pyx_kp_u__36;
static PyObject *__pyx_kp_u__37;
static PyObject *__pyx_kp_u__38;
static PyObject *__pyx_n_u__39;
static PyObject *__pyx_kp_u__43;
static PyObject *__pyx_kp_u__44;
static PyObject *__pyx_kp_u__77;
static PyObject *__pyx_kp_u__78;
static PyObject *__pyx_n_s_action;
static PyObject *__pyx_n_s_active_patches;
static PyObject *__pyx_n_s_actual;
static PyObject *__pyx_n_s_actual_string;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_kp_u_add_sub_mul_matmul_div_floordiv;
static PyObject *__pyx_n_s_additional_patchers;
static PyObject *__pyx_n_u_aenter;
static PyObject *__pyx_n_u_aexit;
static PyObject *__pyx_n_s_aiter;
static PyObject *__pyx_n_u_aiter;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_all_awaits;
static PyObject *__pyx_n_s_all_calls;
static PyObject *__pyx_n_s_all_magics;
static PyObject *__pyx_n_s_all_sync_magics;
static PyObject *__pyx_n_s_allowed_names;
static PyObject *__pyx_n_s_anext;
static PyObject *__pyx_n_u_anext;
static PyObject *__pyx_n_u_annotations;
static PyObject *__pyx_n_s_any_order;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arg;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_args_string;
static PyObject *__pyx_n_s_arguments;
static PyObject *__pyx_n_s_as_instance;
static PyObject *__pyx_n_u_assert;
static PyObject *__pyx_n_s_assert_any_await;
static PyObject *__pyx_n_u_assert_any_await;
static PyObject *__pyx_n_s_assert_any_call;
static PyObject *__pyx_n_s_assert_awaited;
static PyObject *__pyx_n_u_assert_awaited;
static PyObject *__pyx_n_s_assert_awaited_once;
static PyObject *__pyx_n_u_assert_awaited_once;
static PyObject *__pyx_n_s_assert_awaited_once_with;
static PyObject *__pyx_n_u_assert_awaited_once_with;
static PyObject *__pyx_n_s_assert_awaited_with;
static PyObject *__pyx_n_u_assert_awaited_with;
static PyObject *__pyx_n_s_assert_called;
static PyObject *__pyx_n_s_assert_called_once;
static PyObject *__pyx_n_s_assert_called_once_with;
static PyObject *__pyx_n_s_assert_called_with;
static PyObject *__pyx_n_s_assert_has_awaits;
static PyObject *__pyx_n_u_assert_has_awaits;
static PyObject *__pyx_n_s_assert_has_calls;
static PyObject *__pyx_n_s_assert_not_awaited;
static PyObject *__pyx_n_u_assert_not_awaited;
static PyObject *__pyx_n_s_assert_not_called;
static PyObject *__pyx_n_u_assret;
static PyObject *__pyx_n_s_async_magics;
static PyObject *__pyx_n_s_async_method_magics;
static PyObject *__pyx_n_s_asyncio;
static PyObject *__pyx_n_s_asyncio_coroutines;
static PyObject *__pyx_n_s_asyncio_tasks;
static PyObject *__pyx_n_s_attach_mock;
static PyObject *__pyx_n_s_attr;
static PyObject *__pyx_n_s_attr_value;
static PyObject *__pyx_n_s_attribute;
static PyObject *__pyx_n_s_attribute_name;
static PyObject *__pyx_n_s_autospec;
static PyObject *__pyx_kp_u_autospec_creates_the_mock_for_yo;
static PyObject *__pyx_n_s_await;
static PyObject *__pyx_n_u_await_2;
static PyObject *__pyx_n_s_await_args;
static PyObject *__pyx_n_u_await_args;
static PyObject *__pyx_n_s_await_args_list;
static PyObject *__pyx_n_u_await_args_list;
static PyObject *__pyx_n_s_await_count;
static PyObject *__pyx_n_u_await_count;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_u_bases;
static PyObject *__pyx_n_s_bases_2;
static PyObject *__pyx_n_s_bind;
static PyObject *__pyx_n_s_bind_partial;
static PyObject *__pyx_n_u_bool;
static PyObject *__pyx_n_s_bound_args;
static PyObject *__pyx_n_s_builtins;
static PyObject *__pyx_n_s_builtins_2;
static PyObject *__pyx_n_s_builtins_3;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_calculate_return_value;
static PyObject *__pyx_n_s_call;
static PyObject *__pyx_n_u_call;
static PyObject *__pyx_n_s_call_2;
static PyObject *__pyx_n_u_call_2;
static PyObject *__pyx_n_s_call_3;
static PyObject *__pyx_n_s_call_args;
static PyObject *__pyx_n_u_call_args;
static PyObject *__pyx_n_s_call_args_list;
static PyObject *__pyx_n_u_call_args_list;
static PyObject *__pyx_n_s_call_count;
static PyObject *__pyx_n_u_call_count;
static PyObject *__pyx_n_s_call_list;
static PyObject *__pyx_n_s_call_matcher;
static PyObject *__pyx_kp_u_call_s;
static PyObject *__pyx_kp_u_call_s_2;
static PyObject *__pyx_n_s_callable;
static PyObject *__pyx_n_s_called;
static PyObject *__pyx_n_u_called;
static PyObject *__pyx_n_s_calls;
static PyObject *__pyx_n_s_calls_repr;
static PyObject *__pyx_n_s_cause;
static PyObject *__pyx_n_s_check_and_set_parent;
static PyObject *__pyx_n_s_check_signature;
static PyObject *__pyx_n_s_check_signature_locals_checksig;
static PyObject *__pyx_n_s_checksig;
static PyObject *__pyx_n_u_checksig_2;
static PyObject *__pyx_n_s_child;
static PyObject *__pyx_n_s_child_klass;
static PyObject *__pyx_n_s_children;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_u_class;
static PyObject *__pyx_n_s_classmethod;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_clear_dict;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_co_flags;
static PyObject *__pyx_n_u_code;
static PyObject *__pyx_n_s_code_mock;
static PyObject *__pyx_n_s_comp;
static PyObject *__pyx_n_u_complex;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_configure_mock;
static PyObject *__pyx_n_s_contains;
static PyObject *__pyx_n_u_contains;
static PyObject *__pyx_n_s_context;
static PyObject *__pyx_n_s_contextlib;
static PyObject *__pyx_n_s_contextmanager;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_copy_func_details;
static PyObject *__pyx_n_s_coroutines;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_u_count;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_create_autospec;
static PyObject *__pyx_n_u_create_autospec;
static PyObject *__pyx_n_s_create_mock;
static PyObject *__pyx_n_s_cymock;
static PyObject *__pyx_kp_s_cymock_pyx;
static PyObject *__pyx_n_s_decorate_async_callable;
static PyObject *__pyx_n_s_decorate_callable;
static PyObject *__pyx_n_s_decorate_class;
static PyObject *__pyx_n_s_decorated;
static PyObject *__pyx_n_s_decoration_helper;
static PyObject *__pyx_n_s_decorator;
static PyObject *__pyx_kp_u_def_s_args_kwargs__checksig__arg;
static PyObject *__pyx_n_u_defaults;
static PyObject *__pyx_n_u_del;
static PyObject *__pyx_n_s_delattr;
static PyObject *__pyx_n_s_delegated;
static PyObject *__pyx_n_s_delegating_property;
static PyObject *__pyx_n_s_delegating_property_locals__get;
static PyObject *__pyx_n_s_delegating_property_locals__set;
static PyObject *__pyx_n_u_delete;
static PyObject *__pyx_n_s_deleted;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_u_dict;
static PyObject *__pyx_n_s_dict_2;
static PyObject *__pyx_n_s_dir;
static PyObject *__pyx_n_u_dir;
static PyObject *__pyx_n_s_do_method_calls;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_u_doc;
static PyObject *__pyx_kp_u_does_not_contain_all_of;
static PyObject *__pyx_kp_u_does_not_have_the_attribute;
static PyObject *__pyx_n_s_dot;
static PyObject *__pyx_n_s_dot_lookup;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_eat_self;
static PyObject *__pyx_n_s_eat_self_2;
static PyObject *__pyx_n_u_eat_self_2;
static PyObject *__pyx_n_s_effect;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_entered_patchers;
static PyObject *__pyx_n_s_entry;
static PyObject *__pyx_n_s_eq;
static PyObject *__pyx_n_u_eq;
static PyObject *__pyx_n_s_error_message;
static PyObject *__pyx_n_s_error_message_2;
static PyObject *__pyx_n_s_exc_info;
static PyObject *__pyx_n_s_execute_mock_call;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_u_exit;
static PyObject *__pyx_n_s_expected;
static PyObject *__pyx_kp_u_expected_call_not_found_Expected;
static PyObject *__pyx_kp_u_expected_s_not_found_Expected_s;
static PyObject *__pyx_n_s_expected_string;
static PyObject *__pyx_n_s_extra_args;
static PyObject *__pyx_n_s_extract_mock;
static PyObject *__pyx_n_s_extract_mock_name;
static PyObject *__pyx_n_s_extras;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_file_spec;
static PyObject *__pyx_n_s_final;
static PyObject *__pyx_n_s_first;
static PyObject *__pyx_n_s_first_2;
static PyObject *__pyx_n_s_fixed;
static PyObject *__pyx_n_u_float;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_u_format_2;
static PyObject *__pyx_n_s_format_call_signature;
static PyObject *__pyx_n_s_format_mock_call_signature;
static PyObject *__pyx_n_s_format_mock_failure_message;
static PyObject *__pyx_n_s_formatted_args;
static PyObject *__pyx_n_s_from_child_mocks;
static PyObject *__pyx_n_s_from_dict;
static PyObject *__pyx_n_s_from_kall;
static PyObject *__pyx_n_s_from_type;
static PyObject *__pyx_n_u_fspath;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_u_func;
static PyObject *__pyx_n_s_func_2;
static PyObject *__pyx_n_s_funcopy;
static PyObject *__pyx_n_u_funcopy;
static PyObject *__pyx_n_s_functools;
static PyObject *__pyx_n_u_ge;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_2;
static PyObject *__pyx_n_s_get_3;
static PyObject *__pyx_n_u_get_3;
static PyObject *__pyx_n_s_get_async_iter;
static PyObject *__pyx_n_s_get_async_iter_locals___aiter;
static PyObject *__pyx_n_s_get_call_arguments;
static PyObject *__pyx_n_s_get_call_signature_from_name;
static PyObject *__pyx_n_s_get_child_mock;
static PyObject *__pyx_n_s_get_eq;
static PyObject *__pyx_n_s_get_eq_locals___eq;
static PyObject *__pyx_n_s_get_iter;
static PyObject *__pyx_n_s_get_iter_locals___iter;
static PyObject *__pyx_n_s_get_method;
static PyObject *__pyx_n_s_get_method_locals_method;
static PyObject *__pyx_n_s_get_ne;
static PyObject *__pyx_n_s_get_ne_locals___ne;
static PyObject *__pyx_n_s_get_original;
static PyObject *__pyx_n_s_get_return_value;
static PyObject *__pyx_n_s_get_side_effect;
static PyObject *__pyx_n_s_get_signature_object;
static PyObject *__pyx_n_s_get_target;
static PyObject *__pyx_n_s_get_target_locals_lambda;
static PyObject *__pyx_n_s_getattr;
static PyObject *__pyx_n_u_getattr;
static PyObject *__pyx_n_s_getattribute;
static PyObject *__pyx_n_u_getformat;
static PyObject *__pyx_n_u_getinitargs;
static PyObject *__pyx_n_u_getnewargs;
static PyObject *__pyx_n_u_getnewargs_ex;
static PyObject *__pyx_n_u_getstate;
static PyObject *__pyx_n_s_getter;
static PyObject *__pyx_n_u_gt;
static PyObject *__pyx_n_s_handle;
static PyObject *__pyx_n_s_has_local;
static PyObject *__pyx_n_s_hash;
static PyObject *__pyx_n_u_hash;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_kp_u_i_s;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_kp_u_id_2;
static PyObject *__pyx_n_s_ids;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_import_path;
static PyObject *__pyx_n_s_importer;
static PyObject *__pyx_n_s_in_dict;
static PyObject *__pyx_kp_u_in_its_call_list_found;
static PyObject *__pyx_n_s_increment_mock_call;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_u_index;
static PyObject *__pyx_n_u_index_2;
static PyObject *__pyx_n_s_inherit;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_u_init;
static PyObject *__pyx_n_s_inner;
static PyObject *__pyx_n_s_inner_mock;
static PyObject *__pyx_n_s_inplace;
static PyObject *__pyx_n_s_inspect;
static PyObject *__pyx_n_s_instance;
static PyObject *__pyx_n_s_instance_callable;
static PyObject *__pyx_n_u_instancecheck;
static PyObject *__pyx_kp_u_instead;
static PyObject *__pyx_n_u_int;
static PyObject *__pyx_n_s_intersection;
static PyObject *__pyx_n_s_io;
static PyObject *__pyx_n_s_io_2;
static PyObject *__pyx_n_s_is_a_call;
static PyObject *__pyx_n_s_is_async_func;
static PyObject *__pyx_n_s_is_async_func_2;
static PyObject *__pyx_n_s_is_async_obj;
static PyObject *__pyx_n_s_is_coroutine;
static PyObject *__pyx_n_u_is_coroutine;
static PyObject *__pyx_n_s_is_exception;
static PyObject *__pyx_n_s_is_instance_mock;
static PyObject *__pyx_n_s_is_list;
static PyObject *__pyx_n_s_is_local;
static PyObject *__pyx_n_u_is_local;
static PyObject *__pyx_n_s_is_magic;
static PyObject *__pyx_n_s_is_started;
static PyObject *__pyx_n_s_is_type;
static PyObject *__pyx_n_s_isawaitable;
static PyObject *__pyx_n_s_iscoroutinefunction;
static PyObject *__pyx_n_s_isdatadescriptor;
static PyObject *__pyx_n_s_isidentifier;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_u_iter;
static PyObject *__pyx_n_s_iter_side_effect;
static PyObject *__pyx_n_s_iterator;
static PyObject *__pyx_n_s_kall;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_keywargs;
static PyObject *__pyx_n_s_klass;
static PyObject *__pyx_n_s_kw;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_kwargs_2;
static PyObject *__pyx_n_s_kwargs_string;
static PyObject *__pyx_n_u_kwdefaults;
static PyObject *__pyx_n_s_lambda;
static PyObject *__pyx_n_s_last;
static PyObject *__pyx_n_u_le;
static PyObject *__pyx_n_u_len;
static PyObject *__pyx_n_s_len_2;
static PyObject *__pyx_n_s_len_other;
static PyObject *__pyx_n_s_len_self;
static PyObject *__pyx_n_s_len_value;
static PyObject *__pyx_n_s_line;
static PyObject *__pyx_n_s_local;
static PyObject *__pyx_n_u_lt;
static PyObject *__pyx_kp_u_lt_le_gt_ge_eq_ne_getitem_setite;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_m_name;
static PyObject *__pyx_n_s_m_value;
static PyObject *__pyx_n_s_magic_methods;
static PyObject *__pyx_n_s_magics;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_method;
static PyObject *__pyx_n_s_method_call_name;
static PyObject *__pyx_n_s_method_calls;
static PyObject *__pyx_n_u_method_calls;
static PyObject *__pyx_n_s_missing;
static PyObject *__pyx_n_u_missing_2;
static PyObject *__pyx_n_s_mock;
static PyObject *__pyx_n_u_mock;
static PyObject *__pyx_n_u_mock_2;
static PyObject *__pyx_kp_u_mock_3;
static PyObject *__pyx_n_s_mock_add_spec;
static PyObject *__pyx_n_s_mock_add_spec_2;
static PyObject *__pyx_n_u_mock_await_args;
static PyObject *__pyx_n_u_mock_await_args_list;
static PyObject *__pyx_n_u_mock_await_count;
static PyObject *__pyx_n_s_mock_call;
static PyObject *__pyx_n_u_mock_call_args;
static PyObject *__pyx_n_u_mock_call_args_list;
static PyObject *__pyx_n_u_mock_call_count;
static PyObject *__pyx_n_s_mock_call_name;
static PyObject *__pyx_n_u_mock_called;
static PyObject *__pyx_n_s_mock_calls;
static PyObject *__pyx_n_u_mock_calls;
static PyObject *__pyx_n_s_mock_check_sig;
static PyObject *__pyx_n_s_mock_children;
static PyObject *__pyx_n_u_mock_children;
static PyObject *__pyx_n_s_mock_delegate;
static PyObject *__pyx_n_u_mock_delegate;
static PyObject *__pyx_n_s_mock_from_kall;
static PyObject *__pyx_n_s_mock_methods;
static PyObject *__pyx_n_u_mock_methods;
static PyObject *__pyx_n_u_mock_mock_calls;
static PyObject *__pyx_n_s_mock_name;
static PyObject *__pyx_n_u_mock_name;
static PyObject *__pyx_n_s_mock_name_2;
static PyObject *__pyx_n_s_mock_new_name;
static PyObject *__pyx_n_u_mock_new_name;
static PyObject *__pyx_n_s_mock_new_parent;
static PyObject *__pyx_n_u_mock_new_parent;
static PyObject *__pyx_n_s_mock_open;
static PyObject *__pyx_n_u_mock_open;
static PyObject *__pyx_n_s_mock_open_locals__iter_side_effe;
static PyObject *__pyx_n_s_mock_open_locals__next_side_effe;
static PyObject *__pyx_n_s_mock_open_locals__read_side_effe;
static PyObject *__pyx_n_s_mock_open_locals__readline_side;
static PyObject *__pyx_n_s_mock_open_locals__readlines_side;
static PyObject *__pyx_n_s_mock_open_locals_reset_data;
static PyObject *__pyx_n_s_mock_parent;
static PyObject *__pyx_n_u_mock_parent;
static PyObject *__pyx_n_s_mock_return_value;
static PyObject *__pyx_n_u_mock_return_value;
static PyObject *__pyx_n_s_mock_sealed;
static PyObject *__pyx_n_u_mock_sealed;
static PyObject *__pyx_n_s_mock_set_magics;
static PyObject *__pyx_n_s_mock_side_effect;
static PyObject *__pyx_n_u_mock_side_effect;
static PyObject *__pyx_n_s_mock_unsafe;
static PyObject *__pyx_n_u_mock_unsafe;
static PyObject *__pyx_n_s_mock_wraps;
static PyObject *__pyx_n_u_mock_wraps;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_u_module;
static PyObject *__pyx_n_s_mro;
static PyObject *__pyx_n_s_msg;
static PyObject *__pyx_n_s_multiple;
static PyObject *__pyx_kp_u_must_be_the_actual_object_to_be;
static PyObject *__pyx_n_s_must_skip;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_u_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_name_2;
static PyObject *__pyx_n_s_name_3;
static PyObject *__pyx_n_s_name_list;
static PyObject *__pyx_kp_u_name_r;
static PyObject *__pyx_n_s_name_string;
static PyObject *__pyx_n_s_names;
static PyObject *__pyx_n_s_ne;
static PyObject *__pyx_n_u_ne;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_u_new;
static PyObject *__pyx_n_s_new_2;
static PyObject *__pyx_n_s_new_attr;
static PyObject *__pyx_n_s_new_callable;
static PyObject *__pyx_n_s_new_name;
static PyObject *__pyx_n_s_new_name_2;
static PyObject *__pyx_n_u_new_name_2;
static PyObject *__pyx_n_s_new_parent;
static PyObject *__pyx_n_s_newargs;
static PyObject *__pyx_n_s_newkeywargs;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_next_side_effect;
static PyObject *__pyx_n_s_non_defaults;
static PyObject *__pyx_kp_u_not_all_found_in_await_list;
static PyObject *__pyx_n_s_not_callable;
static PyObject *__pyx_kp_u_not_called;
static PyObject *__pyx_n_s_not_found;
static PyObject *__pyx_n_s_numerics;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_obj_type;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_u_open;
static PyObject *__pyx_n_s_orig_magics;
static PyObject *__pyx_n_s_original;
static PyObject *__pyx_n_s_original_2;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_other_args;
static PyObject *__pyx_n_s_other_kwargs;
static PyObject *__pyx_n_s_other_name;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_s_parent_2;
static PyObject *__pyx_n_s_partial;
static PyObject *__pyx_n_s_patch;
static PyObject *__pyx_n_s_patch_2;
static PyObject *__pyx_n_u_patch_2;
static PyObject *__pyx_n_s_patch___call;
static PyObject *__pyx_n_s_patch___enter;
static PyObject *__pyx_n_s_patch___exit;
static PyObject *__pyx_n_s_patch___init;
static PyObject *__pyx_n_s_patch___new;
static PyObject *__pyx_n_s_patch_copy;
static PyObject *__pyx_n_s_patch_decorate_async_callable;
static PyObject *__pyx_n_s_patch_decorate_async_callable_l;
static PyObject *__pyx_n_s_patch_decorate_callable;
static PyObject *__pyx_n_s_patch_decorate_callable_locals;
static PyObject *__pyx_n_s_patch_decorate_class;
static PyObject *__pyx_n_s_patch_decoration_helper;
static PyObject *__pyx_n_s_patch_dict;
static PyObject *__pyx_n_s_patch_dict___call;
static PyObject *__pyx_n_s_patch_dict___call___locals__inn;
static PyObject *__pyx_n_s_patch_dict___enter;
static PyObject *__pyx_n_s_patch_dict___exit;
static PyObject *__pyx_n_s_patch_dict___init;
static PyObject *__pyx_n_s_patch_dict__patch_dict;
static PyObject *__pyx_n_s_patch_dict__unpatch_dict;
static PyObject *__pyx_n_s_patch_dict_decorate_class;
static PyObject *__pyx_n_s_patch_get_original;
static PyObject *__pyx_n_s_patch_multiple;
static PyObject *__pyx_n_s_patch_multiple_locals_lambda;
static PyObject *__pyx_n_s_patch_object;
static PyObject *__pyx_n_s_patch_object_locals_lambda;
static PyObject *__pyx_n_s_patch_start;
static PyObject *__pyx_n_s_patch_stop;
static PyObject *__pyx_n_s_patch_stopall;
static PyObject *__pyx_n_s_patched;
static PyObject *__pyx_n_s_patcher;
static PyObject *__pyx_n_s_patching;
static PyObject *__pyx_n_s_patchings;
static PyObject *__pyx_n_u_patchings;
static PyObject *__pyx_n_s_pformat;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_pprint;
static PyObject *__pyx_n_s_prefix;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_u_prepare;
static PyObject *__pyx_n_s_problem;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_kp_u_r_s;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_read_data;
static PyObject *__pyx_n_s_read_data_2;
static PyObject *__pyx_n_s_read_side_effect;
static PyObject *__pyx_n_s_readline;
static PyObject *__pyx_n_s_readline_side_effect;
static PyObject *__pyx_n_s_readlines;
static PyObject *__pyx_n_s_readlines_side_effect;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_u_reduce;
static PyObject *__pyx_n_u_reduce_ex;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_remove_magics;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_u_repr;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_reset_data;
static PyObject *__pyx_n_s_reset_mock;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_ret;
static PyObject *__pyx_n_s_ret_val;
static PyObject *__pyx_n_s_return_calculator;
static PyObject *__pyx_n_s_return_value;
static PyObject *__pyx_n_u_return_value;
static PyObject *__pyx_n_s_return_values;
static PyObject *__pyx_n_s_reversed;
static PyObject *__pyx_n_u_reversed_2;
static PyObject *__pyx_n_s_right;
static PyObject *__pyx_n_s_rsplit;
static PyObject *__pyx_n_s_rstrip;
static PyObject *__pyx_kp_u_s;
static PyObject *__pyx_kp_u_s_2;
static PyObject *__pyx_kp_u_s_await_not_found;
static PyObject *__pyx_kp_u_s_call_not_found;
static PyObject *__pyx_kp_u_s_s;
static PyObject *__pyx_n_s_safe_repr;
static PyObject *__pyx_n_s_safe_super;
static PyObject *__pyx_n_s_seal;
static PyObject *__pyx_n_u_seal;
static PyObject *__pyx_n_s_second;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_self_args;
static PyObject *__pyx_n_s_self_kwargs;
static PyObject *__pyx_n_s_self_name;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_sentinel;
static PyObject *__pyx_n_u_sentinel;
static PyObject *__pyx_kp_u_sentinel_s;
static PyObject *__pyx_n_s_sentinels;
static PyObject *__pyx_n_s_set;
static PyObject *__pyx_n_s_set_2;
static PyObject *__pyx_n_u_set_2;
static PyObject *__pyx_n_s_set_return_value;
static PyObject *__pyx_n_s_set_return_value_2;
static PyObject *__pyx_n_s_set_side_effect;
static PyObject *__pyx_n_s_set_signature;
static PyObject *__pyx_n_s_set_signature_locals_checksig;
static PyObject *__pyx_n_s_setattr;
static PyObject *__pyx_n_u_setattr;
static PyObject *__pyx_n_s_setdefault;
static PyObject *__pyx_n_u_setformat;
static PyObject *__pyx_n_u_setstate;
static PyObject *__pyx_n_s_setup_async_mock;
static PyObject *__pyx_n_s_setup_async_mock_locals_wrapper;
static PyObject *__pyx_n_s_setup_func;
static PyObject *__pyx_n_s_setup_func_locals_assert_any_ca;
static PyObject *__pyx_n_s_setup_func_locals_assert_called;
static PyObject *__pyx_n_s_setup_func_locals_assert_called_2;
static PyObject *__pyx_n_s_setup_func_locals_assert_called_3;
static PyObject *__pyx_n_s_setup_func_locals_assert_called_4;
static PyObject *__pyx_n_s_setup_func_locals_assert_has_ca;
static PyObject *__pyx_n_s_setup_func_locals_assert_not_ca;
static PyObject *__pyx_n_s_setup_func_locals_reset_mock;
static PyObject *__pyx_n_s_sf;
static PyObject *__pyx_n_s_side_effect;
static PyObject *__pyx_n_u_side_effect;
static PyObject *__pyx_n_s_side_effect_methods;
static PyObject *__pyx_n_s_side_effector;
static PyObject *__pyx_n_s_sig;
static PyObject *__pyx_n_s_sig_func;
static PyObject *__pyx_n_s_signature;
static PyObject *__pyx_n_s_signature_2;
static PyObject *__pyx_n_s_sizeof;
static PyObject *__pyx_n_u_sizeof;
static PyObject *__pyx_n_s_skipfirst;
static PyObject *__pyx_n_s_sorted;
static PyObject *__pyx_n_s_spec;
static PyObject *__pyx_n_u_spec;
static PyObject *__pyx_n_s_spec_arg;
static PyObject *__pyx_n_s_spec_as_instance;
static PyObject *__pyx_n_u_spec_as_instance;
static PyObject *__pyx_n_s_spec_asyncs;
static PyObject *__pyx_n_u_spec_asyncs;
static PyObject *__pyx_n_s_spec_class;
static PyObject *__pyx_n_u_spec_class;
static PyObject *__pyx_kp_u_spec_r;
static PyObject *__pyx_n_s_spec_set;
static PyObject *__pyx_n_u_spec_set;
static PyObject *__pyx_n_s_spec_set_2;
static PyObject *__pyx_n_u_spec_set_2;
static PyObject *__pyx_kp_u_spec_set_r;
static PyObject *__pyx_n_s_spec_signature;
static PyObject *__pyx_n_u_spec_signature;
static PyObject *__pyx_n_s_spec_state;
static PyObject *__pyx_n_s_spec_string;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_src;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_stopall;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_u_str;
static PyObject *__pyx_n_s_sub_list;
static PyObject *__pyx_n_u_subclasscheck;
static PyObject *__pyx_n_u_subclasses;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sync_async_magics;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_temp_original;
static PyObject *__pyx_n_u_test;
static PyObject *__pyx_n_s_test_2;
static PyObject *__pyx_n_u_text_signature;
static PyObject *__pyx_n_s_the_name;
static PyObject *__pyx_n_s_these_magics;
static PyObject *__pyx_n_s_thing;
static PyObject *__pyx_n_s_this_mock_call;
static PyObject *__pyx_n_s_this_patcher;
static PyObject *__pyx_n_s_this_spec;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_kp_u_times;
static PyObject *__pyx_kp_u_to_be_called_once_Called;
static PyObject *__pyx_kp_u_to_have_been_awaited;
static PyObject *__pyx_kp_u_to_have_been_awaited_once_Await;
static PyObject *__pyx_kp_u_to_have_been_called_once_Called;
static PyObject *__pyx_kp_u_to_not_have_been_awaited_Awaite;
static PyObject *__pyx_kp_u_to_not_have_been_called_Called;
static PyObject *__pyx_n_s_to_stream;
static PyObject *__pyx_n_s_try_iter;
static PyObject *__pyx_n_s_two;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_types;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_unittest_util;
static PyObject *__pyx_n_s_unpatch_dict;
static PyObject *__pyx_n_s_unsafe;
static PyObject *__pyx_n_s_unsupported_magics;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_vals;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_visited;
static PyObject *__pyx_n_s_with_traceback;
static PyObject *__pyx_n_s_wrapper;
static PyObject *__pyx_n_s_wraps;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_pf_6cymock_76genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_79genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_6cymock_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_6cymock_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_6cymock_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_6cymock_lambda13(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock__is_async_obj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_2_is_async_func(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6cymock_4_is_instance_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_6_is_exception(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_8_extract_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_10_get_signature_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_as_instance, PyObject *__pyx_v_eat_self); /* proto */
static PyObject *__pyx_pf_6cymock_16_check_signature_checksig(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_12_check_signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_mock, PyObject *__pyx_v_skipfirst, PyObject *__pyx_v_instance); /* proto */
static PyObject *__pyx_pf_6cymock_14_copy_func_details(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_funcopy); /* proto */
static PyObject *__pyx_pf_6cymock_16_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_18_is_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_20_instance_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_14_set_signature_checksig(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_22_set_signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock, PyObject *__pyx_v_original, PyObject *__pyx_v_instance); /* proto */
static PyObject *__pyx_pf_6cymock_11_setup_func_assert_called_with(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_setup_func_2assert_called(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_setup_func_4assert_not_called(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_setup_func_6assert_called_once(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_setup_func_8assert_called_once_with(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_setup_func_10assert_has_calls(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_setup_func_12assert_any_call(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_setup_func_14reset_mock(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_24_setup_func(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcopy, PyObject *__pyx_v_mock, PyObject *__pyx_v_sig); /* proto */
static PyObject *__pyx_pf_6cymock_17_setup_async_mock_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_attr, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_26_setup_async_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock); /* proto */
static PyObject *__pyx_pf_6cymock_28_is_magic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6cymock_15_SentinelObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6cymock_15_SentinelObject_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15_SentinelObject_4__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_9_Sentinel___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_9_Sentinel_2__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6cymock_9_Sentinel_4__reduce__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_90__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_20_delegating_property__get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v__the_name); /* proto */
static PyObject *__pyx_pf_6cymock_92__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_20_delegating_property_2_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_name, PyObject *__pyx_v__the_name); /* proto */
static PyObject *__pyx_pf_6cymock_30_delegating_property(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6cymock_9_CallList___contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6cymock_9_CallList_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_32_check_and_set_parent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_value, PyObject *__pyx_v_name, PyObject *__pyx_v_new_name); /* proto */
static PyObject *__pyx_pf_6cymock_9_MockIter___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_9_MockIter_2__next__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_4Base___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_wraps, PyObject *__pyx_v_name, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_parent, PyObject *__pyx_v__spec_state, PyObject *__pyx_v__new_name, PyObject *__pyx_v__new_parent, PyObject *__pyx_v__spec_as_instance, PyObject *__pyx_v__eat_self, PyObject *__pyx_v_unsafe, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_4attach_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mock, PyObject *__pyx_v_attribute); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_6mock_add_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_8_mock_add_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set, PyObject *__pyx_v__spec_as_instance, PyObject *__pyx_v__eat_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_10__get_return_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_12__set_return_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_14__class__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_16__get_side_effect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_18__set_side_effect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_20reset_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_visited, PyObject *__pyx_v_return_value, PyObject *__pyx_v_side_effect); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_entry); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_22configure_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_24__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_26_extract_mock_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_28__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_30__dir__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_32__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_34__delattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_36_format_mock_call_signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_38_format_mock_failure_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_action); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_40_get_call_signature_from_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_42_call_matcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__call); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_44assert_not_called(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_46assert_called(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_48assert_called_once(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_18assert_called_with__error_message(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_50assert_called_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_52assert_called_once_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_16assert_has_calls_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_16assert_has_calls_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_54assert_has_calls(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_calls, PyObject *__pyx_v_any_order); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_56assert_any_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_58_get_child_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6cymock_15NonCallableMock_60_calls_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_6cymock_34_try_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6cymock_86__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_13CallableMixin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_side_effect, PyObject *__pyx_v_return_value, PyObject *__pyx_v_wraps, PyObject *__pyx_v_name, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_parent, PyObject *__pyx_v__spec_state, PyObject *__pyx_v__new_name, PyObject *__pyx_v__new_parent, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_13CallableMixin_2_mock_check_sig(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_13CallableMixin_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_13CallableMixin_6_mock_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_13CallableMixin_8_increment_mock_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_13CallableMixin_10_execute_mock_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_36_dot_lookup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_thing, PyObject *__pyx_v_comp, PyObject *__pyx_v_import_path); /* proto */
static PyObject *__pyx_pf_6cymock_38_importer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target); /* proto */
static PyObject *__pyx_pf_6cymock_40_is_started(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_patcher); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getter, PyObject *__pyx_v_attribute, PyObject *__pyx_v_new, PyObject *__pyx_v_spec, PyObject *__pyx_v_create, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_autospec, PyObject *__pyx_v_new_callable, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_2copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_6decorate_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_klass); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_8decoration_helper(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_patched, PyObject *__pyx_v_args, PyObject *__pyx_v_keywargs); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_17decorate_callable_patched(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_keywargs); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_11decorate_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_23decorate_async_callable_patched(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_keywargs); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_13decorate_async_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_15get_original(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_17__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_19__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exc_info); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_21start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_6_patch_23stop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_42_get_target(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_44_patch_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target, PyObject *__pyx_v_attribute, PyObject *__pyx_v_new, PyObject *__pyx_v_spec, PyObject *__pyx_v_create, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_autospec, PyObject *__pyx_v_new_callable, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda7(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_46_patch_multiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target, PyObject *__pyx_v_spec, PyObject *__pyx_v_create, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_autospec, PyObject *__pyx_v_new_callable, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_88__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_5patch___new__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_target, PyObject *__pyx_v_new, PyObject *__pyx_v_spec, PyObject *__pyx_v_create, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_autospec, PyObject *__pyx_v_new_callable, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_patch_dict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_in_dict, PyObject *__pyx_v_values, PyObject *__pyx_v_clear, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_11_patch_dict_8__call____inner(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6cymock_11_patch_dict_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_6cymock_11_patch_dict_4decorate_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_klass); /* proto */
static PyObject *__pyx_pf_6cymock_11_patch_dict_6__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_11_patch_dict_8_patch_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_11_patch_dict_10_unpatch_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_11_patch_dict_12__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6cymock_48_clear_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_dict); /* proto */
static PyObject *__pyx_pf_6cymock_50_patch_stopall(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_11_get_method_method(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6cymock_52_get_method(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_6cymock_7_get_eq___eq__(PyObject *__pyx_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6cymock_54_get_eq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_7_get_ne___ne__(PyObject *__pyx_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6cymock_56_get_ne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_9_get_iter___iter__(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_58_get_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_15_get_async_iter___aiter__(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_60_get_async_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_62_set_return_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock, PyObject *__pyx_v_method, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_6cymock_10MagicMixin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6cymock_10MagicMixin_2_mock_set_magics(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_20NonCallableMagicMock_mock_add_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set); /* proto */
static PyObject *__pyx_pf_6cymock_15AsyncMagicMixin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_6cymock_9MagicMock_mock_add_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set); /* proto */
static PyObject *__pyx_pf_6cymock_10MagicProxy___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_6cymock_10MagicProxy_2create_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_10MagicProxy_4__get__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v__type); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_2_execute_mock_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_5assert_awaited(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_7assert_awaited_once(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_19assert_awaited_with__error_message(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_9assert_awaited_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_11assert_awaited_once_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_13assert_any_await(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_17assert_has_awaits_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_17assert_has_awaits_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_15assert_has_awaits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_calls, PyObject *__pyx_v_any_order); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_17assert_not_awaited(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_19reset_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_4_ANY___eq__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6cymock_4_ANY_2__ne__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6cymock_4_ANY_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_64_format_call_signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_parent, PyObject *__pyx_v_two, CYTHON_UNUSED PyObject *__pyx_v_from_kall); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value, PyObject *__pyx_v_name, PyObject *__pyx_v_parent, CYTHON_UNUSED PyObject *__pyx_v_two, PyObject *__pyx_v_from_kall); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_4__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_6__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_8__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_10__getattribute__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_12count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_14index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_16_get_call_arguments(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_18args(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_20kwargs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_22__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_5_Call_24call_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_66create_autospec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_instance, PyObject *__pyx_v__parent, PyObject *__pyx_v__name, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_68_must_skip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_entry, PyObject *__pyx_v_is_type); /* proto */
static PyObject *__pyx_pf_6cymock_10_SpecState___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, PyObject *__pyx_v_ids, PyObject *__pyx_v_instance); /* proto */
static PyObject *__pyx_pf_6cymock_70_to_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_read_data); /* proto */
static PyObject *__pyx_pf_6cymock_9mock_open__readlines_side_effect(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_9mock_open_2_read_side_effect(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_9mock_open_4_readline_side_effect(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_9mock_open_7_iter_side_effect(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_9mock_open_10_next_side_effect(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6cymock_9mock_open_12reset_data(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_72mock_open(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock, PyObject *__pyx_v_read_data); /* proto */
static PyObject *__pyx_pf_6cymock_12PropertyMock__get_child_mock(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_6cymock_12PropertyMock_2__get__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_obj_type); /* proto */
static PyObject *__pyx_pf_6cymock_12PropertyMock_4__set__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_6cymock_74seal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock); /* proto */
static PyObject *__pyx_pf_6cymock_14_AsyncIterator___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_iterator); /* proto */
static PyObject *__pyx_pf_6cymock_14_AsyncIterator_2__aiter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6cymock_14_AsyncIterator_4__anext__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct___check_signature(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_1__set_signature(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_2__setup_func(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_3__setup_async_mock(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_4___setattr__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_5_assert_called_with(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_6_assert_has_calls(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_9_decoration_helper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_10_decorate_callable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_11_decorate_async_callable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_12_patched(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_13__get_target(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_14__patch_object(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_15__patch_multiple(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_16___call__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_18_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_19__get_method(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_20__get_eq(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_21__get_ne(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_22__get_iter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_23__get_async_iter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_24__execute_mock_call(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_25_assert_awaited_with(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_26_assert_has_awaits(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_27_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_28_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_29_mock_open(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_30__readline_side_effect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_31__iter_side_effect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_32___anext__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_neg_2;
static PyObject *__pyx_k__60;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__26;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_codeobj__3;
static PyObject *__pyx_codeobj__6;
static PyObject *__pyx_codeobj__8;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__181;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__234;
static PyObject *__pyx_tuple__236;
static PyObject *__pyx_tuple__238;
static PyObject *__pyx_tuple__240;
static PyObject *__pyx_tuple__242;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__252;
static PyObject *__pyx_tuple__254;
static PyObject *__pyx_tuple__256;
static PyObject *__pyx_tuple__258;
static PyObject *__pyx_tuple__260;
static PyObject *__pyx_tuple__262;
static PyObject *__pyx_tuple__264;
static PyObject *__pyx_tuple__266;
static PyObject *__pyx_tuple__268;
static PyObject *__pyx_tuple__270;
static PyObject *__pyx_tuple__272;
static PyObject *__pyx_tuple__274;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__278;
static PyObject *__pyx_tuple__280;
static PyObject *__pyx_tuple__282;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__288;
static PyObject *__pyx_tuple__290;
static PyObject *__pyx_tuple__292;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__297;
static PyObject *__pyx_tuple__299;
static PyObject *__pyx_tuple__301;
static PyObject *__pyx_tuple__303;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__307;
static PyObject *__pyx_tuple__309;
static PyObject *__pyx_tuple__311;
static PyObject *__pyx_tuple__313;
static PyObject *__pyx_tuple__314;
static PyObject *__pyx_tuple__316;
static PyObject *__pyx_tuple__318;
static PyObject *__pyx_tuple__319;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__323;
static PyObject *__pyx_tuple__325;
static PyObject *__pyx_tuple__326;
static PyObject *__pyx_tuple__328;
static PyObject *__pyx_tuple__329;
static PyObject *__pyx_tuple__331;
static PyObject *__pyx_tuple__333;
static PyObject *__pyx_tuple__335;
static PyObject *__pyx_tuple__337;
static PyObject *__pyx_tuple__339;
static PyObject *__pyx_tuple__341;
static PyObject *__pyx_tuple__342;
static PyObject *__pyx_tuple__344;
static PyObject *__pyx_tuple__346;
static PyObject *__pyx_tuple__347;
static PyObject *__pyx_tuple__349;
static PyObject *__pyx_tuple__351;
static PyObject *__pyx_tuple__353;
static PyObject *__pyx_tuple__355;
static PyObject *__pyx_tuple__357;
static PyObject *__pyx_tuple__358;
static PyObject *__pyx_tuple__360;
static PyObject *__pyx_tuple__361;
static PyObject *__pyx_tuple__363;
static PyObject *__pyx_tuple__365;
static PyObject *__pyx_tuple__367;
static PyObject *__pyx_tuple__369;
static PyObject *__pyx_tuple__371;
static PyObject *__pyx_tuple__373;
static PyObject *__pyx_tuple__375;
static PyObject *__pyx_tuple__377;
static PyObject *__pyx_tuple__379;
static PyObject *__pyx_tuple__381;
static PyObject *__pyx_tuple__383;
static PyObject *__pyx_tuple__385;
static PyObject *__pyx_tuple__387;
static PyObject *__pyx_tuple__388;
static PyObject *__pyx_tuple__390;
static PyObject *__pyx_tuple__391;
static PyObject *__pyx_tuple__393;
static PyObject *__pyx_tuple__395;
static PyObject *__pyx_tuple__397;
static PyObject *__pyx_tuple__399;
static PyObject *__pyx_tuple__400;
static PyObject *__pyx_tuple__402;
static PyObject *__pyx_tuple__404;
static PyObject *__pyx_tuple__406;
static PyObject *__pyx_tuple__408;
static PyObject *__pyx_codeobj__10;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__14;
static PyObject *__pyx_codeobj__16;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__20;
static PyObject *__pyx_codeobj__22;
static PyObject *__pyx_codeobj__24;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__30;
static PyObject *__pyx_codeobj__42;
static PyObject *__pyx_codeobj__47;
static PyObject *__pyx_codeobj__50;
static PyObject *__pyx_codeobj__52;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__67;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__71;
static PyObject *__pyx_codeobj__73;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__76;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__83;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__98;
static PyObject *__pyx_codeobj__100;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__114;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__118;
static PyObject *__pyx_codeobj__120;
static PyObject *__pyx_codeobj__122;
static PyObject *__pyx_codeobj__125;
static PyObject *__pyx_codeobj__127;
static PyObject *__pyx_codeobj__129;
static PyObject *__pyx_codeobj__132;
static PyObject *__pyx_codeobj__134;
static PyObject *__pyx_codeobj__136;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__140;
static PyObject *__pyx_codeobj__142;
static PyObject *__pyx_codeobj__144;
static PyObject *__pyx_codeobj__147;
static PyObject *__pyx_codeobj__149;
static PyObject *__pyx_codeobj__152;
static PyObject *__pyx_codeobj__154;
static PyObject *__pyx_codeobj__156;
static PyObject *__pyx_codeobj__159;
static PyObject *__pyx_codeobj__161;
static PyObject *__pyx_codeobj__164;
static PyObject *__pyx_codeobj__167;
static PyObject *__pyx_codeobj__169;
static PyObject *__pyx_codeobj__171;
static PyObject *__pyx_codeobj__173;
static PyObject *__pyx_codeobj__175;
static PyObject *__pyx_codeobj__177;
static PyObject *__pyx_codeobj__180;
static PyObject *__pyx_codeobj__182;
static PyObject *__pyx_codeobj__184;
static PyObject *__pyx_codeobj__186;
static PyObject *__pyx_codeobj__188;
static PyObject *__pyx_codeobj__190;
static PyObject *__pyx_codeobj__192;
static PyObject *__pyx_codeobj__194;
static PyObject *__pyx_codeobj__196;
static PyObject *__pyx_codeobj__199;
static PyObject *__pyx_codeobj__201;
static PyObject *__pyx_codeobj__203;
static PyObject *__pyx_codeobj__205;
static PyObject *__pyx_codeobj__207;
static PyObject *__pyx_codeobj__209;
static PyObject *__pyx_codeobj__211;
static PyObject *__pyx_codeobj__213;
static PyObject *__pyx_codeobj__216;
static PyObject *__pyx_codeobj__218;
static PyObject *__pyx_codeobj__220;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__227;
static PyObject *__pyx_codeobj__229;
static PyObject *__pyx_codeobj__231;
static PyObject *__pyx_codeobj__233;
static PyObject *__pyx_codeobj__235;
static PyObject *__pyx_codeobj__237;
static PyObject *__pyx_codeobj__239;
static PyObject *__pyx_codeobj__241;
static PyObject *__pyx_codeobj__244;
static PyObject *__pyx_codeobj__246;
static PyObject *__pyx_codeobj__248;
static PyObject *__pyx_codeobj__250;
static PyObject *__pyx_codeobj__253;
static PyObject *__pyx_codeobj__255;
static PyObject *__pyx_codeobj__257;
static PyObject *__pyx_codeobj__259;
static PyObject *__pyx_codeobj__261;
static PyObject *__pyx_codeobj__263;
static PyObject *__pyx_codeobj__265;
static PyObject *__pyx_codeobj__267;
static PyObject *__pyx_codeobj__269;
static PyObject *__pyx_codeobj__271;
static PyObject *__pyx_codeobj__273;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__279;
static PyObject *__pyx_codeobj__281;
static PyObject *__pyx_codeobj__283;
static PyObject *__pyx_codeobj__285;
static PyObject *__pyx_codeobj__287;
static PyObject *__pyx_codeobj__289;
static PyObject *__pyx_codeobj__291;
static PyObject *__pyx_codeobj__293;
static PyObject *__pyx_codeobj__296;
static PyObject *__pyx_codeobj__298;
static PyObject *__pyx_codeobj__300;
static PyObject *__pyx_codeobj__302;
static PyObject *__pyx_codeobj__304;
static PyObject *__pyx_codeobj__306;
static PyObject *__pyx_codeobj__308;
static PyObject *__pyx_codeobj__310;
static PyObject *__pyx_codeobj__312;
static PyObject *__pyx_codeobj__315;
static PyObject *__pyx_codeobj__317;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__324;
static PyObject *__pyx_codeobj__327;
static PyObject *__pyx_codeobj__330;
static PyObject *__pyx_codeobj__332;
static PyObject *__pyx_codeobj__334;
static PyObject *__pyx_codeobj__336;
static PyObject *__pyx_codeobj__338;
static PyObject *__pyx_codeobj__340;
static PyObject *__pyx_codeobj__343;
static PyObject *__pyx_codeobj__345;
static PyObject *__pyx_codeobj__348;
static PyObject *__pyx_codeobj__350;
static PyObject *__pyx_codeobj__352;
static PyObject *__pyx_codeobj__354;
static PyObject *__pyx_codeobj__356;
static PyObject *__pyx_codeobj__359;
static PyObject *__pyx_codeobj__362;
static PyObject *__pyx_codeobj__364;
static PyObject *__pyx_codeobj__366;
static PyObject *__pyx_codeobj__368;
static PyObject *__pyx_codeobj__370;
static PyObject *__pyx_codeobj__372;
static PyObject *__pyx_codeobj__374;
static PyObject *__pyx_codeobj__376;
static PyObject *__pyx_codeobj__378;
static PyObject *__pyx_codeobj__380;
static PyObject *__pyx_codeobj__382;
static PyObject *__pyx_codeobj__384;
static PyObject *__pyx_codeobj__386;
static PyObject *__pyx_codeobj__389;
static PyObject *__pyx_codeobj__392;
static PyObject *__pyx_codeobj__394;
static PyObject *__pyx_codeobj__396;
static PyObject *__pyx_codeobj__398;
static PyObject *__pyx_codeobj__401;
static PyObject *__pyx_codeobj__403;
static PyObject *__pyx_codeobj__405;
static PyObject *__pyx_codeobj__407;
/* Late includes */
static PyObject *__pyx_gb_6cymock_78generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":1905
 *     "add sub mul matmul div floordiv mod lshift rshift and xor or pow truediv"
 * )
 * inplace = ' '.join('i%s' % n for n in numerics.split())             # <<<<<<<<<<<<<<
 * right = ' '.join('r%s' % n for n in numerics.split())
 * 
 */

static PyObject *__pyx_pf_6cymock_76genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *)__pyx_tp_new_6cymock___pyx_scope_struct_17_genexpr(__pyx_ptype_6cymock___pyx_scope_struct_17_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1905, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_78generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 1905, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_78generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numerics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1905, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1905, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1905, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1905, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_i_s, __pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1905, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_81generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":1906
 * )
 * inplace = ' '.join('i%s' % n for n in numerics.split())
 * right = ' '.join('r%s' % n for n in numerics.split())             # <<<<<<<<<<<<<<
 * 
 * # not including __prepare__, __instancecheck__, __subclasscheck__
 */

static PyObject *__pyx_pf_6cymock_79genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *)__pyx_tp_new_6cymock___pyx_scope_struct_18_genexpr(__pyx_ptype_6cymock___pyx_scope_struct_18_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1906, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_81generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 1906, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_81generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numerics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1906, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1906, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1906, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1906, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_n);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_n, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_r_s, __pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1906, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1951
 * 
 * _calculate_return_value = {
 *     '__hash__': lambda self: object.__hash__(self),             # <<<<<<<<<<<<<<
 *     '__str__': lambda self: object.__str__(self),
 *     '__sizeof__': lambda self: object.__sizeof__(self),
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_82lambda10(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_82lambda10 = {"lambda10", (PyCFunction)__pyx_pw_6cymock_82lambda10, METH_O, 0};
static PyObject *__pyx_pw_6cymock_82lambda10(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda10 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_6cymock_lambda10(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_lambda_funcdef_6cymock_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda10", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_hash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1951, __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1952
 * _calculate_return_value = {
 *     '__hash__': lambda self: object.__hash__(self),
 *     '__str__': lambda self: object.__str__(self),             # <<<<<<<<<<<<<<
 *     '__sizeof__': lambda self: object.__sizeof__(self),
 *     '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}",
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_83lambda11(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_83lambda11 = {"lambda11", (PyCFunction)__pyx_pw_6cymock_83lambda11, METH_O, 0};
static PyObject *__pyx_pw_6cymock_83lambda11(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda11 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_6cymock_lambda11(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_lambda_funcdef_6cymock_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda11", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1953
 *     '__hash__': lambda self: object.__hash__(self),
 *     '__str__': lambda self: object.__str__(self),
 *     '__sizeof__': lambda self: object.__sizeof__(self),             # <<<<<<<<<<<<<<
 *     '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}",
 * }
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_84lambda12(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_84lambda12 = {"lambda12", (PyCFunction)__pyx_pw_6cymock_84lambda12, METH_O, 0};
static PyObject *__pyx_pw_6cymock_84lambda12(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda12 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_6cymock_lambda12(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_lambda_funcdef_6cymock_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda12", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_sizeof); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock.lambda12", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1954
 *     '__str__': lambda self: object.__str__(self),
 *     '__sizeof__': lambda self: object.__sizeof__(self),
 *     '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}",             # <<<<<<<<<<<<<<
 * }
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_85lambda13(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_85lambda13 = {"lambda13", (PyCFunction)__pyx_pw_6cymock_85lambda13, METH_O, 0};
static PyObject *__pyx_pw_6cymock_85lambda13(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda13 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_6cymock_lambda13(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_lambda_funcdef_6cymock_lambda13(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("lambda13", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u_);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extract_mock_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u_);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock.lambda13", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":52
 * _safe_super = super
 * 
 * def _is_async_obj(obj):             # <<<<<<<<<<<<<<
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
 *         return False
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_1_is_async_obj(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_1_is_async_obj = {"_is_async_obj", (PyCFunction)__pyx_pw_6cymock_1_is_async_obj, METH_O, 0};
static PyObject *__pyx_pw_6cymock_1_is_async_obj(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_async_obj (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock__is_async_obj(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_6cymock__is_async_obj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_is_async_obj", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "cymock.pyx":53
 * 
 * def _is_async_obj(obj):
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):             # <<<<<<<<<<<<<<
 *         return False
 *     if hasattr(obj, '__func__'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_is_instance_mock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
  __pyx_t_1 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cymock.pyx":54
 * def _is_async_obj(obj):
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
 *         return False             # <<<<<<<<<<<<<<
 *     if hasattr(obj, '__func__'):
 *         obj = getattr(obj, '__func__')
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cymock.pyx":53
 * 
 * def _is_async_obj(obj):
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):             # <<<<<<<<<<<<<<
 *         return False
 *     if hasattr(obj, '__func__'):
 */
  }

  /* "cymock.pyx":55
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
 *         return False
 *     if hasattr(obj, '__func__'):             # <<<<<<<<<<<<<<
 *         obj = getattr(obj, '__func__')
 *     return asyncio.iscoroutinefunction(obj) or inspect.isawaitable(obj)
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_func); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 55, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "cymock.pyx":56
 *         return False
 *     if hasattr(obj, '__func__'):
 *         obj = getattr(obj, '__func__')             # <<<<<<<<<<<<<<
 *     return asyncio.iscoroutinefunction(obj) or inspect.isawaitable(obj)
 * 
 */
    __pyx_t_2 = __Pyx_GetAttr(__pyx_v_obj, __pyx_n_u_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cymock.pyx":55
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
 *         return False
 *     if hasattr(obj, '__func__'):             # <<<<<<<<<<<<<<
 *         obj = getattr(obj, '__func__')
 *     return asyncio.iscoroutinefunction(obj) or inspect.isawaitable(obj)
 */
  }

  /* "cymock.pyx":57
 *     if hasattr(obj, '__func__'):
 *         obj = getattr(obj, '__func__')
 *     return asyncio.iscoroutinefunction(obj) or inspect.isawaitable(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_obj);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 57, __pyx_L1_error)
  if (!__pyx_t_6) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L7_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_inspect); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_isawaitable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L7_bool_binop_done:;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":52
 * _safe_super = super
 * 
 * def _is_async_obj(obj):             # <<<<<<<<<<<<<<
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
 *         return False
 */

  /* 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_7);
  __Pyx_AddTraceback("cymock._is_async_obj", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":60
 * 
 * 
 * def _is_async_func(func):             # <<<<<<<<<<<<<<
 *     if getattr(func, '__code__', None):
 *         return asyncio.iscoroutinefunction(func)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_3_is_async_func(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_3_is_async_func = {"_is_async_func", (PyCFunction)__pyx_pw_6cymock_3_is_async_func, METH_O, 0};
static PyObject *__pyx_pw_6cymock_3_is_async_func(PyObject *__pyx_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_async_func (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_2_is_async_func(__pyx_self, ((PyObject *)__pyx_v_func));

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

static PyObject *__pyx_pf_6cymock_2_is_async_func(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_is_async_func", 0);

  /* "cymock.pyx":61
 * 
 * def _is_async_func(func):
 *     if getattr(func, '__code__', None):             # <<<<<<<<<<<<<<
 *         return asyncio.iscoroutinefunction(func)
 *     else:
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_u_code, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cymock.pyx":62
 * def _is_async_func(func):
 *     if getattr(func, '__code__', None):
 *         return asyncio.iscoroutinefunction(func)             # <<<<<<<<<<<<<<
 *     else:
 *         return False
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_func);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":61
 * 
 * def _is_async_func(func):
 *     if getattr(func, '__code__', None):             # <<<<<<<<<<<<<<
 *         return asyncio.iscoroutinefunction(func)
 *     else:
 */
  }

  /* "cymock.pyx":64
 *         return asyncio.iscoroutinefunction(func)
 *     else:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "cymock.pyx":60
 * 
 * 
 * def _is_async_func(func):             # <<<<<<<<<<<<<<
 *     if getattr(func, '__code__', None):
 *         return asyncio.iscoroutinefunction(func)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cymock._is_async_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":67
 * 
 * 
 * def _is_instance_mock(obj):             # <<<<<<<<<<<<<<
 *     # can't use isinstance on Mock objects because they override __class__
 *     # The base class for all mocks is NonCallableMock
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_is_instance_mock(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_is_instance_mock = {"_is_instance_mock", (PyCFunction)__pyx_pw_6cymock_5_is_instance_mock, METH_O, 0};
static PyObject *__pyx_pw_6cymock_5_is_instance_mock(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_instance_mock (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_4_is_instance_mock(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_6cymock_4_is_instance_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_is_instance_mock", 0);

  /* "cymock.pyx":70
 *     # can't use isinstance on Mock objects because they override __class__
 *     # The base class for all mocks is NonCallableMock
 *     return issubclass(type(obj), NonCallableMock)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsSubclass(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":67
 * 
 * 
 * def _is_instance_mock(obj):             # <<<<<<<<<<<<<<
 *     # can't use isinstance on Mock objects because they override __class__
 *     # The base class for all mocks is NonCallableMock
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._is_instance_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":73
 * 
 * 
 * def _is_exception(obj):             # <<<<<<<<<<<<<<
 *     return (
 *         isinstance(obj, BaseException) or
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_7_is_exception(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_7_is_exception = {"_is_exception", (PyCFunction)__pyx_pw_6cymock_7_is_exception, METH_O, 0};
static PyObject *__pyx_pw_6cymock_7_is_exception(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_exception (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_6_is_exception(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_6cymock_6_is_exception(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_is_exception", 0);

  /* "cymock.pyx":74
 * 
 * def _is_exception(obj):
 *     return (             # <<<<<<<<<<<<<<
 *         isinstance(obj, BaseException) or
 *         isinstance(obj, type) and issubclass(obj, BaseException)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "cymock.pyx":75
 * def _is_exception(obj):
 *     return (
 *         isinstance(obj, BaseException) or             # <<<<<<<<<<<<<<
 *         isinstance(obj, type) and issubclass(obj, BaseException)
 *     )
 */
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_builtin_BaseException); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 75, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "cymock.pyx":76
 *     return (
 *         isinstance(obj, BaseException) or
 *         isinstance(obj, type) and issubclass(obj, BaseException)             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_2 = PyType_Check(__pyx_v_obj); 
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_obj, __pyx_builtin_BaseException); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 76, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":73
 * 
 * 
 * def _is_exception(obj):             # <<<<<<<<<<<<<<
 *     return (
 *         isinstance(obj, BaseException) or
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._is_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":80
 * 
 * 
 * def _extract_mock(obj):             # <<<<<<<<<<<<<<
 *     # Autospecced functions will return a FunctionType with "mock" attribute
 *     # which is the actual mock object that needs to be used.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_extract_mock(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_extract_mock = {"_extract_mock", (PyCFunction)__pyx_pw_6cymock_9_extract_mock, METH_O, 0};
static PyObject *__pyx_pw_6cymock_9_extract_mock(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_extract_mock (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_8_extract_mock(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_6cymock_8_extract_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_extract_mock", 0);

  /* "cymock.pyx":83
 *     # Autospecced functions will return a FunctionType with "mock" attribute
 *     # which is the actual mock object that needs to be used.
 *     if isinstance(obj, FunctionTypes) and hasattr(obj, 'mock'):             # <<<<<<<<<<<<<<
 *         return obj.mock
 *     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FunctionTypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_mock); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 83, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cymock.pyx":84
 *     # which is the actual mock object that needs to be used.
 *     if isinstance(obj, FunctionTypes) and hasattr(obj, 'mock'):
 *         return obj.mock             # <<<<<<<<<<<<<<
 *     else:
 *         return obj
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":83
 *     # Autospecced functions will return a FunctionType with "mock" attribute
 *     # which is the actual mock object that needs to be used.
 *     if isinstance(obj, FunctionTypes) and hasattr(obj, 'mock'):             # <<<<<<<<<<<<<<
 *         return obj.mock
 *     else:
 */
  }

  /* "cymock.pyx":86
 *         return obj.mock
 *     else:
 *         return obj             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_r = __pyx_v_obj;
    goto __pyx_L0;
  }

  /* "cymock.pyx":80
 * 
 * 
 * def _extract_mock(obj):             # <<<<<<<<<<<<<<
 *     # Autospecced functions will return a FunctionType with "mock" attribute
 *     # which is the actual mock object that needs to be used.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._extract_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":89
 * 
 * 
 * def _get_signature_object(func, as_instance, eat_self):             # <<<<<<<<<<<<<<
 *     """
 *     Given an arbitrary, possibly callable object, try to create a suitable
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_get_signature_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_10_get_signature_object[] = "\n    Given an arbitrary, possibly callable object, try to create a suitable\n    signature object.\n    Return a (reduced func, signature) tuple, or None.\n    ";
static PyMethodDef __pyx_mdef_6cymock_11_get_signature_object = {"_get_signature_object", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_get_signature_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_10_get_signature_object};
static PyObject *__pyx_pw_6cymock_11_get_signature_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_as_instance = 0;
  PyObject *__pyx_v_eat_self = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_signature_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func_2,&__pyx_n_s_as_instance,&__pyx_n_s_eat_self,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_as_instance)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_signature_object", 1, 3, 3, 1); __PYX_ERR(0, 89, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eat_self)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_signature_object", 1, 3, 3, 2); __PYX_ERR(0, 89, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_signature_object") < 0)) __PYX_ERR(0, 89, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_func = values[0];
    __pyx_v_as_instance = values[1];
    __pyx_v_eat_self = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_signature_object", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._get_signature_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_10_get_signature_object(__pyx_self, __pyx_v_func, __pyx_v_as_instance, __pyx_v_eat_self);

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

static PyObject *__pyx_pf_6cymock_10_get_signature_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_as_instance, PyObject *__pyx_v_eat_self) {
  PyObject *__pyx_v_sig_func = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_get_signature_object", 0);
  __Pyx_INCREF(__pyx_v_func);
  __Pyx_INCREF(__pyx_v_eat_self);

  /* "cymock.pyx":95
 *     Return a (reduced func, signature) tuple, or None.
 *     """
 *     if isinstance(func, type) and not as_instance:             # <<<<<<<<<<<<<<
 *         # If it's a type and should be modelled as a type, use __init__.
 *         func = func.__init__
 */
  __pyx_t_2 = PyType_Check(__pyx_v_func); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_as_instance); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 95, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_3) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cymock.pyx":97
 *     if isinstance(func, type) and not as_instance:
 *         # If it's a type and should be modelled as a type, use __init__.
 *         func = func.__init__             # <<<<<<<<<<<<<<
 *         # Skip the `self` argument in __init__
 *         eat_self = True
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":99
 *         func = func.__init__
 *         # Skip the `self` argument in __init__
 *         eat_self = True             # <<<<<<<<<<<<<<
 *     elif not isinstance(func, FunctionTypes):
 *         # If we really want to model an instance of the passed type,
 */
    __Pyx_INCREF(Py_True);
    __Pyx_DECREF_SET(__pyx_v_eat_self, Py_True);

    /* "cymock.pyx":95
 *     Return a (reduced func, signature) tuple, or None.
 *     """
 *     if isinstance(func, type) and not as_instance:             # <<<<<<<<<<<<<<
 *         # If it's a type and should be modelled as a type, use __init__.
 *         func = func.__init__
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":100
 *         # Skip the `self` argument in __init__
 *         eat_self = True
 *     elif not isinstance(func, FunctionTypes):             # <<<<<<<<<<<<<<
 *         # If we really want to model an instance of the passed type,
 *         # __call__ should be looked up, not __init__.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FunctionTypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_func, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":103
 *         # If we really want to model an instance of the passed type,
 *         # __call__ should be looked up, not __init__.
 *         try:             # <<<<<<<<<<<<<<
 *             func = func.__call__
 *         except AttributeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "cymock.pyx":104
 *         # __call__ should be looked up, not __init__.
 *         try:
 *             func = func.__call__             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             return None
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_call); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cymock.pyx":103
 *         # If we really want to model an instance of the passed type,
 *         # __call__ should be looked up, not __init__.
 *         try:             # <<<<<<<<<<<<<<
 *             func = func.__call__
 *         except AttributeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cymock.pyx":105
 *         try:
 *             func = func.__call__
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             return None
 *     if eat_self:
 */
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("cymock._get_signature_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 105, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_10);

        /* "cymock.pyx":106
 *             func = func.__call__
 *         except AttributeError:
 *             return None             # <<<<<<<<<<<<<<
 *     if eat_self:
 *         sig_func = partial(func, None)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L9_except_return;
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "cymock.pyx":103
 *         # If we really want to model an instance of the passed type,
 *         # __call__ should be looked up, not __init__.
 *         try:             # <<<<<<<<<<<<<<
 *             func = func.__call__
 *         except AttributeError:
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L9_except_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
      __pyx_L11_try_end:;
    }

    /* "cymock.pyx":100
 *         # Skip the `self` argument in __init__
 *         eat_self = True
 *     elif not isinstance(func, FunctionTypes):             # <<<<<<<<<<<<<<
 *         # If we really want to model an instance of the passed type,
 *         # __call__ should be looked up, not __init__.
 */
  }
  __pyx_L3:;

  /* "cymock.pyx":107
 *         except AttributeError:
 *             return None
 *     if eat_self:             # <<<<<<<<<<<<<<
 *         sig_func = partial(func, None)
 *     else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_eat_self); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 107, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cymock.pyx":108
 *             return None
 *     if eat_self:
 *         sig_func = partial(func, None)             # <<<<<<<<<<<<<<
 *     else:
 *         sig_func = func
 */
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_partial); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_func, Py_None};
      __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_10);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_func, Py_None};
      __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_10);
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_func);
      __Pyx_GIVEREF(__pyx_v_func);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_v_func);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, Py_None);
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_sig_func = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "cymock.pyx":107
 *         except AttributeError:
 *             return None
 *     if eat_self:             # <<<<<<<<<<<<<<
 *         sig_func = partial(func, None)
 *     else:
 */
    goto __pyx_L14;
  }

  /* "cymock.pyx":110
 *         sig_func = partial(func, None)
 *     else:
 *         sig_func = func             # <<<<<<<<<<<<<<
 *     try:
 *         return func, inspect.signature(sig_func)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_func);
    __pyx_v_sig_func = __pyx_v_func;
  }
  __pyx_L14:;

  /* "cymock.pyx":111
 *     else:
 *         sig_func = func
 *     try:             # <<<<<<<<<<<<<<
 *         return func, inspect.signature(sig_func)
 *     except ValueError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "cymock.pyx":112
 *         sig_func = func
 *     try:
 *         return func, inspect.signature(sig_func)             # <<<<<<<<<<<<<<
 *     except ValueError:
 *         # Certain callable types are not supported by inspect.signature()
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_inspect); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_signature); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 112, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      __pyx_t_10 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_9, __pyx_v_sig_func) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_sig_func);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 112, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 112, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_func);
      __Pyx_GIVEREF(__pyx_v_func);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_func);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_r = __pyx_t_11;
      __pyx_t_11 = 0;
      goto __pyx_L19_try_return;

      /* "cymock.pyx":111
 *     else:
 *         sig_func = func
 *     try:             # <<<<<<<<<<<<<<
 *         return func, inspect.signature(sig_func)
 *     except ValueError:
 */
    }
    __pyx_L15_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "cymock.pyx":113
 *     try:
 *         return func, inspect.signature(sig_func)
 *     except ValueError:             # <<<<<<<<<<<<<<
 *         # Certain callable types are not supported by inspect.signature()
 *         return None
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cymock._get_signature_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0) __PYX_ERR(0, 113, __pyx_L17_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GOTREF(__pyx_t_9);

      /* "cymock.pyx":115
 *     except ValueError:
 *         # Certain callable types are not supported by inspect.signature()
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L18_except_return;
    }
    goto __pyx_L17_except_error;
    __pyx_L17_except_error:;

    /* "cymock.pyx":111
 *     else:
 *         sig_func = func
 *     try:             # <<<<<<<<<<<<<<
 *         return func, inspect.signature(sig_func)
 *     except ValueError:
 */
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L19_try_return:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    goto __pyx_L0;
    __pyx_L18_except_return:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    goto __pyx_L0;
  }

  /* "cymock.pyx":89
 * 
 * 
 * def _get_signature_object(func, as_instance, eat_self):             # <<<<<<<<<<<<<<
 *     """
 *     Given an arbitrary, possibly callable object, try to create a suitable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cymock._get_signature_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sig_func);
  __Pyx_XDECREF(__pyx_v_func);
  __Pyx_XDECREF(__pyx_v_eat_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":118
 * 
 * 
 * def _check_signature(func, mock, skipfirst, instance=False):             # <<<<<<<<<<<<<<
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_13_check_signature(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_13_check_signature = {"_check_signature", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_13_check_signature, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_13_check_signature(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_mock = 0;
  PyObject *__pyx_v_skipfirst = 0;
  PyObject *__pyx_v_instance = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_signature (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func_2,&__pyx_n_s_mock,&__pyx_n_s_skipfirst,&__pyx_n_s_instance,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mock)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_signature", 0, 3, 4, 1); __PYX_ERR(0, 118, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_skipfirst)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_signature", 0, 3, 4, 2); __PYX_ERR(0, 118, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_instance);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_signature") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_func = values[0];
    __pyx_v_mock = values[1];
    __pyx_v_skipfirst = values[2];
    __pyx_v_instance = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_signature", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._check_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_12_check_signature(__pyx_self, __pyx_v_func, __pyx_v_mock, __pyx_v_skipfirst, __pyx_v_instance);

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

/* "cymock.pyx":123
 *         return
 *     func, sig = sig
 *     def checksig(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_16_check_signature_1checksig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_16_check_signature_1checksig = {"checksig", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_16_check_signature_1checksig, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_16_check_signature_1checksig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("checksig (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "checksig") < 0)) __PYX_ERR(0, 123, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("checksig", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 123, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock._check_signature.checksig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_16_check_signature_checksig(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_16_check_signature_checksig(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("checksig", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":124
 *     func, sig = sig
 *     def checksig(self, *args, **kwargs):
 *         sig.bind(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     _copy_func_details(func, checksig)
 *     type(mock)._mock_check_sig = checksig
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_sig)) { __Pyx_RaiseClosureNameError("sig"); __PYX_ERR(0, 124, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_sig, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":123
 *         return
 *     func, sig = sig
 *     def checksig(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 */

  /* 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("cymock._check_signature.checksig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":118
 * 
 * 
 * def _check_signature(func, mock, skipfirst, instance=False):             # <<<<<<<<<<<<<<
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:
 */

static PyObject *__pyx_pf_6cymock_12_check_signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_mock, PyObject *__pyx_v_skipfirst, PyObject *__pyx_v_instance) {
  struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *__pyx_cur_scope;
  PyObject *__pyx_v_checksig = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  __Pyx_RefNannySetupContext("_check_signature", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *)__pyx_tp_new_6cymock___pyx_scope_struct___check_signature(__pyx_ptype_6cymock___pyx_scope_struct___check_signature, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 118, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_func);

  /* "cymock.pyx":119
 * 
 * def _check_signature(func, mock, skipfirst, instance=False):
 *     sig = _get_signature_object(func, instance, skipfirst)             # <<<<<<<<<<<<<<
 *     if sig is None:
 *         return
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_signature_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_func, __pyx_v_instance, __pyx_v_skipfirst};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_func, __pyx_v_instance, __pyx_v_skipfirst};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_func);
    __Pyx_GIVEREF(__pyx_v_func);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_func);
    __Pyx_INCREF(__pyx_v_instance);
    __Pyx_GIVEREF(__pyx_v_instance);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_instance);
    __Pyx_INCREF(__pyx_v_skipfirst);
    __Pyx_GIVEREF(__pyx_v_skipfirst);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_skipfirst);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_sig = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":120
 * def _check_signature(func, mock, skipfirst, instance=False):
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:             # <<<<<<<<<<<<<<
 *         return
 *     func, sig = sig
 */
  __pyx_t_6 = (__pyx_cur_scope->__pyx_v_sig == Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "cymock.pyx":121
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:
 *         return             # <<<<<<<<<<<<<<
 *     func, sig = sig
 *     def checksig(self, *args, **kwargs):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cymock.pyx":120
 * def _check_signature(func, mock, skipfirst, instance=False):
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:             # <<<<<<<<<<<<<<
 *         return
 *     func, sig = sig
 */
  }

  /* "cymock.pyx":122
 *     if sig is None:
 *         return
 *     func, sig = sig             # <<<<<<<<<<<<<<
 *     def checksig(self, *args, **kwargs):
 *         sig.bind(*args, **kwargs)
 */
  if ((likely(PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_sig))) || (PyList_CheckExact(__pyx_cur_scope->__pyx_v_sig))) {
    PyObject* sequence = __pyx_cur_scope->__pyx_v_sig;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 122, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_sig); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_5), 2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 122, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_sig);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_sig, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cymock.pyx":123
 *         return
 *     func, sig = sig
 *     def checksig(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_16_check_signature_1checksig, 0, __pyx_n_s_check_signature_locals_checksig, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_checksig = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":125
 *     def checksig(self, *args, **kwargs):
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)             # <<<<<<<<<<<<<<
 *     type(mock)._mock_check_sig = checksig
 *     type(mock).__signature__ = sig
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy_func_details); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_func, __pyx_v_checksig};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_func, __pyx_v_checksig};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_func);
    __Pyx_GIVEREF(__pyx_v_func);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_func);
    __Pyx_INCREF(__pyx_v_checksig);
    __Pyx_GIVEREF(__pyx_v_checksig);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_checksig);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":126
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 *     type(mock)._mock_check_sig = checksig             # <<<<<<<<<<<<<<
 *     type(mock).__signature__ = sig
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)Py_TYPE(__pyx_v_mock)), __pyx_n_s_mock_check_sig, __pyx_v_checksig) < 0) __PYX_ERR(0, 126, __pyx_L1_error)

  /* "cymock.pyx":127
 *     _copy_func_details(func, checksig)
 *     type(mock)._mock_check_sig = checksig
 *     type(mock).__signature__ = sig             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)Py_TYPE(__pyx_v_mock)), __pyx_n_s_signature_2, __pyx_cur_scope->__pyx_v_sig) < 0) __PYX_ERR(0, 127, __pyx_L1_error)

  /* "cymock.pyx":118
 * 
 * 
 * def _check_signature(func, mock, skipfirst, instance=False):             # <<<<<<<<<<<<<<
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:
 */

  /* 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_5);
  __Pyx_AddTraceback("cymock._check_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_checksig);
  __Pyx_XDECREF(__pyx_v_func);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":130
 * 
 * 
 * def _copy_func_details(func, funcopy):             # <<<<<<<<<<<<<<
 *     # we explicitly don't copy func.__dict__ into this copy as it would
 *     # expose original attributes that should be mocked
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15_copy_func_details(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15_copy_func_details = {"_copy_func_details", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15_copy_func_details, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15_copy_func_details(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_funcopy = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_copy_func_details (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func_2,&__pyx_n_s_funcopy,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_funcopy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_copy_func_details", 1, 2, 2, 1); __PYX_ERR(0, 130, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_copy_func_details") < 0)) __PYX_ERR(0, 130, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_func = values[0];
    __pyx_v_funcopy = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_copy_func_details", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 130, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._copy_func_details", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14_copy_func_details(__pyx_self, __pyx_v_func, __pyx_v_funcopy);

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

static PyObject *__pyx_pf_6cymock_14_copy_func_details(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_funcopy) {
  PyObject *__pyx_v_attribute = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_copy_func_details", 0);

  /* "cymock.pyx":133
 *     # we explicitly don't copy func.__dict__ into this copy as it would
 *     # expose original attributes that should be mocked
 *     for attribute in (             # <<<<<<<<<<<<<<
 *         '__name__', '__doc__', '__text_signature__',
 *         '__module__', '__defaults__', '__kwdefaults__',
 */
  __pyx_t_1 = __pyx_tuple__4; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= 6) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 133, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_attribute, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cymock.pyx":137
 *         '__module__', '__defaults__', '__kwdefaults__',
 *     ):
 *         try:             # <<<<<<<<<<<<<<
 *             setattr(funcopy, attribute, getattr(func, attribute))
 *         except AttributeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "cymock.pyx":138
 *     ):
 *         try:
 *             setattr(funcopy, attribute, getattr(func, attribute))             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             pass
 */
        __pyx_t_3 = __Pyx_GetAttr(__pyx_v_func, __pyx_v_attribute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = PyObject_SetAttr(__pyx_v_funcopy, __pyx_v_attribute, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 138, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "cymock.pyx":137
 *         '__module__', '__defaults__', '__kwdefaults__',
 *     ):
 *         try:             # <<<<<<<<<<<<<<
 *             setattr(funcopy, attribute, getattr(func, attribute))
 *         except AttributeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cymock.pyx":139
 *         try:
 *             setattr(funcopy, attribute, getattr(func, attribute))
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_8) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "cymock.pyx":137
 *         '__module__', '__defaults__', '__kwdefaults__',
 *     ):
 *         try:             # <<<<<<<<<<<<<<
 *             setattr(funcopy, attribute, getattr(func, attribute))
 *         except AttributeError:
 */
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L12_try_end:;
    }

    /* "cymock.pyx":133
 *     # we explicitly don't copy func.__dict__ into this copy as it would
 *     # expose original attributes that should be mocked
 *     for attribute in (             # <<<<<<<<<<<<<<
 *         '__name__', '__doc__', '__text_signature__',
 *         '__module__', '__defaults__', '__kwdefaults__',
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":130
 * 
 * 
 * def _copy_func_details(func, funcopy):             # <<<<<<<<<<<<<<
 *     # we explicitly don't copy func.__dict__ into this copy as it would
 *     # expose original attributes that should be mocked
 */

  /* 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_3);
  __Pyx_AddTraceback("cymock._copy_func_details", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attribute);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":143
 * 
 * 
 * def _callable(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, type):
 *         return True
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_17_callable(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_17_callable = {"_callable", (PyCFunction)__pyx_pw_6cymock_17_callable, METH_O, 0};
static PyObject *__pyx_pw_6cymock_17_callable(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_callable (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_16_callable(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_6cymock_16_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_callable", 0);

  /* "cymock.pyx":144
 * 
 * def _callable(obj):
 *     if isinstance(obj, type):             # <<<<<<<<<<<<<<
 *         return True
 *     if isinstance(obj, (staticmethod, classmethod, MethodType)):
 */
  __pyx_t_1 = PyType_Check(__pyx_v_obj); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":145
 * def _callable(obj):
 *     if isinstance(obj, type):
 *         return True             # <<<<<<<<<<<<<<
 *     if isinstance(obj, (staticmethod, classmethod, MethodType)):
 *         return _callable(obj.__func__)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "cymock.pyx":144
 * 
 * def _callable(obj):
 *     if isinstance(obj, type):             # <<<<<<<<<<<<<<
 *         return True
 *     if isinstance(obj, (staticmethod, classmethod, MethodType)):
 */
  }

  /* "cymock.pyx":146
 *     if isinstance(obj, type):
 *         return True
 *     if isinstance(obj, (staticmethod, classmethod, MethodType)):             # <<<<<<<<<<<<<<
 *         return _callable(obj.__func__)
 *     if getattr(obj, '__call__', None) is not None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MethodType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_builtin_staticmethod); 
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_obj, __pyx_builtin_classmethod); 
  __pyx_t_1 = (__pyx_t_4 != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); 
  __pyx_t_4 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":147
 *         return True
 *     if isinstance(obj, (staticmethod, classmethod, MethodType)):
 *         return _callable(obj.__func__)             # <<<<<<<<<<<<<<
 *     if getattr(obj, '__call__', None) is not None:
 *         return True
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_func); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":146
 *     if isinstance(obj, type):
 *         return True
 *     if isinstance(obj, (staticmethod, classmethod, MethodType)):             # <<<<<<<<<<<<<<
 *         return _callable(obj.__func__)
 *     if getattr(obj, '__call__', None) is not None:
 */
  }

  /* "cymock.pyx":148
 *     if isinstance(obj, (staticmethod, classmethod, MethodType)):
 *         return _callable(obj.__func__)
 *     if getattr(obj, '__call__', None) is not None:             # <<<<<<<<<<<<<<
 *         return True
 *     return False
 */
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_call, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":149
 *         return _callable(obj.__func__)
 *     if getattr(obj, '__call__', None) is not None:
 *         return True             # <<<<<<<<<<<<<<
 *     return False
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "cymock.pyx":148
 *     if isinstance(obj, (staticmethod, classmethod, MethodType)):
 *         return _callable(obj.__func__)
 *     if getattr(obj, '__call__', None) is not None:             # <<<<<<<<<<<<<<
 *         return True
 *     return False
 */
  }

  /* "cymock.pyx":150
 *     if getattr(obj, '__call__', None) is not None:
 *         return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "cymock.pyx":143
 * 
 * 
 * def _callable(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, type):
 *         return True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":153
 * 
 * 
 * def _is_list(obj):             # <<<<<<<<<<<<<<
 *     # checks for list or tuples
 *     # XXXX badly named!
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_19_is_list(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_19_is_list = {"_is_list", (PyCFunction)__pyx_pw_6cymock_19_is_list, METH_O, 0};
static PyObject *__pyx_pw_6cymock_19_is_list(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_list (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_18_is_list(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_6cymock_18_is_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_is_list", 0);

  /* "cymock.pyx":156
 *     # checks for list or tuples
 *     # XXXX badly named!
 *     return type(obj) in (list, tuple)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj)));
  __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_obj));
  __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":153
 * 
 * 
 * def _is_list(obj):             # <<<<<<<<<<<<<<
 *     # checks for list or tuples
 *     # XXXX badly named!
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._is_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":159
 * 
 * 
 * def _instance_callable(obj):             # <<<<<<<<<<<<<<
 *     """Given an object, return True if the object is callable.
 *     For classes, return True if instances would be callable."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_21_instance_callable(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_6cymock_20_instance_callable[] = "Given an object, return True if the object is callable.\n    For classes, return True if instances would be callable.";
static PyMethodDef __pyx_mdef_6cymock_21_instance_callable = {"_instance_callable", (PyCFunction)__pyx_pw_6cymock_21_instance_callable, METH_O, __pyx_doc_6cymock_20_instance_callable};
static PyObject *__pyx_pw_6cymock_21_instance_callable(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_instance_callable (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_20_instance_callable(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_6cymock_20_instance_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_base = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_instance_callable", 0);

  /* "cymock.pyx":162
 *     """Given an object, return True if the object is callable.
 *     For classes, return True if instances would be callable."""
 *     if not isinstance(obj, type):             # <<<<<<<<<<<<<<
 *         # already an instance
 *         return getattr(obj, '__call__', None) is not None
 */
  __pyx_t_1 = PyType_Check(__pyx_v_obj); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":164
 *     if not isinstance(obj, type):
 *         # already an instance
 *         return getattr(obj, '__call__', None) is not None             # <<<<<<<<<<<<<<
 * 
 *     # *could* be broken by a class overriding __mro__ or __dict__ via
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_call, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = (__pyx_t_3 != Py_None);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":162
 *     """Given an object, return True if the object is callable.
 *     For classes, return True if instances would be callable."""
 *     if not isinstance(obj, type):             # <<<<<<<<<<<<<<
 *         # already an instance
 *         return getattr(obj, '__call__', None) is not None
 */
  }

  /* "cymock.pyx":168
 *     # *could* be broken by a class overriding __mro__ or __dict__ via
 *     # a metaclass
 *     for base in (obj,) + obj.__mro__:             # <<<<<<<<<<<<<<
 *         if base.__dict__.get('__call__') is not None:
 *             return True
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_obj);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_mro); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 168, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 168, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cymock.pyx":169
 *     # a metaclass
 *     for base in (obj,) + obj.__mro__:
 *         if base.__dict__.get('__call__') is not None:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_3, __pyx_n_u_call) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_u_call);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = (__pyx_t_5 != Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cymock.pyx":170
 *     for base in (obj,) + obj.__mro__:
 *         if base.__dict__.get('__call__') is not None:
 *             return True             # <<<<<<<<<<<<<<
 *     return False
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "cymock.pyx":169
 *     # a metaclass
 *     for base in (obj,) + obj.__mro__:
 *         if base.__dict__.get('__call__') is not None:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    }

    /* "cymock.pyx":168
 *     # *could* be broken by a class overriding __mro__ or __dict__ via
 *     # a metaclass
 *     for base in (obj,) + obj.__mro__:             # <<<<<<<<<<<<<<
 *         if base.__dict__.get('__call__') is not None:
 *             return True
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cymock.pyx":171
 *         if base.__dict__.get('__call__') is not None:
 *             return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "cymock.pyx":159
 * 
 * 
 * def _instance_callable(obj):             # <<<<<<<<<<<<<<
 *     """Given an object, return True if the object is callable.
 *     For classes, return True if instances would be callable."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock._instance_callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":174
 * 
 * 
 * def _set_signature(mock, original, instance=False):             # <<<<<<<<<<<<<<
 *     # creates a function with signature (*args, **kwargs) that delegates to a
 *     # mock. It still does signature checking by calling a lambda with the same
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_23_set_signature(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_23_set_signature = {"_set_signature", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_23_set_signature, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_23_set_signature(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mock = 0;
  PyObject *__pyx_v_original = 0;
  PyObject *__pyx_v_instance = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_signature (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mock,&__pyx_n_s_original,&__pyx_n_s_instance,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mock)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_original)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set_signature", 0, 2, 3, 1); __PYX_ERR(0, 174, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_instance);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_signature") < 0)) __PYX_ERR(0, 174, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_mock = values[0];
    __pyx_v_original = values[1];
    __pyx_v_instance = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_signature", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._set_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_22_set_signature(__pyx_self, __pyx_v_mock, __pyx_v_original, __pyx_v_instance);

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

/* "cymock.pyx":184
 *         return mock
 *     func, sig = result
 *     def checksig(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14_set_signature_1checksig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_14_set_signature_1checksig = {"checksig", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14_set_signature_1checksig, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_14_set_signature_1checksig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("checksig (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "checksig", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_14_set_signature_checksig(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_14_set_signature_checksig(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("checksig", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":185
 *     func, sig = result
 *     def checksig(*args, **kwargs):
 *         sig.bind(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     _copy_func_details(func, checksig)
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_sig)) { __Pyx_RaiseClosureNameError("sig"); __PYX_ERR(0, 185, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_sig, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":184
 *         return mock
 *     func, sig = result
 *     def checksig(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 */

  /* 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("cymock._set_signature.checksig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":174
 * 
 * 
 * def _set_signature(mock, original, instance=False):             # <<<<<<<<<<<<<<
 *     # creates a function with signature (*args, **kwargs) that delegates to a
 *     # mock. It still does signature checking by calling a lambda with the same
 */

static PyObject *__pyx_pf_6cymock_22_set_signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock, PyObject *__pyx_v_original, PyObject *__pyx_v_instance) {
  struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *__pyx_cur_scope;
  int __pyx_v_skipfirst;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_func = NULL;
  PyObject *__pyx_v_checksig = 0;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_context = NULL;
  PyObject *__pyx_v_src = NULL;
  PyObject *__pyx_v_funcopy = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  __Pyx_RefNannySetupContext("_set_signature", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *)__pyx_tp_new_6cymock___pyx_scope_struct_1__set_signature(__pyx_ptype_6cymock___pyx_scope_struct_1__set_signature, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 174, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "cymock.pyx":179
 *     # signature as the original.
 * 
 *     skipfirst = isinstance(original, type)             # <<<<<<<<<<<<<<
 *     result = _get_signature_object(original, instance, skipfirst)
 *     if result is None:
 */
  __pyx_t_1 = PyType_Check(__pyx_v_original); 
  __pyx_v_skipfirst = __pyx_t_1;

  /* "cymock.pyx":180
 * 
 *     skipfirst = isinstance(original, type)
 *     result = _get_signature_object(original, instance, skipfirst)             # <<<<<<<<<<<<<<
 *     if result is None:
 *         return mock
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_signature_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_skipfirst); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_original, __pyx_v_instance, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_original, __pyx_v_instance, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_original);
    __Pyx_GIVEREF(__pyx_v_original);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_original);
    __Pyx_INCREF(__pyx_v_instance);
    __Pyx_GIVEREF(__pyx_v_instance);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_instance);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":181
 *     skipfirst = isinstance(original, type)
 *     result = _get_signature_object(original, instance, skipfirst)
 *     if result is None:             # <<<<<<<<<<<<<<
 *         return mock
 *     func, sig = result
 */
  __pyx_t_1 = (__pyx_v_result == Py_None);
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (__pyx_t_8) {

    /* "cymock.pyx":182
 *     result = _get_signature_object(original, instance, skipfirst)
 *     if result is None:
 *         return mock             # <<<<<<<<<<<<<<
 *     func, sig = result
 *     def checksig(*args, **kwargs):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_mock);
    __pyx_r = __pyx_v_mock;
    goto __pyx_L0;

    /* "cymock.pyx":181
 *     skipfirst = isinstance(original, type)
 *     result = _get_signature_object(original, instance, skipfirst)
 *     if result is None:             # <<<<<<<<<<<<<<
 *         return mock
 *     func, sig = result
 */
  }

  /* "cymock.pyx":183
 *     if result is None:
 *         return mock
 *     func, sig = result             # <<<<<<<<<<<<<<
 *     def checksig(*args, **kwargs):
 *         sig.bind(*args, **kwargs)
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_result))) || (PyList_CheckExact(__pyx_v_result))) {
    PyObject* sequence = __pyx_v_result;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 183, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 2) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 183, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_func = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_sig = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":184
 *         return mock
 *     func, sig = result
 *     def checksig(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14_set_signature_1checksig, 0, __pyx_n_s_set_signature_locals_checksig, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_checksig = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":186
 *     def checksig(*args, **kwargs):
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)             # <<<<<<<<<<<<<<
 * 
 *     name = original.__name__
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_copy_func_details); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(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_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_func, __pyx_v_checksig};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_func, __pyx_v_checksig};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_func);
    __Pyx_GIVEREF(__pyx_v_func);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_func);
    __Pyx_INCREF(__pyx_v_checksig);
    __Pyx_GIVEREF(__pyx_v_checksig);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_checksig);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":188
 *     _copy_func_details(func, checksig)
 * 
 *     name = original.__name__             # <<<<<<<<<<<<<<
 *     if not name.isidentifier():
 *         name = 'funcopy'
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_original, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_name = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":189
 * 
 *     name = original.__name__
 *     if not name.isidentifier():             # <<<<<<<<<<<<<<
 *         name = 'funcopy'
 *     context = {'_checksig_': checksig, 'mock': mock}
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_isidentifier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = ((!__pyx_t_8) != 0);
  if (__pyx_t_1) {

    /* "cymock.pyx":190
 *     name = original.__name__
 *     if not name.isidentifier():
 *         name = 'funcopy'             # <<<<<<<<<<<<<<
 *     context = {'_checksig_': checksig, 'mock': mock}
 *     src = """def %s(*args, **kwargs):
 */
    __Pyx_INCREF(__pyx_n_u_funcopy);
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_n_u_funcopy);

    /* "cymock.pyx":189
 * 
 *     name = original.__name__
 *     if not name.isidentifier():             # <<<<<<<<<<<<<<
 *         name = 'funcopy'
 *     context = {'_checksig_': checksig, 'mock': mock}
 */
  }

  /* "cymock.pyx":191
 *     if not name.isidentifier():
 *         name = 'funcopy'
 *     context = {'_checksig_': checksig, 'mock': mock}             # <<<<<<<<<<<<<<
 *     src = """def %s(*args, **kwargs):
 *     _checksig_(*args, **kwargs)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_checksig_2, __pyx_v_checksig) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_mock, __pyx_v_mock) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cymock.pyx":194
 *     src = """def %s(*args, **kwargs):
 *     _checksig_(*args, **kwargs)
 *     return mock(*args, **kwargs)""" % name             # <<<<<<<<<<<<<<
 *     exec (src, context)
 *     funcopy = context[name]
 */
  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_def_s_args_kwargs__checksig__arg, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_src = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cymock.pyx":195
 *     _checksig_(*args, **kwargs)
 *     return mock(*args, **kwargs)""" % name
 *     exec (src, context)             # <<<<<<<<<<<<<<
 *     funcopy = context[name]
 *     _setup_func(funcopy, mock, sig)
 */
  __pyx_t_3 = __Pyx_PyExec2(__pyx_v_src, __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":196
 *     return mock(*args, **kwargs)""" % name
 *     exec (src, context)
 *     funcopy = context[name]             # <<<<<<<<<<<<<<
 *     _setup_func(funcopy, mock, sig)
 *     return funcopy
 */
  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_context, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_funcopy = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":197
 *     exec (src, context)
 *     funcopy = context[name]
 *     _setup_func(funcopy, mock, sig)             # <<<<<<<<<<<<<<
 *     return funcopy
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_setup_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_funcopy, __pyx_v_mock, __pyx_cur_scope->__pyx_v_sig};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_funcopy, __pyx_v_mock, __pyx_cur_scope->__pyx_v_sig};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_funcopy);
    __Pyx_GIVEREF(__pyx_v_funcopy);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_funcopy);
    __Pyx_INCREF(__pyx_v_mock);
    __Pyx_GIVEREF(__pyx_v_mock);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_mock);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sig);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_sig);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_cur_scope->__pyx_v_sig);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":198
 *     funcopy = context[name]
 *     _setup_func(funcopy, mock, sig)
 *     return funcopy             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_funcopy);
  __pyx_r = __pyx_v_funcopy;
  goto __pyx_L0;

  /* "cymock.pyx":174
 * 
 * 
 * def _set_signature(mock, original, instance=False):             # <<<<<<<<<<<<<<
 *     # creates a function with signature (*args, **kwargs) that delegates to a
 *     # mock. It still does signature checking by calling a lambda with the same
 */

  /* 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_7);
  __Pyx_AddTraceback("cymock._set_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_func);
  __Pyx_XDECREF(__pyx_v_checksig);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_src);
  __Pyx_XDECREF(__pyx_v_funcopy);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":201
 * 
 * 
 * def _setup_func(funcopy, mock, sig):             # <<<<<<<<<<<<<<
 *     funcopy.mock = mock
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_25_setup_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_25_setup_func = {"_setup_func", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_25_setup_func, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_25_setup_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_funcopy = 0;
  PyObject *__pyx_v_mock = 0;
  PyObject *__pyx_v_sig = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_setup_func (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_funcopy,&__pyx_n_s_mock,&__pyx_n_s_sig,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_funcopy)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mock)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_setup_func", 1, 3, 3, 1); __PYX_ERR(0, 201, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sig)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_setup_func", 1, 3, 3, 2); __PYX_ERR(0, 201, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setup_func") < 0)) __PYX_ERR(0, 201, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_funcopy = values[0];
    __pyx_v_mock = values[1];
    __pyx_v_sig = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_setup_func", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 201, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._setup_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_24_setup_func(__pyx_self, __pyx_v_funcopy, __pyx_v_mock, __pyx_v_sig);

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

/* "cymock.pyx":204
 *     funcopy.mock = mock
 * 
 *     def assert_called_with(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_setup_func_1assert_called_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_setup_func_1assert_called_with = {"assert_called_with", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_setup_func_1assert_called_with, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_setup_func_1assert_called_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_called_with (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_called_with", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_11_setup_func_assert_called_with(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_11_setup_func_assert_called_with(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_called_with", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":205
 * 
 *     def assert_called_with(*args, **kwargs):
 *         return mock.assert_called_with(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     def assert_called(*args, **kwargs):
 *         return mock.assert_called(*args, **kwargs)
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 205, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_assert_called_with); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __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;

  /* "cymock.pyx":204
 *     funcopy.mock = mock
 * 
 *     def assert_called_with(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._setup_func.assert_called_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":206
 *     def assert_called_with(*args, **kwargs):
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_setup_func_3assert_called(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_setup_func_3assert_called = {"assert_called", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_setup_func_3assert_called, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_setup_func_3assert_called(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_called (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_called", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_11_setup_func_2assert_called(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_11_setup_func_2assert_called(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_called", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":207
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):
 *         return mock.assert_called(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     def assert_not_called(*args, **kwargs):
 *         return mock.assert_not_called(*args, **kwargs)
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 207, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_assert_called); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __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;

  /* "cymock.pyx":206
 *     def assert_called_with(*args, **kwargs):
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._setup_func.assert_called", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":208
 *     def assert_called(*args, **kwargs):
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_setup_func_5assert_not_called(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_setup_func_5assert_not_called = {"assert_not_called", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_setup_func_5assert_not_called, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_setup_func_5assert_not_called(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_not_called (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_not_called", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_11_setup_func_4assert_not_called(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_11_setup_func_4assert_not_called(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_not_called", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":209
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):
 *         return mock.assert_not_called(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     def assert_called_once(*args, **kwargs):
 *         return mock.assert_called_once(*args, **kwargs)
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 209, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_assert_not_called); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __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;

  /* "cymock.pyx":208
 *     def assert_called(*args, **kwargs):
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._setup_func.assert_not_called", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":210
 *     def assert_not_called(*args, **kwargs):
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_setup_func_7assert_called_once(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_setup_func_7assert_called_once = {"assert_called_once", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_setup_func_7assert_called_once, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_setup_func_7assert_called_once(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_called_once (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_called_once", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_11_setup_func_6assert_called_once(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_11_setup_func_6assert_called_once(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_called_once", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":211
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):
 *         return mock.assert_called_once(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     def assert_called_once_with(*args, **kwargs):
 *         return mock.assert_called_once_with(*args, **kwargs)
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 211, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_assert_called_once); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __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;

  /* "cymock.pyx":210
 *     def assert_not_called(*args, **kwargs):
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._setup_func.assert_called_once", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":212
 *     def assert_called_once(*args, **kwargs):
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_setup_func_9assert_called_once_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_setup_func_9assert_called_once_with = {"assert_called_once_with", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_setup_func_9assert_called_once_with, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_setup_func_9assert_called_once_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_called_once_with (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_called_once_with", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_11_setup_func_8assert_called_once_with(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_11_setup_func_8assert_called_once_with(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_called_once_with", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":213
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):
 *         return mock.assert_called_once_with(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     def assert_has_calls(*args, **kwargs):
 *         return mock.assert_has_calls(*args, **kwargs)
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 213, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_assert_called_once_with); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __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;

  /* "cymock.pyx":212
 *     def assert_called_once(*args, **kwargs):
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._setup_func.assert_called_once_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":214
 *     def assert_called_once_with(*args, **kwargs):
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_setup_func_11assert_has_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_setup_func_11assert_has_calls = {"assert_has_calls", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_setup_func_11assert_has_calls, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_setup_func_11assert_has_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_has_calls (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_has_calls", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_11_setup_func_10assert_has_calls(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_11_setup_func_10assert_has_calls(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_has_calls", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":215
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):
 *         return mock.assert_has_calls(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     def assert_any_call(*args, **kwargs):
 *         return mock.assert_any_call(*args, **kwargs)
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 215, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_assert_has_calls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __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;

  /* "cymock.pyx":214
 *     def assert_called_once_with(*args, **kwargs):
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._setup_func.assert_has_calls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":216
 *     def assert_has_calls(*args, **kwargs):
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_setup_func_13assert_any_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_setup_func_13assert_any_call = {"assert_any_call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_setup_func_13assert_any_call, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_setup_func_13assert_any_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_any_call (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assert_any_call", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_11_setup_func_12assert_any_call(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_11_setup_func_12assert_any_call(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("assert_any_call", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":217
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):
 *         return mock.assert_any_call(*args, **kwargs)             # <<<<<<<<<<<<<<
 *     def reset_mock():
 *         funcopy.method_calls = _CallList()
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 217, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_assert_any_call); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __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;

  /* "cymock.pyx":216
 *     def assert_has_calls(*args, **kwargs):
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._setup_func.assert_any_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":218
 *     def assert_any_call(*args, **kwargs):
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():             # <<<<<<<<<<<<<<
 *         funcopy.method_calls = _CallList()
 *         funcopy.mock_calls = _CallList()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_setup_func_15reset_mock(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_setup_func_15reset_mock = {"reset_mock", (PyCFunction)__pyx_pw_6cymock_11_setup_func_15reset_mock, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_11_setup_func_15reset_mock(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_mock (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_11_setup_func_14reset_mock(__pyx_self);

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

static PyObject *__pyx_pf_6cymock_11_setup_func_14reset_mock(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_outer_scope;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("reset_mock", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":219
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():
 *         funcopy.method_calls = _CallList()             # <<<<<<<<<<<<<<
 *         funcopy.mock_calls = _CallList()
 *         mock.reset_mock()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_funcopy)) { __Pyx_RaiseClosureNameError("funcopy"); __PYX_ERR(0, 219, __pyx_L1_error) }
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_method_calls, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":220
 *     def reset_mock():
 *         funcopy.method_calls = _CallList()
 *         funcopy.mock_calls = _CallList()             # <<<<<<<<<<<<<<
 *         mock.reset_mock()
 *         ret = funcopy.return_value
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_funcopy)) { __Pyx_RaiseClosureNameError("funcopy"); __PYX_ERR(0, 220, __pyx_L1_error) }
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_mock_calls, __pyx_t_1) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":221
 *         funcopy.method_calls = _CallList()
 *         funcopy.mock_calls = _CallList()
 *         mock.reset_mock()             # <<<<<<<<<<<<<<
 *         ret = funcopy.return_value
 *         if _is_instance_mock(ret) and not ret is mock:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 221, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_reset_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __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;

  /* "cymock.pyx":222
 *         funcopy.mock_calls = _CallList()
 *         mock.reset_mock()
 *         ret = funcopy.return_value             # <<<<<<<<<<<<<<
 *         if _is_instance_mock(ret) and not ret is mock:
 *             ret.reset_mock()
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_funcopy)) { __Pyx_RaiseClosureNameError("funcopy"); __PYX_ERR(0, 222, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":223
 *         mock.reset_mock()
 *         ret = funcopy.return_value
 *         if _is_instance_mock(ret) and not ret is mock:             # <<<<<<<<<<<<<<
 *             ret.reset_mock()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_instance_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_ret) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_ret);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __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, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 223, __pyx_L1_error) }
  __pyx_t_5 = (__pyx_v_ret != __pyx_cur_scope->__pyx_v_mock);
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "cymock.pyx":224
 *         ret = funcopy.return_value
 *         if _is_instance_mock(ret) and not ret is mock:
 *             ret.reset_mock()             # <<<<<<<<<<<<<<
 * 
 *     funcopy.called = False
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ret, __pyx_n_s_reset_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __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;

    /* "cymock.pyx":223
 *         mock.reset_mock()
 *         ret = funcopy.return_value
 *         if _is_instance_mock(ret) and not ret is mock:             # <<<<<<<<<<<<<<
 *             ret.reset_mock()
 * 
 */
  }

  /* "cymock.pyx":218
 *     def assert_any_call(*args, **kwargs):
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():             # <<<<<<<<<<<<<<
 *         funcopy.method_calls = _CallList()
 *         funcopy.mock_calls = _CallList()
 */

  /* 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_AddTraceback("cymock._setup_func.reset_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":201
 * 
 * 
 * def _setup_func(funcopy, mock, sig):             # <<<<<<<<<<<<<<
 *     funcopy.mock = mock
 * 
 */

static PyObject *__pyx_pf_6cymock_24_setup_func(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcopy, PyObject *__pyx_v_mock, PyObject *__pyx_v_sig) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_cur_scope;
  PyObject *__pyx_v_assert_called_with = 0;
  PyObject *__pyx_v_assert_called = 0;
  PyObject *__pyx_v_assert_not_called = 0;
  PyObject *__pyx_v_assert_called_once = 0;
  PyObject *__pyx_v_assert_called_once_with = 0;
  PyObject *__pyx_v_assert_has_calls = 0;
  PyObject *__pyx_v_assert_any_call = 0;
  PyObject *__pyx_v_reset_mock = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_setup_func", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *)__pyx_tp_new_6cymock___pyx_scope_struct_2__setup_func(__pyx_ptype_6cymock___pyx_scope_struct_2__setup_func, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 201, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_funcopy = __pyx_v_funcopy;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_funcopy);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_funcopy);
  __pyx_cur_scope->__pyx_v_mock = __pyx_v_mock;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mock);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_mock);

  /* "cymock.pyx":202
 * 
 * def _setup_func(funcopy, mock, sig):
 *     funcopy.mock = mock             # <<<<<<<<<<<<<<
 * 
 *     def assert_called_with(*args, **kwargs):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_mock, __pyx_cur_scope->__pyx_v_mock) < 0) __PYX_ERR(0, 202, __pyx_L1_error)

  /* "cymock.pyx":204
 *     funcopy.mock = mock
 * 
 *     def assert_called_with(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_setup_func_1assert_called_with, 0, __pyx_n_s_setup_func_locals_assert_called, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_assert_called_with = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":206
 *     def assert_called_with(*args, **kwargs):
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_setup_func_3assert_called, 0, __pyx_n_s_setup_func_locals_assert_called_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_assert_called = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":208
 *     def assert_called(*args, **kwargs):
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_setup_func_5assert_not_called, 0, __pyx_n_s_setup_func_locals_assert_not_ca, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_assert_not_called = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":210
 *     def assert_not_called(*args, **kwargs):
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_setup_func_7assert_called_once, 0, __pyx_n_s_setup_func_locals_assert_called_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_assert_called_once = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":212
 *     def assert_called_once(*args, **kwargs):
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_setup_func_9assert_called_once_with, 0, __pyx_n_s_setup_func_locals_assert_called_4, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_assert_called_once_with = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":214
 *     def assert_called_once_with(*args, **kwargs):
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_setup_func_11assert_has_calls, 0, __pyx_n_s_setup_func_locals_assert_has_ca, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_assert_has_calls = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":216
 *     def assert_has_calls(*args, **kwargs):
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_setup_func_13assert_any_call, 0, __pyx_n_s_setup_func_locals_assert_any_ca, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_assert_any_call = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":218
 *     def assert_any_call(*args, **kwargs):
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():             # <<<<<<<<<<<<<<
 *         funcopy.method_calls = _CallList()
 *         funcopy.mock_calls = _CallList()
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_setup_func_15reset_mock, 0, __pyx_n_s_setup_func_locals_reset_mock, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reset_mock = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":226
 *             ret.reset_mock()
 * 
 *     funcopy.called = False             # <<<<<<<<<<<<<<
 *     funcopy.call_count = 0
 *     funcopy.call_args = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_called, Py_False) < 0) __PYX_ERR(0, 226, __pyx_L1_error)

  /* "cymock.pyx":227
 * 
 *     funcopy.called = False
 *     funcopy.call_count = 0             # <<<<<<<<<<<<<<
 *     funcopy.call_args = None
 *     funcopy.call_args_list = _CallList()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_call_count, __pyx_int_0) < 0) __PYX_ERR(0, 227, __pyx_L1_error)

  /* "cymock.pyx":228
 *     funcopy.called = False
 *     funcopy.call_count = 0
 *     funcopy.call_args = None             # <<<<<<<<<<<<<<
 *     funcopy.call_args_list = _CallList()
 *     funcopy.method_calls = _CallList()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_call_args, Py_None) < 0) __PYX_ERR(0, 228, __pyx_L1_error)

  /* "cymock.pyx":229
 *     funcopy.call_count = 0
 *     funcopy.call_args = None
 *     funcopy.call_args_list = _CallList()             # <<<<<<<<<<<<<<
 *     funcopy.method_calls = _CallList()
 *     funcopy.mock_calls = _CallList()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_call_args_list, __pyx_t_1) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":230
 *     funcopy.call_args = None
 *     funcopy.call_args_list = _CallList()
 *     funcopy.method_calls = _CallList()             # <<<<<<<<<<<<<<
 *     funcopy.mock_calls = _CallList()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_method_calls, __pyx_t_1) < 0) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":231
 *     funcopy.call_args_list = _CallList()
 *     funcopy.method_calls = _CallList()
 *     funcopy.mock_calls = _CallList()             # <<<<<<<<<<<<<<
 * 
 *     funcopy.return_value = mock.return_value
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_mock_calls, __pyx_t_1) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":233
 *     funcopy.mock_calls = _CallList()
 * 
 *     funcopy.return_value = mock.return_value             # <<<<<<<<<<<<<<
 *     funcopy.side_effect = mock.side_effect
 *     funcopy._mock_children = mock._mock_children
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_return_value, __pyx_t_1) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":234
 * 
 *     funcopy.return_value = mock.return_value
 *     funcopy.side_effect = mock.side_effect             # <<<<<<<<<<<<<<
 *     funcopy._mock_children = mock._mock_children
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_side_effect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_side_effect, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":235
 *     funcopy.return_value = mock.return_value
 *     funcopy.side_effect = mock.side_effect
 *     funcopy._mock_children = mock._mock_children             # <<<<<<<<<<<<<<
 * 
 *     funcopy.assert_called_with = assert_called_with
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_mock_children, __pyx_t_1) < 0) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":237
 *     funcopy._mock_children = mock._mock_children
 * 
 *     funcopy.assert_called_with = assert_called_with             # <<<<<<<<<<<<<<
 *     funcopy.assert_called_once_with = assert_called_once_with
 *     funcopy.assert_has_calls = assert_has_calls
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_assert_called_with, __pyx_v_assert_called_with) < 0) __PYX_ERR(0, 237, __pyx_L1_error)

  /* "cymock.pyx":238
 * 
 *     funcopy.assert_called_with = assert_called_with
 *     funcopy.assert_called_once_with = assert_called_once_with             # <<<<<<<<<<<<<<
 *     funcopy.assert_has_calls = assert_has_calls
 *     funcopy.assert_any_call = assert_any_call
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_assert_called_once_with, __pyx_v_assert_called_once_with) < 0) __PYX_ERR(0, 238, __pyx_L1_error)

  /* "cymock.pyx":239
 *     funcopy.assert_called_with = assert_called_with
 *     funcopy.assert_called_once_with = assert_called_once_with
 *     funcopy.assert_has_calls = assert_has_calls             # <<<<<<<<<<<<<<
 *     funcopy.assert_any_call = assert_any_call
 *     funcopy.reset_mock = reset_mock
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_assert_has_calls, __pyx_v_assert_has_calls) < 0) __PYX_ERR(0, 239, __pyx_L1_error)

  /* "cymock.pyx":240
 *     funcopy.assert_called_once_with = assert_called_once_with
 *     funcopy.assert_has_calls = assert_has_calls
 *     funcopy.assert_any_call = assert_any_call             # <<<<<<<<<<<<<<
 *     funcopy.reset_mock = reset_mock
 *     funcopy.assert_called = assert_called
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_assert_any_call, __pyx_v_assert_any_call) < 0) __PYX_ERR(0, 240, __pyx_L1_error)

  /* "cymock.pyx":241
 *     funcopy.assert_has_calls = assert_has_calls
 *     funcopy.assert_any_call = assert_any_call
 *     funcopy.reset_mock = reset_mock             # <<<<<<<<<<<<<<
 *     funcopy.assert_called = assert_called
 *     funcopy.assert_not_called = assert_not_called
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_reset_mock, __pyx_v_reset_mock) < 0) __PYX_ERR(0, 241, __pyx_L1_error)

  /* "cymock.pyx":242
 *     funcopy.assert_any_call = assert_any_call
 *     funcopy.reset_mock = reset_mock
 *     funcopy.assert_called = assert_called             # <<<<<<<<<<<<<<
 *     funcopy.assert_not_called = assert_not_called
 *     funcopy.assert_called_once = assert_called_once
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_assert_called, __pyx_v_assert_called) < 0) __PYX_ERR(0, 242, __pyx_L1_error)

  /* "cymock.pyx":243
 *     funcopy.reset_mock = reset_mock
 *     funcopy.assert_called = assert_called
 *     funcopy.assert_not_called = assert_not_called             # <<<<<<<<<<<<<<
 *     funcopy.assert_called_once = assert_called_once
 *     funcopy.__signature__ = sig
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_assert_not_called, __pyx_v_assert_not_called) < 0) __PYX_ERR(0, 243, __pyx_L1_error)

  /* "cymock.pyx":244
 *     funcopy.assert_called = assert_called
 *     funcopy.assert_not_called = assert_not_called
 *     funcopy.assert_called_once = assert_called_once             # <<<<<<<<<<<<<<
 *     funcopy.__signature__ = sig
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_assert_called_once, __pyx_v_assert_called_once) < 0) __PYX_ERR(0, 244, __pyx_L1_error)

  /* "cymock.pyx":245
 *     funcopy.assert_not_called = assert_not_called
 *     funcopy.assert_called_once = assert_called_once
 *     funcopy.__signature__ = sig             # <<<<<<<<<<<<<<
 * 
 *     mock._mock_delegate = funcopy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_funcopy, __pyx_n_s_signature_2, __pyx_v_sig) < 0) __PYX_ERR(0, 245, __pyx_L1_error)

  /* "cymock.pyx":247
 *     funcopy.__signature__ = sig
 * 
 *     mock._mock_delegate = funcopy             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_mock_delegate, __pyx_cur_scope->__pyx_v_funcopy) < 0) __PYX_ERR(0, 247, __pyx_L1_error)

  /* "cymock.pyx":201
 * 
 * 
 * def _setup_func(funcopy, mock, sig):             # <<<<<<<<<<<<<<
 *     funcopy.mock = mock
 * 
 */

  /* 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_AddTraceback("cymock._setup_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_assert_called_with);
  __Pyx_XDECREF(__pyx_v_assert_called);
  __Pyx_XDECREF(__pyx_v_assert_not_called);
  __Pyx_XDECREF(__pyx_v_assert_called_once);
  __Pyx_XDECREF(__pyx_v_assert_called_once_with);
  __Pyx_XDECREF(__pyx_v_assert_has_calls);
  __Pyx_XDECREF(__pyx_v_assert_any_call);
  __Pyx_XDECREF(__pyx_v_reset_mock);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":250
 * 
 * 
 * def _setup_async_mock(mock):             # <<<<<<<<<<<<<<
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine
 *     mock.await_count = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_27_setup_async_mock(PyObject *__pyx_self, PyObject *__pyx_v_mock); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_27_setup_async_mock = {"_setup_async_mock", (PyCFunction)__pyx_pw_6cymock_27_setup_async_mock, METH_O, 0};
static PyObject *__pyx_pw_6cymock_27_setup_async_mock(PyObject *__pyx_self, PyObject *__pyx_v_mock) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_setup_async_mock (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_26_setup_async_mock(__pyx_self, ((PyObject *)__pyx_v_mock));

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

/* "cymock.pyx":259
 *     # to a function and then the corresponding mock helper function
 *     # is called when the helper is accessed similar to _setup_func.
 *     def wrapper(attr, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return getattr(mock.mock, attr)(*args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_17_setup_async_mock_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_17_setup_async_mock_1wrapper = {"wrapper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_17_setup_async_mock_1wrapper, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_17_setup_async_mock_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_attr = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_attr,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "wrapper") < 0)) __PYX_ERR(0, 259, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_attr = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wrapper", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 259, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock._setup_async_mock.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_17_setup_async_mock_wrapper(__pyx_self, __pyx_v_attr, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_17_setup_async_mock_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_attr, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("wrapper", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":260
 *     # is called when the helper is accessed similar to _setup_func.
 *     def wrapper(attr, *args, **kwargs):
 *         return getattr(mock.mock, attr)(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     for attribute in ('assert_awaited',
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_mock)) { __Pyx_RaiseClosureNameError("mock"); __PYX_ERR(0, 260, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_mock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __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;

  /* "cymock.pyx":259
 *     # to a function and then the corresponding mock helper function
 *     # is called when the helper is accessed similar to _setup_func.
 *     def wrapper(attr, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return getattr(mock.mock, attr)(*args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._setup_async_mock.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":250
 * 
 * 
 * def _setup_async_mock(mock):             # <<<<<<<<<<<<<<
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine
 *     mock.await_count = 0
 */

static PyObject *__pyx_pf_6cymock_26_setup_async_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock) {
  struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *__pyx_cur_scope;
  PyObject *__pyx_v_wrapper = 0;
  PyObject *__pyx_v_attribute = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("_setup_async_mock", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *)__pyx_tp_new_6cymock___pyx_scope_struct_3__setup_async_mock(__pyx_ptype_6cymock___pyx_scope_struct_3__setup_async_mock, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 250, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_mock = __pyx_v_mock;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_mock);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_mock);

  /* "cymock.pyx":251
 * 
 * def _setup_async_mock(mock):
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine             # <<<<<<<<<<<<<<
 *     mock.await_count = 0
 *     mock.await_args = None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_coroutines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_coroutine); 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;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_is_coroutine, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":252
 * def _setup_async_mock(mock):
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine
 *     mock.await_count = 0             # <<<<<<<<<<<<<<
 *     mock.await_args = None
 *     mock.await_args_list = _CallList()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_await_count, __pyx_int_0) < 0) __PYX_ERR(0, 252, __pyx_L1_error)

  /* "cymock.pyx":253
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine
 *     mock.await_count = 0
 *     mock.await_args = None             # <<<<<<<<<<<<<<
 *     mock.await_args_list = _CallList()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_await_args, Py_None) < 0) __PYX_ERR(0, 253, __pyx_L1_error)

  /* "cymock.pyx":254
 *     mock.await_count = 0
 *     mock.await_args = None
 *     mock.await_args_list = _CallList()             # <<<<<<<<<<<<<<
 * 
 *     # Mock is not configured yet so the attributes are set
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_mock, __pyx_n_s_await_args_list, __pyx_t_1) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":259
 *     # to a function and then the corresponding mock helper function
 *     # is called when the helper is accessed similar to _setup_func.
 *     def wrapper(attr, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return getattr(mock.mock, attr)(*args, **kwargs)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_17_setup_async_mock_1wrapper, 0, __pyx_n_s_setup_async_mock_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrapper = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":262
 *         return getattr(mock.mock, attr)(*args, **kwargs)
 * 
 *     for attribute in ('assert_awaited',             # <<<<<<<<<<<<<<
 *                       'assert_awaited_once',
 *                       'assert_awaited_with',
 */
  __pyx_t_1 = __pyx_tuple__25; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= 7) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_attribute, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "cymock.pyx":274
 *         # Use partial(wrapper, attribute) to ensure the attribute is bound
 *         # correctly.
 *         setattr(mock, attribute, partial(wrapper, attribute))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __pyx_cur_scope->__pyx_v_mock;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_partial); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_wrapper, __pyx_v_attribute};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_wrapper, __pyx_v_attribute};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_wrapper);
      __Pyx_GIVEREF(__pyx_v_wrapper);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_wrapper);
      __Pyx_INCREF(__pyx_v_attribute);
      __Pyx_GIVEREF(__pyx_v_attribute);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_attribute);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = PyObject_SetAttr(__pyx_t_2, __pyx_v_attribute, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":262
 *         return getattr(mock.mock, attr)(*args, **kwargs)
 * 
 *     for attribute in ('assert_awaited',             # <<<<<<<<<<<<<<
 *                       'assert_awaited_once',
 *                       'assert_awaited_with',
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":250
 * 
 * 
 * def _setup_async_mock(mock):             # <<<<<<<<<<<<<<
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine
 *     mock.await_count = 0
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock._setup_async_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrapper);
  __Pyx_XDECREF(__pyx_v_attribute);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":277
 * 
 * 
 * def _is_magic(name):             # <<<<<<<<<<<<<<
 *     return '__%s__' % name[2:-2] == name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_29_is_magic(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_29_is_magic = {"_is_magic", (PyCFunction)__pyx_pw_6cymock_29_is_magic, METH_O, 0};
static PyObject *__pyx_pw_6cymock_29_is_magic(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_magic (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_28_is_magic(__pyx_self, ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_6cymock_28_is_magic(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_is_magic", 0);

  /* "cymock.pyx":278
 * 
 * def _is_magic(name):
 *     return '__%s__' % name[2:-2] == name             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_name, 2, -2L, NULL, NULL, &__pyx_slice__26, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_name, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":277
 * 
 * 
 * def _is_magic(name):             # <<<<<<<<<<<<<<
 *     return '__%s__' % name[2:-2] == name
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._is_magic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":283
 * class _SentinelObject(object):
 *     "A unique, named, sentinel object."
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15_SentinelObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15_SentinelObject_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15_SentinelObject_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15_SentinelObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 283, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 283, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 283, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._SentinelObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15_SentinelObject___init__(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_6cymock_15_SentinelObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":284
 *     "A unique, named, sentinel object."
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 284, __pyx_L1_error)

  /* "cymock.pyx":283
 * class _SentinelObject(object):
 *     "A unique, named, sentinel object."
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock._SentinelObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":286
 *         self.name = name
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel.%s' % self.name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15_SentinelObject_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15_SentinelObject_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6cymock_15_SentinelObject_3__repr__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_15_SentinelObject_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15_SentinelObject_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15_SentinelObject_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cymock.pyx":287
 * 
 *     def __repr__(self):
 *         return 'sentinel.%s' % self.name             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_sentinel_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __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;

  /* "cymock.pyx":286
 *         self.name = name
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel.%s' % self.name
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._SentinelObject.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":289
 *         return 'sentinel.%s' % self.name
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel.%s' % self.name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15_SentinelObject_5__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15_SentinelObject_5__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_6cymock_15_SentinelObject_5__reduce__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_15_SentinelObject_5__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15_SentinelObject_4__reduce__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15_SentinelObject_4__reduce__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "cymock.pyx":290
 * 
 *     def __reduce__(self):
 *         return 'sentinel.%s' % self.name             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_sentinel_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __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;

  /* "cymock.pyx":289
 *         return 'sentinel.%s' % self.name
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel.%s' % self.name
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._SentinelObject.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":295
 * class _Sentinel(object):
 *     """Access attributes to return a named object, usable as a sentinel."""
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._sentinels = {}
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_Sentinel_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_Sentinel_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6cymock_9_Sentinel_1__init__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_9_Sentinel_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_9_Sentinel___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_9_Sentinel___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":296
 *     """Access attributes to return a named object, usable as a sentinel."""
 *     def __init__(self):
 *         self._sentinels = {}             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, name):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sentinels, __pyx_t_1) < 0) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":295
 * class _Sentinel(object):
 *     """Access attributes to return a named object, usable as a sentinel."""
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._sentinels = {}
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._Sentinel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":298
 *         self._sentinels = {}
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name == '__bases__':
 *             # Without this help(unittest.mock) raises an exception
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_Sentinel_3__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_Sentinel_3__getattr__ = {"__getattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_9_Sentinel_3__getattr__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_9_Sentinel_3__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 298, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 298, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 298, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._Sentinel.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_9_Sentinel_2__getattr__(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_6cymock_9_Sentinel_2__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "cymock.pyx":299
 * 
 *     def __getattr__(self, name):
 *         if name == '__bases__':             # <<<<<<<<<<<<<<
 *             # Without this help(unittest.mock) raises an exception
 *             raise AttributeError
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_bases, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
  if (unlikely(__pyx_t_1)) {

    /* "cymock.pyx":301
 *         if name == '__bases__':
 *             # Without this help(unittest.mock) raises an exception
 *             raise AttributeError             # <<<<<<<<<<<<<<
 *         return self._sentinels.setdefault(name, _SentinelObject(name))
 * 
 */
    __Pyx_Raise(__pyx_builtin_AttributeError, 0, 0, 0);
    __PYX_ERR(0, 301, __pyx_L1_error)

    /* "cymock.pyx":299
 * 
 *     def __getattr__(self, name):
 *         if name == '__bases__':             # <<<<<<<<<<<<<<
 *             # Without this help(unittest.mock) raises an exception
 *             raise AttributeError
 */
  }

  /* "cymock.pyx":302
 *             # Without this help(unittest.mock) raises an exception
 *             raise AttributeError
 *         return self._sentinels.setdefault(name, _SentinelObject(name))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sentinels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SentinelObject); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":298
 *         self._sentinels = {}
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name == '__bases__':
 *             # Without this help(unittest.mock) raises an exception
 */

  /* 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_AddTraceback("cymock._Sentinel.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":304
 *         return self._sentinels.setdefault(name, _SentinelObject(name))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_Sentinel_5__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_Sentinel_5__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_6cymock_9_Sentinel_5__reduce__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_9_Sentinel_5__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_9_Sentinel_4__reduce__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_9_Sentinel_4__reduce__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "cymock.pyx":305
 * 
 *     def __reduce__(self):
 *         return 'sentinel'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_u_sentinel);
  __pyx_r = __pyx_n_u_sentinel;
  goto __pyx_L0;

  /* "cymock.pyx":304
 *         return self._sentinels.setdefault(name, _SentinelObject(name))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel'
 * 
 */

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

/* "cymock.pyx":322
 * 
 * 
 * def _delegating_property(name):             # <<<<<<<<<<<<<<
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_31_delegating_property(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_31_delegating_property = {"_delegating_property", (PyCFunction)__pyx_pw_6cymock_31_delegating_property, METH_O, 0};
static PyObject *__pyx_pw_6cymock_31_delegating_property(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_delegating_property (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_30_delegating_property(__pyx_self, ((PyObject *)__pyx_v_name));

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

/* "cymock.pyx":325
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 *     def _get(self, name=name, _the_name=_the_name):             # <<<<<<<<<<<<<<
 *         sig = self._mock_delegate
 *         if sig is None:
 */

static PyObject *__pyx_pf_6cymock_90__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_name);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_name);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_name);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__the_name);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__the_name);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__the_name);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_20_delegating_property_1_get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_20_delegating_property_1_get = {"_get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_20_delegating_property_1_get, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_20_delegating_property_1_get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v__the_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name_2,&__pyx_n_s_the_name,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
    values[1] = __pyx_dynamic_args->__pyx_arg_name;
    values[2] = __pyx_dynamic_args->__pyx_arg__the_name;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_the_name);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get") < 0)) __PYX_ERR(0, 325, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v__the_name = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 325, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._delegating_property._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_20_delegating_property__get(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v__the_name);

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

static PyObject *__pyx_pf_6cymock_20_delegating_property__get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v__the_name) {
  PyObject *__pyx_v_sig = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("_get", 0);

  /* "cymock.pyx":326
 *     _the_name = '_mock_' + name
 *     def _get(self, name=name, _the_name=_the_name):
 *         sig = self._mock_delegate             # <<<<<<<<<<<<<<
 *         if sig is None:
 *             return getattr(self, _the_name)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sig = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":327
 *     def _get(self, name=name, _the_name=_the_name):
 *         sig = self._mock_delegate
 *         if sig is None:             # <<<<<<<<<<<<<<
 *             return getattr(self, _the_name)
 *         return getattr(sig, name)
 */
  __pyx_t_2 = (__pyx_v_sig == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":328
 *         sig = self._mock_delegate
 *         if sig is None:
 *             return getattr(self, _the_name)             # <<<<<<<<<<<<<<
 *         return getattr(sig, name)
 *     def _set(self, value, name=name, _the_name=_the_name):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetAttr(__pyx_v_self, __pyx_v__the_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":327
 *     def _get(self, name=name, _the_name=_the_name):
 *         sig = self._mock_delegate
 *         if sig is None:             # <<<<<<<<<<<<<<
 *             return getattr(self, _the_name)
 *         return getattr(sig, name)
 */
  }

  /* "cymock.pyx":329
 *         if sig is None:
 *             return getattr(self, _the_name)
 *         return getattr(sig, name)             # <<<<<<<<<<<<<<
 *     def _set(self, value, name=name, _the_name=_the_name):
 *         sig = self._mock_delegate
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetAttr(__pyx_v_sig, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":325
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 *     def _get(self, name=name, _the_name=_the_name):             # <<<<<<<<<<<<<<
 *         sig = self._mock_delegate
 *         if sig is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._delegating_property._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":330
 *             return getattr(self, _the_name)
 *         return getattr(sig, name)
 *     def _set(self, value, name=name, _the_name=_the_name):             # <<<<<<<<<<<<<<
 *         sig = self._mock_delegate
 *         if sig is None:
 */

static PyObject *__pyx_pf_6cymock_92__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_name);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_name);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_name);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__the_name);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__the_name);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__the_name);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_20_delegating_property_3_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_20_delegating_property_3_set = {"_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_20_delegating_property_3_set, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_20_delegating_property_3_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v__the_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,&__pyx_n_s_name_2,&__pyx_n_s_the_name,0};
    PyObject* values[4] = {0,0,0,0};
    __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_name;
    values[3] = __pyx_dynamic_args->__pyx_arg__the_name;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set", 0, 2, 4, 1); __PYX_ERR(0, 330, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_the_name);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set") < 0)) __PYX_ERR(0, 330, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
    __pyx_v_name = values[2];
    __pyx_v__the_name = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 330, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._delegating_property._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_20_delegating_property_2_set(__pyx_self, __pyx_v_self, __pyx_v_value, __pyx_v_name, __pyx_v__the_name);

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

static PyObject *__pyx_pf_6cymock_20_delegating_property_2_set(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_name, PyObject *__pyx_v__the_name) {
  PyObject *__pyx_v_sig = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_set", 0);

  /* "cymock.pyx":331
 *         return getattr(sig, name)
 *     def _set(self, value, name=name, _the_name=_the_name):
 *         sig = self._mock_delegate             # <<<<<<<<<<<<<<
 *         if sig is None:
 *             self.__dict__[_the_name] = value
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sig = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":332
 *     def _set(self, value, name=name, _the_name=_the_name):
 *         sig = self._mock_delegate
 *         if sig is None:             # <<<<<<<<<<<<<<
 *             self.__dict__[_the_name] = value
 *         else:
 */
  __pyx_t_2 = (__pyx_v_sig == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":333
 *         sig = self._mock_delegate
 *         if sig is None:
 *             self.__dict__[_the_name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             setattr(sig, name, value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v__the_name, __pyx_v_value) < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":332
 *     def _set(self, value, name=name, _the_name=_the_name):
 *         sig = self._mock_delegate
 *         if sig is None:             # <<<<<<<<<<<<<<
 *             self.__dict__[_the_name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":335
 *             self.__dict__[_the_name] = value
 *         else:
 *             setattr(sig, name, value)             # <<<<<<<<<<<<<<
 * 
 *     return property(_get, _set)
 */
  /*else*/ {
    __pyx_t_4 = PyObject_SetAttr(__pyx_v_sig, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 335, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cymock.pyx":330
 *             return getattr(self, _the_name)
 *         return getattr(sig, name)
 *     def _set(self, value, name=name, _the_name=_the_name):             # <<<<<<<<<<<<<<
 *         sig = self._mock_delegate
 *         if sig is None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._delegating_property._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":322
 * 
 * 
 * def _delegating_property(name):             # <<<<<<<<<<<<<<
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 */

static PyObject *__pyx_pf_6cymock_30_delegating_property(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v__the_name = NULL;
  PyObject *__pyx_v__get = 0;
  PyObject *__pyx_v__set = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_delegating_property", 0);

  /* "cymock.pyx":323
 * 
 * def _delegating_property(name):
 *     _allowed_names.add(name)             # <<<<<<<<<<<<<<
 *     _the_name = '_mock_' + name
 *     def _get(self, name=name, _the_name=_the_name):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_allowed_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":324
 * def _delegating_property(name):
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name             # <<<<<<<<<<<<<<
 *     def _get(self, name=name, _the_name=_the_name):
 *         sig = self._mock_delegate
 */
  __pyx_t_1 = PyNumber_Add(__pyx_n_u_mock_2, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__the_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":325
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 *     def _get(self, name=name, _the_name=_the_name):             # <<<<<<<<<<<<<<
 *         sig = self._mock_delegate
 *         if sig is None:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_20_delegating_property_1_get, 0, __pyx_n_s_delegating_property_locals__get, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 2)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_name = __pyx_v_name;
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_INCREF(__pyx_v__the_name);
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg__the_name = __pyx_v__the_name;
  __Pyx_GIVEREF(__pyx_v__the_name);
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_6cymock_90__defaults__);
  __pyx_v__get = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":330
 *             return getattr(self, _the_name)
 *         return getattr(sig, name)
 *     def _set(self, value, name=name, _the_name=_the_name):             # <<<<<<<<<<<<<<
 *         sig = self._mock_delegate
 *         if sig is None:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_20_delegating_property_3_set, 0, __pyx_n_s_delegating_property_locals__set, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults3), 2)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg_name = __pyx_v_name;
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_INCREF(__pyx_v__the_name);
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_1)->__pyx_arg__the_name = __pyx_v__the_name;
  __Pyx_GIVEREF(__pyx_v__the_name);
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_6cymock_92__defaults__);
  __pyx_v__set = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":337
 *             setattr(sig, name, value)
 * 
 *     return property(_get, _set)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v__get);
  __Pyx_GIVEREF(__pyx_v__get);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__get);
  __Pyx_INCREF(__pyx_v__set);
  __Pyx_GIVEREF(__pyx_v__set);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v__set);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":322
 * 
 * 
 * def _delegating_property(name):             # <<<<<<<<<<<<<<
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._delegating_property", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__the_name);
  __Pyx_XDECREF(__pyx_v__get);
  __Pyx_XDECREF(__pyx_v__set);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":343
 * class _CallList(list):
 * 
 *     def __contains__(self, value):             # <<<<<<<<<<<<<<
 *         if not isinstance(value, list):
 *             return list.__contains__(self, value)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_CallList_1__contains__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_CallList_1__contains__ = {"__contains__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_9_CallList_1__contains__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_9_CallList_1__contains__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 343, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__contains__") < 0)) __PYX_ERR(0, 343, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._CallList.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_9_CallList___contains__(__pyx_self, __pyx_v_self, __pyx_v_value);

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

static PyObject *__pyx_pf_6cymock_9_CallList___contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_len_value = NULL;
  PyObject *__pyx_v_len_self = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_sub_list = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__contains__", 0);

  /* "cymock.pyx":344
 * 
 *     def __contains__(self, value):
 *         if not isinstance(value, list):             # <<<<<<<<<<<<<<
 *             return list.__contains__(self, value)
 *         len_value = len(value)
 */
  __pyx_t_1 = PyList_Check(__pyx_v_value); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":345
 *     def __contains__(self, value):
 *         if not isinstance(value, list):
 *             return list.__contains__(self, value)             # <<<<<<<<<<<<<<
 *         len_value = len(value)
 *         len_self = len(self)
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_self == Py_None)) {
      PyErr_Format(PyExc_TypeError, "descriptor '%s' requires a '%s' object but received a 'NoneType'", "__contains__", "list");
      __PYX_ERR(0, 345, __pyx_L1_error)
    }
    if (!(likely(PyList_Check(__pyx_v_self))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_self)->tp_name), 0))) __PYX_ERR(0, 345, __pyx_L1_error)
    __pyx_t_2 = PySequence_Contains(((PyObject*)__pyx_v_self), __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":344
 * 
 *     def __contains__(self, value):
 *         if not isinstance(value, list):             # <<<<<<<<<<<<<<
 *             return list.__contains__(self, value)
 *         len_value = len(value)
 */
  }

  /* "cymock.pyx":346
 *         if not isinstance(value, list):
 *             return list.__contains__(self, value)
 *         len_value = len(value)             # <<<<<<<<<<<<<<
 *         len_self = len(self)
 *         if len_value > len_self:
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 346, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_len_value = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":347
 *             return list.__contains__(self, value)
 *         len_value = len(value)
 *         len_self = len(self)             # <<<<<<<<<<<<<<
 *         if len_value > len_self:
 *             return False
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 347, __pyx_L1_error)
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_len_self = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":348
 *         len_value = len(value)
 *         len_self = len(self)
 *         if len_value > len_self:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_len_value, __pyx_v_len_self, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cymock.pyx":349
 *         len_self = len(self)
 *         if len_value > len_self:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         for i in range(0, len_self - len_value + 1):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cymock.pyx":348
 *         len_value = len(value)
 *         len_self = len(self)
 *         if len_value > len_self:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "cymock.pyx":351
 *             return False
 * 
 *         for i in range(0, len_self - len_value + 1):             # <<<<<<<<<<<<<<
 *             sub_list = self[i:i+len_value]
 *             if sub_list == value:
 */
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_len_self, __pyx_v_len_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 351, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cymock.pyx":352
 * 
 *         for i in range(0, len_self - len_value + 1):
 *             sub_list = self[i:i+len_value]             # <<<<<<<<<<<<<<
 *             if sub_list == value:
 *                 return True
 */
    __pyx_t_5 = PyNumber_Add(__pyx_v_i, __pyx_v_len_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_self, 0, 0, &__pyx_v_i, &__pyx_t_5, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sub_list, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cymock.pyx":353
 *         for i in range(0, len_self - len_value + 1):
 *             sub_list = self[i:i+len_value]
 *             if sub_list == value:             # <<<<<<<<<<<<<<
 *                 return True
 *         return False
 */
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_sub_list, __pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 353, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "cymock.pyx":354
 *             sub_list = self[i:i+len_value]
 *             if sub_list == value:
 *                 return True             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cymock.pyx":353
 *         for i in range(0, len_self - len_value + 1):
 *             sub_list = self[i:i+len_value]
 *             if sub_list == value:             # <<<<<<<<<<<<<<
 *                 return True
 *         return False
 */
    }

    /* "cymock.pyx":351
 *             return False
 * 
 *         for i in range(0, len_self - len_value + 1):             # <<<<<<<<<<<<<<
 *             sub_list = self[i:i+len_value]
 *             if sub_list == value:
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":355
 *             if sub_list == value:
 *                 return True
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "cymock.pyx":343
 * class _CallList(list):
 * 
 *     def __contains__(self, value):             # <<<<<<<<<<<<<<
 *         if not isinstance(value, list):
 *             return list.__contains__(self, value)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._CallList.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_len_value);
  __Pyx_XDECREF(__pyx_v_len_self);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_sub_list);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":357
 *         return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return pprint.pformat(list(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_CallList_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_CallList_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6cymock_9_CallList_3__repr__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_9_CallList_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_9_CallList_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_9_CallList_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cymock.pyx":358
 * 
 *     def __repr__(self):
 *         return pprint.pformat(list(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pprint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_List(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":357
 *         return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return pprint.pformat(list(self))
 * 
 */

  /* 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("cymock._CallList.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":361
 * 
 * 
 * def _check_and_set_parent(parent, value, name, new_name):             # <<<<<<<<<<<<<<
 *     value = _extract_mock(value)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_33_check_and_set_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_33_check_and_set_parent = {"_check_and_set_parent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_33_check_and_set_parent, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_33_check_and_set_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_new_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_and_set_parent (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parent,&__pyx_n_s_value,&__pyx_n_s_name_2,&__pyx_n_s_new_name,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_and_set_parent", 1, 4, 4, 1); __PYX_ERR(0, 361, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_and_set_parent", 1, 4, 4, 2); __PYX_ERR(0, 361, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_and_set_parent", 1, 4, 4, 3); __PYX_ERR(0, 361, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_and_set_parent") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_parent = values[0];
    __pyx_v_value = values[1];
    __pyx_v_name = values[2];
    __pyx_v_new_name = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_and_set_parent", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._check_and_set_parent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_32_check_and_set_parent(__pyx_self, __pyx_v_parent, __pyx_v_value, __pyx_v_name, __pyx_v_new_name);

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

static PyObject *__pyx_pf_6cymock_32_check_and_set_parent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_value, PyObject *__pyx_v_name, PyObject *__pyx_v_new_name) {
  PyObject *__pyx_v__parent = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("_check_and_set_parent", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "cymock.pyx":362
 * 
 * def _check_and_set_parent(parent, value, name, new_name):
 *     value = _extract_mock(value)             # <<<<<<<<<<<<<<
 * 
 *     if not _is_instance_mock(value):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_extract_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":364
 *     value = _extract_mock(value)
 * 
 *     if not _is_instance_mock(value):             # <<<<<<<<<<<<<<
 *         return False
 *     if ((value._mock_name or value._mock_new_name) or
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_instance_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":365
 * 
 *     if not _is_instance_mock(value):
 *         return False             # <<<<<<<<<<<<<<
 *     if ((value._mock_name or value._mock_new_name) or
 *         (value._mock_parent is not None) or
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cymock.pyx":364
 *     value = _extract_mock(value)
 * 
 *     if not _is_instance_mock(value):             # <<<<<<<<<<<<<<
 *         return False
 *     if ((value._mock_name or value._mock_new_name) or
 */
  }

  /* "cymock.pyx":366
 *     if not _is_instance_mock(value):
 *         return False
 *     if ((value._mock_name or value._mock_new_name) or             # <<<<<<<<<<<<<<
 *         (value._mock_parent is not None) or
 *         (value._mock_new_parent is not None)):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_mock_new_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cymock.pyx":367
 *         return False
 *     if ((value._mock_name or value._mock_new_name) or
 *         (value._mock_parent is not None) or             # <<<<<<<<<<<<<<
 *         (value._mock_new_parent is not None)):
 *         return False
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_mock_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __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;
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cymock.pyx":368
 *     if ((value._mock_name or value._mock_new_name) or
 *         (value._mock_parent is not None) or
 *         (value._mock_new_parent is not None)):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_mock_new_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_6 != 0);
  __pyx_t_5 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;

  /* "cymock.pyx":366
 *     if not _is_instance_mock(value):
 *         return False
 *     if ((value._mock_name or value._mock_new_name) or             # <<<<<<<<<<<<<<
 *         (value._mock_parent is not None) or
 *         (value._mock_new_parent is not None)):
 */
  if (__pyx_t_5) {

    /* "cymock.pyx":369
 *         (value._mock_parent is not None) or
 *         (value._mock_new_parent is not None)):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     _parent = parent
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cymock.pyx":366
 *     if not _is_instance_mock(value):
 *         return False
 *     if ((value._mock_name or value._mock_new_name) or             # <<<<<<<<<<<<<<
 *         (value._mock_parent is not None) or
 *         (value._mock_new_parent is not None)):
 */
  }

  /* "cymock.pyx":371
 *         return False
 * 
 *     _parent = parent             # <<<<<<<<<<<<<<
 *     while _parent is not None:
 *         # setting a mock (value) as a child or return value of itself
 */
  __Pyx_INCREF(__pyx_v_parent);
  __pyx_v__parent = __pyx_v_parent;

  /* "cymock.pyx":372
 * 
 *     _parent = parent
 *     while _parent is not None:             # <<<<<<<<<<<<<<
 *         # setting a mock (value) as a child or return value of itself
 *         # should not modify the mock
 */
  while (1) {
    __pyx_t_5 = (__pyx_v__parent != Py_None);
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (!__pyx_t_4) break;

    /* "cymock.pyx":375
 *         # setting a mock (value) as a child or return value of itself
 *         # should not modify the mock
 *         if _parent is value:             # <<<<<<<<<<<<<<
 *             return False
 *         _parent = _parent._mock_new_parent
 */
    __pyx_t_4 = (__pyx_v__parent == __pyx_v_value);
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "cymock.pyx":376
 *         # should not modify the mock
 *         if _parent is value:
 *             return False             # <<<<<<<<<<<<<<
 *         _parent = _parent._mock_new_parent
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "cymock.pyx":375
 *         # setting a mock (value) as a child or return value of itself
 *         # should not modify the mock
 *         if _parent is value:             # <<<<<<<<<<<<<<
 *             return False
 *         _parent = _parent._mock_new_parent
 */
    }

    /* "cymock.pyx":377
 *         if _parent is value:
 *             return False
 *         _parent = _parent._mock_new_parent             # <<<<<<<<<<<<<<
 * 
 *     if new_name:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__parent, __pyx_n_s_mock_new_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v__parent, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "cymock.pyx":379
 *         _parent = _parent._mock_new_parent
 * 
 *     if new_name:             # <<<<<<<<<<<<<<
 *         value._mock_new_parent = parent
 *         value._mock_new_name = new_name
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_new_name); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 379, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "cymock.pyx":380
 * 
 *     if new_name:
 *         value._mock_new_parent = parent             # <<<<<<<<<<<<<<
 *         value._mock_new_name = new_name
 *     if name:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_value, __pyx_n_s_mock_new_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 380, __pyx_L1_error)

    /* "cymock.pyx":381
 *     if new_name:
 *         value._mock_new_parent = parent
 *         value._mock_new_name = new_name             # <<<<<<<<<<<<<<
 *     if name:
 *         value._mock_parent = parent
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_value, __pyx_n_s_mock_new_name, __pyx_v_new_name) < 0) __PYX_ERR(0, 381, __pyx_L1_error)

    /* "cymock.pyx":379
 *         _parent = _parent._mock_new_parent
 * 
 *     if new_name:             # <<<<<<<<<<<<<<
 *         value._mock_new_parent = parent
 *         value._mock_new_name = new_name
 */
  }

  /* "cymock.pyx":382
 *         value._mock_new_parent = parent
 *         value._mock_new_name = new_name
 *     if name:             # <<<<<<<<<<<<<<
 *         value._mock_parent = parent
 *         value._mock_name = name
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "cymock.pyx":383
 *         value._mock_new_name = new_name
 *     if name:
 *         value._mock_parent = parent             # <<<<<<<<<<<<<<
 *         value._mock_name = name
 *     return True
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_value, __pyx_n_s_mock_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 383, __pyx_L1_error)

    /* "cymock.pyx":384
 *     if name:
 *         value._mock_parent = parent
 *         value._mock_name = name             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_value, __pyx_n_s_mock_name, __pyx_v_name) < 0) __PYX_ERR(0, 384, __pyx_L1_error)

    /* "cymock.pyx":382
 *         value._mock_new_parent = parent
 *         value._mock_new_name = new_name
 *     if name:             # <<<<<<<<<<<<<<
 *         value._mock_parent = parent
 *         value._mock_name = name
 */
  }

  /* "cymock.pyx":385
 *         value._mock_parent = parent
 *         value._mock_name = name
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # Internal class to identify if we wrapped an iterator object or not.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "cymock.pyx":361
 * 
 * 
 * def _check_and_set_parent(parent, value, name, new_name):             # <<<<<<<<<<<<<<
 *     value = _extract_mock(value)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._check_and_set_parent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__parent);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":389
 * # Internal class to identify if we wrapped an iterator object or not.
 * class _MockIter(object):
 *     def __init__(self, obj):             # <<<<<<<<<<<<<<
 *         self.obj = iter(obj)
 *     def __next__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_MockIter_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_MockIter_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_9_MockIter_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_9_MockIter_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_obj,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 389, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 389, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_obj = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._MockIter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_9_MockIter___init__(__pyx_self, __pyx_v_self, __pyx_v_obj);

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

static PyObject *__pyx_pf_6cymock_9_MockIter___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":390
 * class _MockIter(object):
 *     def __init__(self, obj):
 *         self.obj = iter(obj)             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         return next(self.obj)
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_obj, __pyx_t_1) < 0) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":389
 * # Internal class to identify if we wrapped an iterator object or not.
 * class _MockIter(object):
 *     def __init__(self, obj):             # <<<<<<<<<<<<<<
 *         self.obj = iter(obj)
 *     def __next__(self):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._MockIter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":391
 *     def __init__(self, obj):
 *         self.obj = iter(obj)
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return next(self.obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_MockIter_3__next__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_MockIter_3__next__ = {"__next__", (PyCFunction)__pyx_pw_6cymock_9_MockIter_3__next__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_9_MockIter_3__next__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_9_MockIter_2__next__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_9_MockIter_2__next__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cymock.pyx":392
 *         self.obj = iter(obj)
 *     def __next__(self):
 *         return next(self.obj)             # <<<<<<<<<<<<<<
 * 
 * class Base(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __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;

  /* "cymock.pyx":391
 *     def __init__(self, obj):
 *         self.obj = iter(obj)
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return next(self.obj)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._MockIter.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":397
 *     _mock_return_value = DEFAULT
 *     _mock_side_effect = None
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_4Base_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_4Base_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_4Base_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_4Base_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 397, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_4Base___init__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_4Base___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":405
 *     """A non-callable version of `Mock`"""
 * 
 *     def __new__(cls, *args, **kw):             # <<<<<<<<<<<<<<
 *         # every instance has its own class
 *         # so we can create magic methods on the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_1__new__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__new__") < 0)) __PYX_ERR(0, 405, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_cls = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 405, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("cymock.NonCallableMock.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock___new__(__pyx_self, __pyx_v_cls, __pyx_v_args, __pyx_v_kw);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_bases = NULL;
  PyObject *__pyx_v_sig = NULL;
  PyObject *__pyx_v_bound_args = NULL;
  PyObject *__pyx_v_spec_arg = NULL;
  PyTypeObject *__pyx_v_new = NULL;
  PyObject *__pyx_v_instance = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_arg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("__new__", 0);

  /* "cymock.pyx":409
 *         # so we can create magic methods on the
 *         # class without stomping on other mocks
 *         bases = (cls,)             # <<<<<<<<<<<<<<
 *         if not issubclass(cls, AsyncMock):
 *             # Check if spec is an async object or function
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_cls);
  __Pyx_GIVEREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cls);
  __pyx_v_bases = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":410
 *         # class without stomping on other mocks
 *         bases = (cls,)
 *         if not issubclass(cls, AsyncMock):             # <<<<<<<<<<<<<<
 *             # Check if spec is an async object or function
 *             sig = inspect.signature(NonCallableMock.__init__)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_cls, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":412
 *         if not issubclass(cls, AsyncMock):
 *             # Check if spec is an async object or function
 *             sig = inspect.signature(NonCallableMock.__init__)             # <<<<<<<<<<<<<<
 *             bound_args = sig.bind_partial(cls, *args, **kw).arguments
 *             spec_arg = [
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_inspect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_signature); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_sig = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":413
 *             # Check if spec is an async object or function
 *             sig = inspect.signature(NonCallableMock.__init__)
 *             bound_args = sig.bind_partial(cls, *args, **kw).arguments             # <<<<<<<<<<<<<<
 *             spec_arg = [
 *                 arg for arg in bound_args.keys()
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_bind_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_cls);
    __Pyx_GIVEREF(__pyx_v_cls);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cls);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arguments); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_bound_args = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cymock.pyx":414
 *             sig = inspect.signature(NonCallableMock.__init__)
 *             bound_args = sig.bind_partial(cls, *args, **kw).arguments
 *             spec_arg = [             # <<<<<<<<<<<<<<
 *                 arg for arg in bound_args.keys()
 *                 if arg.startswith('spec')
 */
    { /* enter inner scope */
      __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "cymock.pyx":415
 *             bound_args = sig.bind_partial(cls, *args, **kw).arguments
 *             spec_arg = [
 *                 arg for arg in bound_args.keys()             # <<<<<<<<<<<<<<
 *                 if arg.startswith('spec')
 *             ]
 */
      __pyx_t_7 = 0;
      if (unlikely(__pyx_v_bound_args == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
        __PYX_ERR(0, 415, __pyx_L6_error)
      }
      __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_bound_args, 0, __pyx_n_s_keys, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_5);
      __pyx_t_5 = __pyx_t_1;
      __pyx_t_1 = 0;
      while (1) {
        __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_8, &__pyx_t_7, &__pyx_t_1, NULL, NULL, __pyx_t_9);
        if (unlikely(__pyx_t_10 == 0)) break;
        if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 415, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_arg, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "cymock.pyx":416
 *             spec_arg = [
 *                 arg for arg in bound_args.keys()
 *                 if arg.startswith('spec')             # <<<<<<<<<<<<<<
 *             ]
 *             if spec_arg:
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_arg, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, __pyx_n_u_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_spec);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 416, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_3) {

          /* "cymock.pyx":415
 *             bound_args = sig.bind_partial(cls, *args, **kw).arguments
 *             spec_arg = [
 *                 arg for arg in bound_args.keys()             # <<<<<<<<<<<<<<
 *                 if arg.startswith('spec')
 *             ]
 */
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_8genexpr1__pyx_v_arg))) __PYX_ERR(0, 414, __pyx_L6_error)

          /* "cymock.pyx":416
 *             spec_arg = [
 *                 arg for arg in bound_args.keys()
 *                 if arg.startswith('spec')             # <<<<<<<<<<<<<<
 *             ]
 *             if spec_arg:
 */
        }
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_arg); __pyx_8genexpr1__pyx_v_arg = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_arg); __pyx_8genexpr1__pyx_v_arg = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __pyx_v_spec_arg = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cymock.pyx":418
 *                 if arg.startswith('spec')
 *             ]
 *             if spec_arg:             # <<<<<<<<<<<<<<
 *                 # what if spec_set is different than spec?
 *                 if _is_async_obj(bound_args[spec_arg[0]]):
 */
    __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_spec_arg) != 0);
    if (__pyx_t_3) {

      /* "cymock.pyx":420
 *             if spec_arg:
 *                 # what if spec_set is different than spec?
 *                 if _is_async_obj(bound_args[spec_arg[0]]):             # <<<<<<<<<<<<<<
 *                     bases = (AsyncMockMixin, cls,)
 *         new = type(cls.__name__, bases, {'__doc__': cls.__doc__})
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_async_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_spec_arg, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_bound_args, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_3) {

        /* "cymock.pyx":421
 *                 # what if spec_set is different than spec?
 *                 if _is_async_obj(bound_args[spec_arg[0]]):
 *                     bases = (AsyncMockMixin, cls,)             # <<<<<<<<<<<<<<
 *         new = type(cls.__name__, bases, {'__doc__': cls.__doc__})
 *         instance = _safe_super(NonCallableMock, cls).__new__(new)
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_AsyncMockMixin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
        __Pyx_INCREF(__pyx_v_cls);
        __Pyx_GIVEREF(__pyx_v_cls);
        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_cls);
        __pyx_t_6 = 0;
        __Pyx_DECREF_SET(__pyx_v_bases, ((PyObject*)__pyx_t_5));
        __pyx_t_5 = 0;

        /* "cymock.pyx":420
 *             if spec_arg:
 *                 # what if spec_set is different than spec?
 *                 if _is_async_obj(bound_args[spec_arg[0]]):             # <<<<<<<<<<<<<<
 *                     bases = (AsyncMockMixin, cls,)
 *         new = type(cls.__name__, bases, {'__doc__': cls.__doc__})
 */
      }

      /* "cymock.pyx":418
 *                 if arg.startswith('spec')
 *             ]
 *             if spec_arg:             # <<<<<<<<<<<<<<
 *                 # what if spec_set is different than spec?
 *                 if _is_async_obj(bound_args[spec_arg[0]]):
 */
    }

    /* "cymock.pyx":410
 *         # class without stomping on other mocks
 *         bases = (cls,)
 *         if not issubclass(cls, AsyncMock):             # <<<<<<<<<<<<<<
 *             # Check if spec is an async object or function
 *             sig = inspect.signature(NonCallableMock.__init__)
 */
  }

  /* "cymock.pyx":422
 *                 if _is_async_obj(bound_args[spec_arg[0]]):
 *                     bases = (AsyncMockMixin, cls,)
 *         new = type(cls.__name__, bases, {'__doc__': cls.__doc__})             # <<<<<<<<<<<<<<
 *         instance = _safe_super(NonCallableMock, cls).__new__(new)
 *         return instance
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_doc, __pyx_t_4) < 0) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_bases);
  __Pyx_GIVEREF(__pyx_v_bases);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_bases);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyType_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_new = ((PyTypeObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "cymock.pyx":423
 *                     bases = (AsyncMockMixin, cls,)
 *         new = type(cls.__name__, bases, {'__doc__': cls.__doc__})
 *         instance = _safe_super(NonCallableMock, cls).__new__(new)             # <<<<<<<<<<<<<<
 *         return instance
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_super); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_v_cls};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_v_cls};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  {
    __pyx_t_12 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_11) {
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_9, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_cls);
    __Pyx_GIVEREF(__pyx_v_cls);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_9, __pyx_v_cls);
    __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_new)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_new));
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_instance = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "cymock.pyx":424
 *         new = type(cls.__name__, bases, {'__doc__': cls.__doc__})
 *         instance = _safe_super(NonCallableMock, cls).__new__(new)
 *         return instance             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_instance);
  __pyx_r = __pyx_v_instance;
  goto __pyx_L0;

  /* "cymock.pyx":405
 *     """A non-callable version of `Mock`"""
 * 
 *     def __new__(cls, *args, **kw):             # <<<<<<<<<<<<<<
 *         # every instance has its own class
 *         # so we can create magic methods on the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cymock.NonCallableMock.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bases);
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XDECREF(__pyx_v_bound_args);
  __Pyx_XDECREF(__pyx_v_spec_arg);
  __Pyx_XDECREF(__pyx_v_new);
  __Pyx_XDECREF(__pyx_v_instance);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_arg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":427
 * 
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, spec=None, wraps=None, name=None, spec_set=None,
 *             parent=None, _spec_state=None, _new_name='', _new_parent=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_3__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_3__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_3__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_3__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_wraps = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v__spec_state = 0;
  PyObject *__pyx_v__new_name = 0;
  PyObject *__pyx_v__new_parent = 0;
  PyObject *__pyx_v__spec_as_instance = 0;
  PyObject *__pyx_v__eat_self = 0;
  PyObject *__pyx_v_unsafe = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_spec,&__pyx_n_s_wraps,&__pyx_n_s_name_2,&__pyx_n_s_spec_set,&__pyx_n_s_parent,&__pyx_n_s_spec_state,&__pyx_n_s_new_name_2,&__pyx_n_s_new_parent,&__pyx_n_s_spec_as_instance,&__pyx_n_s_eat_self_2,&__pyx_n_s_unsafe,0};
    PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};

    /* "cymock.pyx":428
 * 
 *     def __init__(
 *             self, spec=None, wraps=None, name=None, spec_set=None,             # <<<<<<<<<<<<<<
 *             parent=None, _spec_state=None, _new_name='', _new_parent=None,
 *             _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
 */
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));

    /* "cymock.pyx":429
 *     def __init__(
 *             self, spec=None, wraps=None, name=None, spec_set=None,
 *             parent=None, _spec_state=None, _new_name='', _new_parent=None,             # <<<<<<<<<<<<<<
 *             _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
 *         ):
 */
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_None));
    values[7] = ((PyObject *)((PyObject*)__pyx_kp_u__31));
    values[8] = ((PyObject *)((PyObject *)Py_None));

    /* "cymock.pyx":430
 *             self, spec=None, wraps=None, name=None, spec_set=None,
 *             parent=None, _spec_state=None, _new_name='', _new_parent=None,
 *             _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs             # <<<<<<<<<<<<<<
 *         ):
 *         if _new_parent is None:
 */
    values[9] = ((PyObject *)((PyObject *)Py_False));
    values[10] = ((PyObject *)((PyObject *)Py_None));
    values[11] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wraps);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_state);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_name_2);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_parent);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_as_instance);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eat_self_2);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unsafe);
          if (value) { values[11] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 427, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_spec = values[1];
    __pyx_v_wraps = values[2];
    __pyx_v_name = values[3];
    __pyx_v_spec_set = values[4];
    __pyx_v_parent = values[5];
    __pyx_v__spec_state = values[6];
    __pyx_v__new_name = values[7];
    __pyx_v__new_parent = values[8];
    __pyx_v__spec_as_instance = values[9];
    __pyx_v__eat_self = values[10];
    __pyx_v_unsafe = values[11];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 427, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.NonCallableMock.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_2__init__(__pyx_self, __pyx_v_self, __pyx_v_spec, __pyx_v_wraps, __pyx_v_name, __pyx_v_spec_set, __pyx_v_parent, __pyx_v__spec_state, __pyx_v__new_name, __pyx_v__new_parent, __pyx_v__spec_as_instance, __pyx_v__eat_self, __pyx_v_unsafe, __pyx_v_kwargs);

  /* "cymock.pyx":427
 * 
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, spec=None, wraps=None, name=None, spec_set=None,
 *             parent=None, _spec_state=None, _new_name='', _new_parent=None,
 */

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_wraps, PyObject *__pyx_v_name, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_parent, PyObject *__pyx_v__spec_state, PyObject *__pyx_v__new_name, PyObject *__pyx_v__new_parent, PyObject *__pyx_v__spec_as_instance, PyObject *__pyx_v__eat_self, PyObject *__pyx_v_unsafe, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v___dict__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_spec);
  __Pyx_INCREF(__pyx_v_spec_set);
  __Pyx_INCREF(__pyx_v__new_parent);
  __Pyx_INCREF(__pyx_v__eat_self);

  /* "cymock.pyx":432
 *             _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
 *         ):
 *         if _new_parent is None:             # <<<<<<<<<<<<<<
 *             _new_parent = parent
 * 
 */
  __pyx_t_1 = (__pyx_v__new_parent == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":433
 *         ):
 *         if _new_parent is None:
 *             _new_parent = parent             # <<<<<<<<<<<<<<
 * 
 *         __dict__ = self.__dict__
 */
    __Pyx_INCREF(__pyx_v_parent);
    __Pyx_DECREF_SET(__pyx_v__new_parent, __pyx_v_parent);

    /* "cymock.pyx":432
 *             _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
 *         ):
 *         if _new_parent is None:             # <<<<<<<<<<<<<<
 *             _new_parent = parent
 * 
 */
  }

  /* "cymock.pyx":435
 *             _new_parent = parent
 * 
 *         __dict__ = self.__dict__             # <<<<<<<<<<<<<<
 *         __dict__['_mock_parent'] = parent
 *         __dict__['_mock_name'] = name
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v___dict__ = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":436
 * 
 *         __dict__ = self.__dict__
 *         __dict__['_mock_parent'] = parent             # <<<<<<<<<<<<<<
 *         __dict__['_mock_name'] = name
 *         __dict__['_mock_new_name'] = _new_name
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_parent, __pyx_v_parent) < 0)) __PYX_ERR(0, 436, __pyx_L1_error)

  /* "cymock.pyx":437
 *         __dict__ = self.__dict__
 *         __dict__['_mock_parent'] = parent
 *         __dict__['_mock_name'] = name             # <<<<<<<<<<<<<<
 *         __dict__['_mock_new_name'] = _new_name
 *         __dict__['_mock_new_parent'] = _new_parent
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_name, __pyx_v_name) < 0)) __PYX_ERR(0, 437, __pyx_L1_error)

  /* "cymock.pyx":438
 *         __dict__['_mock_parent'] = parent
 *         __dict__['_mock_name'] = name
 *         __dict__['_mock_new_name'] = _new_name             # <<<<<<<<<<<<<<
 *         __dict__['_mock_new_parent'] = _new_parent
 *         __dict__['_mock_sealed'] = False
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_new_name, __pyx_v__new_name) < 0)) __PYX_ERR(0, 438, __pyx_L1_error)

  /* "cymock.pyx":439
 *         __dict__['_mock_name'] = name
 *         __dict__['_mock_new_name'] = _new_name
 *         __dict__['_mock_new_parent'] = _new_parent             # <<<<<<<<<<<<<<
 *         __dict__['_mock_sealed'] = False
 * 
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_new_parent, __pyx_v__new_parent) < 0)) __PYX_ERR(0, 439, __pyx_L1_error)

  /* "cymock.pyx":440
 *         __dict__['_mock_new_name'] = _new_name
 *         __dict__['_mock_new_parent'] = _new_parent
 *         __dict__['_mock_sealed'] = False             # <<<<<<<<<<<<<<
 * 
 *         if spec_set is not None:
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_sealed, Py_False) < 0)) __PYX_ERR(0, 440, __pyx_L1_error)

  /* "cymock.pyx":442
 *         __dict__['_mock_sealed'] = False
 * 
 *         if spec_set is not None:             # <<<<<<<<<<<<<<
 *             spec = spec_set
 *             spec_set = True
 */
  __pyx_t_2 = (__pyx_v_spec_set != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cymock.pyx":443
 * 
 *         if spec_set is not None:
 *             spec = spec_set             # <<<<<<<<<<<<<<
 *             spec_set = True
 *         if _eat_self is None:
 */
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_DECREF_SET(__pyx_v_spec, __pyx_v_spec_set);

    /* "cymock.pyx":444
 *         if spec_set is not None:
 *             spec = spec_set
 *             spec_set = True             # <<<<<<<<<<<<<<
 *         if _eat_self is None:
 *             _eat_self = parent is not None
 */
    __Pyx_INCREF(Py_True);
    __Pyx_DECREF_SET(__pyx_v_spec_set, Py_True);

    /* "cymock.pyx":442
 *         __dict__['_mock_sealed'] = False
 * 
 *         if spec_set is not None:             # <<<<<<<<<<<<<<
 *             spec = spec_set
 *             spec_set = True
 */
  }

  /* "cymock.pyx":445
 *             spec = spec_set
 *             spec_set = True
 *         if _eat_self is None:             # <<<<<<<<<<<<<<
 *             _eat_self = parent is not None
 * 
 */
  __pyx_t_1 = (__pyx_v__eat_self == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":446
 *             spec_set = True
 *         if _eat_self is None:
 *             _eat_self = parent is not None             # <<<<<<<<<<<<<<
 * 
 *         self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
 */
    __pyx_t_2 = (__pyx_v_parent != Py_None);
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v__eat_self, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":445
 *             spec = spec_set
 *             spec_set = True
 *         if _eat_self is None:             # <<<<<<<<<<<<<<
 *             _eat_self = parent is not None
 * 
 */
  }

  /* "cymock.pyx":448
 *             _eat_self = parent is not None
 * 
 *         self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)             # <<<<<<<<<<<<<<
 * 
 *         __dict__['_mock_children'] = {}
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_add_spec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_spec, __pyx_v_spec_set, __pyx_v__spec_as_instance, __pyx_v__eat_self};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_spec, __pyx_v_spec_set, __pyx_v__spec_as_instance, __pyx_v__eat_self};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_spec_set);
    __Pyx_INCREF(__pyx_v__spec_as_instance);
    __Pyx_GIVEREF(__pyx_v__spec_as_instance);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v__spec_as_instance);
    __Pyx_INCREF(__pyx_v__eat_self);
    __Pyx_GIVEREF(__pyx_v__eat_self);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v__eat_self);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":450
 *         self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
 * 
 *         __dict__['_mock_children'] = {}             # <<<<<<<<<<<<<<
 *         __dict__['_mock_wraps'] = wraps
 *         __dict__['_mock_delegate'] = None
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_children, __pyx_t_3) < 0)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":451
 * 
 *         __dict__['_mock_children'] = {}
 *         __dict__['_mock_wraps'] = wraps             # <<<<<<<<<<<<<<
 *         __dict__['_mock_delegate'] = None
 * 
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_wraps, __pyx_v_wraps) < 0)) __PYX_ERR(0, 451, __pyx_L1_error)

  /* "cymock.pyx":452
 *         __dict__['_mock_children'] = {}
 *         __dict__['_mock_wraps'] = wraps
 *         __dict__['_mock_delegate'] = None             # <<<<<<<<<<<<<<
 * 
 *         __dict__['_mock_called'] = False
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_delegate, Py_None) < 0)) __PYX_ERR(0, 452, __pyx_L1_error)

  /* "cymock.pyx":454
 *         __dict__['_mock_delegate'] = None
 * 
 *         __dict__['_mock_called'] = False             # <<<<<<<<<<<<<<
 *         __dict__['_mock_call_args'] = None
 *         __dict__['_mock_call_count'] = 0
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_called, Py_False) < 0)) __PYX_ERR(0, 454, __pyx_L1_error)

  /* "cymock.pyx":455
 * 
 *         __dict__['_mock_called'] = False
 *         __dict__['_mock_call_args'] = None             # <<<<<<<<<<<<<<
 *         __dict__['_mock_call_count'] = 0
 *         __dict__['_mock_call_args_list'] = _CallList()
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_call_args, Py_None) < 0)) __PYX_ERR(0, 455, __pyx_L1_error)

  /* "cymock.pyx":456
 *         __dict__['_mock_called'] = False
 *         __dict__['_mock_call_args'] = None
 *         __dict__['_mock_call_count'] = 0             # <<<<<<<<<<<<<<
 *         __dict__['_mock_call_args_list'] = _CallList()
 *         __dict__['_mock_mock_calls'] = _CallList()
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_call_count, __pyx_int_0) < 0)) __PYX_ERR(0, 456, __pyx_L1_error)

  /* "cymock.pyx":457
 *         __dict__['_mock_call_args'] = None
 *         __dict__['_mock_call_count'] = 0
 *         __dict__['_mock_call_args_list'] = _CallList()             # <<<<<<<<<<<<<<
 *         __dict__['_mock_mock_calls'] = _CallList()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CallList); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_call_args_list, __pyx_t_3) < 0)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":458
 *         __dict__['_mock_call_count'] = 0
 *         __dict__['_mock_call_args_list'] = _CallList()
 *         __dict__['_mock_mock_calls'] = _CallList()             # <<<<<<<<<<<<<<
 * 
 *         __dict__['method_calls'] = _CallList()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CallList); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_mock_calls, __pyx_t_3) < 0)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":460
 *         __dict__['_mock_mock_calls'] = _CallList()
 * 
 *         __dict__['method_calls'] = _CallList()             # <<<<<<<<<<<<<<
 *         __dict__['_mock_unsafe'] = unsafe
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_CallList); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_method_calls, __pyx_t_3) < 0)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":461
 * 
 *         __dict__['method_calls'] = _CallList()
 *         __dict__['_mock_unsafe'] = unsafe             # <<<<<<<<<<<<<<
 * 
 *         if kwargs:
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_unsafe, __pyx_v_unsafe) < 0)) __PYX_ERR(0, 461, __pyx_L1_error)

  /* "cymock.pyx":463
 *         __dict__['_mock_unsafe'] = unsafe
 * 
 *         if kwargs:             # <<<<<<<<<<<<<<
 *             self.configure_mock(**kwargs)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 463, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cymock.pyx":464
 * 
 *         if kwargs:
 *             self.configure_mock(**kwargs)             # <<<<<<<<<<<<<<
 * 
 *         _safe_super(NonCallableMock, self).__init__(
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_configure_mock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cymock.pyx":463
 *         __dict__['_mock_unsafe'] = unsafe
 * 
 *         if kwargs:             # <<<<<<<<<<<<<<
 *             self.configure_mock(**kwargs)
 * 
 */
  }

  /* "cymock.pyx":466
 *             self.configure_mock(**kwargs)
 * 
 *         _safe_super(NonCallableMock, self).__init__(             # <<<<<<<<<<<<<<
 *             spec, wraps, name, spec_set, parent,
 *             _spec_state
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_super); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_v_self};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_v_self};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_v_self);
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":468
 *         _safe_super(NonCallableMock, self).__init__(
 *             spec, wraps, name, spec_set, parent,
 *             _spec_state             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_spec, __pyx_v_wraps, __pyx_v_name, __pyx_v_spec_set, __pyx_v_parent, __pyx_v__spec_state};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 6+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_spec, __pyx_v_wraps, __pyx_v_name, __pyx_v_spec_set, __pyx_v_parent, __pyx_v__spec_state};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 6+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(6+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_wraps);
    __Pyx_GIVEREF(__pyx_v_wraps);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_v_wraps);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_6, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_6, __pyx_v_spec_set);
    __Pyx_INCREF(__pyx_v_parent);
    __Pyx_GIVEREF(__pyx_v_parent);
    PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_6, __pyx_v_parent);
    __Pyx_INCREF(__pyx_v__spec_state);
    __Pyx_GIVEREF(__pyx_v__spec_state);
    PyTuple_SET_ITEM(__pyx_t_9, 5+__pyx_t_6, __pyx_v__spec_state);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cymock.pyx":427
 * 
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, spec=None, wraps=None, name=None, spec_set=None,
 *             parent=None, _spec_state=None, _new_name='', _new_parent=None,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cymock.NonCallableMock.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___dict__);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_XDECREF(__pyx_v_spec_set);
  __Pyx_XDECREF(__pyx_v__new_parent);
  __Pyx_XDECREF(__pyx_v__eat_self);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":472
 * 
 * 
 *     def attach_mock(self, mock, attribute):             # <<<<<<<<<<<<<<
 *         """
 *         Attach a mock as an attribute of this one, replacing its name and
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_5attach_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_4attach_mock[] = "\n        Attach a mock as an attribute of this one, replacing its name and\n        parent. Calls to the attached mock will be recorded in the\n        `method_calls` and `mock_calls` attributes of this one.";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_5attach_mock = {"attach_mock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_5attach_mock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_4attach_mock};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_5attach_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_mock = 0;
  PyObject *__pyx_v_attribute = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("attach_mock (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_mock,&__pyx_n_s_attribute,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mock)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("attach_mock", 1, 3, 3, 1); __PYX_ERR(0, 472, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attribute)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("attach_mock", 1, 3, 3, 2); __PYX_ERR(0, 472, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "attach_mock") < 0)) __PYX_ERR(0, 472, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_mock = values[1];
    __pyx_v_attribute = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("attach_mock", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 472, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.attach_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_4attach_mock(__pyx_self, __pyx_v_self, __pyx_v_mock, __pyx_v_attribute);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_4attach_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_mock, PyObject *__pyx_v_attribute) {
  PyObject *__pyx_v_inner_mock = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("attach_mock", 0);

  /* "cymock.pyx":477
 *         parent. Calls to the attached mock will be recorded in the
 *         `method_calls` and `mock_calls` attributes of this one."""
 *         inner_mock = _extract_mock(mock)             # <<<<<<<<<<<<<<
 * 
 *         inner_mock._mock_parent = None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_extract_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_mock) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_mock);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_inner_mock = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":479
 *         inner_mock = _extract_mock(mock)
 * 
 *         inner_mock._mock_parent = None             # <<<<<<<<<<<<<<
 *         inner_mock._mock_new_parent = None
 *         inner_mock._mock_name = ''
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_inner_mock, __pyx_n_s_mock_parent, Py_None) < 0) __PYX_ERR(0, 479, __pyx_L1_error)

  /* "cymock.pyx":480
 * 
 *         inner_mock._mock_parent = None
 *         inner_mock._mock_new_parent = None             # <<<<<<<<<<<<<<
 *         inner_mock._mock_name = ''
 *         inner_mock._mock_new_name = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_inner_mock, __pyx_n_s_mock_new_parent, Py_None) < 0) __PYX_ERR(0, 480, __pyx_L1_error)

  /* "cymock.pyx":481
 *         inner_mock._mock_parent = None
 *         inner_mock._mock_new_parent = None
 *         inner_mock._mock_name = ''             # <<<<<<<<<<<<<<
 *         inner_mock._mock_new_name = None
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_inner_mock, __pyx_n_s_mock_name, __pyx_kp_u__31) < 0) __PYX_ERR(0, 481, __pyx_L1_error)

  /* "cymock.pyx":482
 *         inner_mock._mock_new_parent = None
 *         inner_mock._mock_name = ''
 *         inner_mock._mock_new_name = None             # <<<<<<<<<<<<<<
 * 
 *         setattr(self, attribute, mock)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_inner_mock, __pyx_n_s_mock_new_name, Py_None) < 0) __PYX_ERR(0, 482, __pyx_L1_error)

  /* "cymock.pyx":484
 *         inner_mock._mock_new_name = None
 * 
 *         setattr(self, attribute, mock)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyObject_SetAttr(__pyx_v_self, __pyx_v_attribute, __pyx_v_mock); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 484, __pyx_L1_error)

  /* "cymock.pyx":472
 * 
 * 
 *     def attach_mock(self, mock, attribute):             # <<<<<<<<<<<<<<
 *         """
 *         Attach a mock as an attribute of this one, replacing its name and
 */

  /* 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_AddTraceback("cymock.NonCallableMock.attach_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inner_mock);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":487
 * 
 * 
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_7mock_add_spec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_6mock_add_spec[] = "Add a spec to a mock. `spec` can either be an object or a\n        list of strings. Only attributes on the `spec` can be fetched as\n        attributes from the mock.\n\n        If `spec_set` is True then only attributes on the spec can be set.";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_7mock_add_spec = {"mock_add_spec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_7mock_add_spec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_6mock_add_spec};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_7mock_add_spec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mock_add_spec (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_spec,&__pyx_n_s_spec_set,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mock_add_spec", 0, 2, 3, 1); __PYX_ERR(0, 487, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mock_add_spec") < 0)) __PYX_ERR(0, 487, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_spec = values[1];
    __pyx_v_spec_set = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mock_add_spec", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 487, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.mock_add_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_6mock_add_spec(__pyx_self, __pyx_v_self, __pyx_v_spec, __pyx_v_spec_set);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_6mock_add_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mock_add_spec", 0);

  /* "cymock.pyx":493
 * 
 *         If `spec_set` is True then only attributes on the spec can be set."""
 *         self._mock_add_spec(spec, spec_set)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_add_spec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_spec, __pyx_v_spec_set};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_spec, __pyx_v_spec_set};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_spec_set);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":487
 * 
 * 
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */

  /* 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_5);
  __Pyx_AddTraceback("cymock.NonCallableMock.mock_add_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":496
 * 
 * 
 *     def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,             # <<<<<<<<<<<<<<
 *                        _eat_self=False):
 *         _spec_class = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_9_mock_add_spec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_9_mock_add_spec = {"_mock_add_spec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_9_mock_add_spec, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_9_mock_add_spec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v__spec_as_instance = 0;
  PyObject *__pyx_v__eat_self = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_mock_add_spec (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_spec,&__pyx_n_s_spec_set,&__pyx_n_s_spec_as_instance,&__pyx_n_s_eat_self_2,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_False));

    /* "cymock.pyx":497
 * 
 *     def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,
 *                        _eat_self=False):             # <<<<<<<<<<<<<<
 *         _spec_class = None
 *         _spec_signature = None
 */
    values[4] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_mock_add_spec", 0, 3, 5, 1); __PYX_ERR(0, 496, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_mock_add_spec", 0, 3, 5, 2); __PYX_ERR(0, 496, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_as_instance);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eat_self_2);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mock_add_spec") < 0)) __PYX_ERR(0, 496, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_spec = values[1];
    __pyx_v_spec_set = values[2];
    __pyx_v__spec_as_instance = values[3];
    __pyx_v__eat_self = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_mock_add_spec", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 496, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock._mock_add_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_8_mock_add_spec(__pyx_self, __pyx_v_self, __pyx_v_spec, __pyx_v_spec_set, __pyx_v__spec_as_instance, __pyx_v__eat_self);

  /* "cymock.pyx":496
 * 
 * 
 *     def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,             # <<<<<<<<<<<<<<
 *                        _eat_self=False):
 *         _spec_class = None
 */

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_8_mock_add_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set, PyObject *__pyx_v__spec_as_instance, PyObject *__pyx_v__eat_self) {
  PyObject *__pyx_v__spec_class = NULL;
  PyObject *__pyx_v__spec_signature = NULL;
  PyObject *__pyx_v__spec_asyncs = NULL;
  PyObject *__pyx_v_attr = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v___dict__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("_mock_add_spec", 0);
  __Pyx_INCREF(__pyx_v_spec);

  /* "cymock.pyx":498
 *     def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,
 *                        _eat_self=False):
 *         _spec_class = None             # <<<<<<<<<<<<<<
 *         _spec_signature = None
 *         _spec_asyncs = []
 */
  __Pyx_INCREF(Py_None);
  __pyx_v__spec_class = Py_None;

  /* "cymock.pyx":499
 *                        _eat_self=False):
 *         _spec_class = None
 *         _spec_signature = None             # <<<<<<<<<<<<<<
 *         _spec_asyncs = []
 * 
 */
  __Pyx_INCREF(Py_None);
  __pyx_v__spec_signature = Py_None;

  /* "cymock.pyx":500
 *         _spec_class = None
 *         _spec_signature = None
 *         _spec_asyncs = []             # <<<<<<<<<<<<<<
 * 
 *         for attr in dir(spec):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__spec_asyncs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":502
 *         _spec_asyncs = []
 * 
 *         for attr in dir(spec):             # <<<<<<<<<<<<<<
 *             if asyncio.iscoroutinefunction(getattr(spec, attr, None)):
 *                 _spec_asyncs.append(attr)
 */
  __pyx_t_1 = PyObject_Dir(__pyx_v_spec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 502, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 502, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 502, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":503
 * 
 *         for attr in dir(spec):
 *             if asyncio.iscoroutinefunction(getattr(spec, attr, None)):             # <<<<<<<<<<<<<<
 *                 _spec_asyncs.append(attr)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_spec, __pyx_v_attr, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "cymock.pyx":504
 *         for attr in dir(spec):
 *             if asyncio.iscoroutinefunction(getattr(spec, attr, None)):
 *                 _spec_asyncs.append(attr)             # <<<<<<<<<<<<<<
 * 
 *         if spec is not None and not _is_list(spec):
 */
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v__spec_asyncs, __pyx_v_attr); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 504, __pyx_L1_error)

      /* "cymock.pyx":503
 * 
 *         for attr in dir(spec):
 *             if asyncio.iscoroutinefunction(getattr(spec, attr, None)):             # <<<<<<<<<<<<<<
 *                 _spec_asyncs.append(attr)
 * 
 */
    }

    /* "cymock.pyx":502
 *         _spec_asyncs = []
 * 
 *         for attr in dir(spec):             # <<<<<<<<<<<<<<
 *             if asyncio.iscoroutinefunction(getattr(spec, attr, None)):
 *                 _spec_asyncs.append(attr)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":506
 *                 _spec_asyncs.append(attr)
 * 
 *         if spec is not None and not _is_list(spec):             # <<<<<<<<<<<<<<
 *             if isinstance(spec, type):
 *                 _spec_class = spec
 */
  __pyx_t_10 = (__pyx_v_spec != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {
  } else {
    __pyx_t_8 = __pyx_t_11;
    goto __pyx_L7_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_spec);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = ((!__pyx_t_11) != 0);
  __pyx_t_8 = __pyx_t_10;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_8) {

    /* "cymock.pyx":507
 * 
 *         if spec is not None and not _is_list(spec):
 *             if isinstance(spec, type):             # <<<<<<<<<<<<<<
 *                 _spec_class = spec
 *             else:
 */
    __pyx_t_8 = PyType_Check(__pyx_v_spec); 
    __pyx_t_10 = (__pyx_t_8 != 0);
    if (__pyx_t_10) {

      /* "cymock.pyx":508
 *         if spec is not None and not _is_list(spec):
 *             if isinstance(spec, type):
 *                 _spec_class = spec             # <<<<<<<<<<<<<<
 *             else:
 *                 _spec_class = type(spec)
 */
      __Pyx_INCREF(__pyx_v_spec);
      __Pyx_DECREF_SET(__pyx_v__spec_class, __pyx_v_spec);

      /* "cymock.pyx":507
 * 
 *         if spec is not None and not _is_list(spec):
 *             if isinstance(spec, type):             # <<<<<<<<<<<<<<
 *                 _spec_class = spec
 *             else:
 */
      goto __pyx_L9;
    }

    /* "cymock.pyx":510
 *                 _spec_class = spec
 *             else:
 *                 _spec_class = type(spec)             # <<<<<<<<<<<<<<
 *             res = _get_signature_object(spec,
 *                                         _spec_as_instance, _eat_self)
 */
    /*else*/ {
      __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_spec)));
      __Pyx_DECREF_SET(__pyx_v__spec_class, ((PyObject *)Py_TYPE(__pyx_v_spec)));
    }
    __pyx_L9:;

    /* "cymock.pyx":511
 *             else:
 *                 _spec_class = type(spec)
 *             res = _get_signature_object(spec,             # <<<<<<<<<<<<<<
 *                                         _spec_as_instance, _eat_self)
 *             _spec_signature = res and res[1]
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_signature_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cymock.pyx":512
 *                 _spec_class = type(spec)
 *             res = _get_signature_object(spec,
 *                                         _spec_as_instance, _eat_self)             # <<<<<<<<<<<<<<
 *             _spec_signature = res and res[1]
 * 
 */
    __pyx_t_6 = NULL;
    __pyx_t_12 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_12 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_spec, __pyx_v__spec_as_instance, __pyx_v__eat_self};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_spec, __pyx_v__spec_as_instance, __pyx_v__eat_self};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_spec);
      __Pyx_GIVEREF(__pyx_v_spec);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_12, __pyx_v_spec);
      __Pyx_INCREF(__pyx_v__spec_as_instance);
      __Pyx_GIVEREF(__pyx_v__spec_as_instance);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_12, __pyx_v__spec_as_instance);
      __Pyx_INCREF(__pyx_v__eat_self);
      __Pyx_GIVEREF(__pyx_v__eat_self);
      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_12, __pyx_v__eat_self);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_res = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cymock.pyx":513
 *             res = _get_signature_object(spec,
 *                                         _spec_as_instance, _eat_self)
 *             _spec_signature = res and res[1]             # <<<<<<<<<<<<<<
 * 
 *             spec = dir(spec)
 */
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_res); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
    if (__pyx_t_10) {
    } else {
      __Pyx_INCREF(__pyx_v_res);
      __pyx_t_2 = __pyx_v_res;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_res, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_L10_bool_binop_done:;
    __Pyx_DECREF_SET(__pyx_v__spec_signature, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cymock.pyx":515
 *             _spec_signature = res and res[1]
 * 
 *             spec = dir(spec)             # <<<<<<<<<<<<<<
 * 
 *         __dict__ = self.__dict__
 */
    __pyx_t_2 = PyObject_Dir(__pyx_v_spec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_spec, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cymock.pyx":506
 *                 _spec_asyncs.append(attr)
 * 
 *         if spec is not None and not _is_list(spec):             # <<<<<<<<<<<<<<
 *             if isinstance(spec, type):
 *                 _spec_class = spec
 */
  }

  /* "cymock.pyx":517
 *             spec = dir(spec)
 * 
 *         __dict__ = self.__dict__             # <<<<<<<<<<<<<<
 *         __dict__['_spec_class'] = _spec_class
 *         __dict__['_spec_set'] = spec_set
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v___dict__ = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":518
 * 
 *         __dict__ = self.__dict__
 *         __dict__['_spec_class'] = _spec_class             # <<<<<<<<<<<<<<
 *         __dict__['_spec_set'] = spec_set
 *         __dict__['_spec_signature'] = _spec_signature
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_spec_class, __pyx_v__spec_class) < 0)) __PYX_ERR(0, 518, __pyx_L1_error)

  /* "cymock.pyx":519
 *         __dict__ = self.__dict__
 *         __dict__['_spec_class'] = _spec_class
 *         __dict__['_spec_set'] = spec_set             # <<<<<<<<<<<<<<
 *         __dict__['_spec_signature'] = _spec_signature
 *         __dict__['_mock_methods'] = spec
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_spec_set_2, __pyx_v_spec_set) < 0)) __PYX_ERR(0, 519, __pyx_L1_error)

  /* "cymock.pyx":520
 *         __dict__['_spec_class'] = _spec_class
 *         __dict__['_spec_set'] = spec_set
 *         __dict__['_spec_signature'] = _spec_signature             # <<<<<<<<<<<<<<
 *         __dict__['_mock_methods'] = spec
 *         __dict__['_spec_asyncs'] = _spec_asyncs
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_spec_signature, __pyx_v__spec_signature) < 0)) __PYX_ERR(0, 520, __pyx_L1_error)

  /* "cymock.pyx":521
 *         __dict__['_spec_set'] = spec_set
 *         __dict__['_spec_signature'] = _spec_signature
 *         __dict__['_mock_methods'] = spec             # <<<<<<<<<<<<<<
 *         __dict__['_spec_asyncs'] = _spec_asyncs
 * 
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_mock_methods, __pyx_v_spec) < 0)) __PYX_ERR(0, 521, __pyx_L1_error)

  /* "cymock.pyx":522
 *         __dict__['_spec_signature'] = _spec_signature
 *         __dict__['_mock_methods'] = spec
 *         __dict__['_spec_asyncs'] = _spec_asyncs             # <<<<<<<<<<<<<<
 * 
 *     def __get_return_value(self):
 */
  if (unlikely(PyObject_SetItem(__pyx_v___dict__, __pyx_n_u_spec_asyncs, __pyx_v__spec_asyncs) < 0)) __PYX_ERR(0, 522, __pyx_L1_error)

  /* "cymock.pyx":496
 * 
 * 
 *     def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,             # <<<<<<<<<<<<<<
 *                        _eat_self=False):
 *         _spec_class = None
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.NonCallableMock._mock_add_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__spec_class);
  __Pyx_XDECREF(__pyx_v__spec_signature);
  __Pyx_XDECREF(__pyx_v__spec_asyncs);
  __Pyx_XDECREF(__pyx_v_attr);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v___dict__);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":524
 *         __dict__['_spec_asyncs'] = _spec_asyncs
 * 
 *     def __get_return_value(self):             # <<<<<<<<<<<<<<
 *         ret = self._mock_return_value
 *         if self._mock_delegate is not None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_11__get_return_value(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_11__get_return_value = {"__get_return_value", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_11__get_return_value, METH_O, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_11__get_return_value(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get_return_value (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_10__get_return_value(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_10__get_return_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__get_return_value", 0);

  /* "cymock.pyx":525
 * 
 *     def __get_return_value(self):
 *         ret = self._mock_return_value             # <<<<<<<<<<<<<<
 *         if self._mock_delegate is not None:
 *             ret = self._mock_delegate.return_value
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":526
 *     def __get_return_value(self):
 *         ret = self._mock_return_value
 *         if self._mock_delegate is not None:             # <<<<<<<<<<<<<<
 *             ret = self._mock_delegate.return_value
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":527
 *         ret = self._mock_return_value
 *         if self._mock_delegate is not None:
 *             ret = self._mock_delegate.return_value             # <<<<<<<<<<<<<<
 * 
 *         if ret is DEFAULT:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_return_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":526
 *     def __get_return_value(self):
 *         ret = self._mock_return_value
 *         if self._mock_delegate is not None:             # <<<<<<<<<<<<<<
 *             ret = self._mock_delegate.return_value
 * 
 */
  }

  /* "cymock.pyx":529
 *             ret = self._mock_delegate.return_value
 * 
 *         if ret is DEFAULT:             # <<<<<<<<<<<<<<
 *             ret = self._get_child_mock(
 *                 _new_parent=self, _new_name='()'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__pyx_v_ret == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":530
 * 
 *         if ret is DEFAULT:
 *             ret = self._get_child_mock(             # <<<<<<<<<<<<<<
 *                 _new_parent=self, _new_name='()'
 *             )
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_child_mock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cymock.pyx":531
 *         if ret is DEFAULT:
 *             ret = self._get_child_mock(
 *                 _new_parent=self, _new_name='()'             # <<<<<<<<<<<<<<
 *             )
 *             self.return_value = ret
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_new_parent, __pyx_v_self) < 0) __PYX_ERR(0, 531, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_new_name_2, __pyx_kp_u__32) < 0) __PYX_ERR(0, 531, __pyx_L1_error)

    /* "cymock.pyx":530
 * 
 *         if ret is DEFAULT:
 *             ret = self._get_child_mock(             # <<<<<<<<<<<<<<
 *                 _new_parent=self, _new_name='()'
 *             )
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cymock.pyx":533
 *                 _new_parent=self, _new_name='()'
 *             )
 *             self.return_value = ret             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_return_value, __pyx_v_ret) < 0) __PYX_ERR(0, 533, __pyx_L1_error)

    /* "cymock.pyx":529
 *             ret = self._mock_delegate.return_value
 * 
 *         if ret is DEFAULT:             # <<<<<<<<<<<<<<
 *             ret = self._get_child_mock(
 *                 _new_parent=self, _new_name='()'
 */
  }

  /* "cymock.pyx":534
 *             )
 *             self.return_value = ret
 *         return ret             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ret);
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "cymock.pyx":524
 *         __dict__['_spec_asyncs'] = _spec_asyncs
 * 
 *     def __get_return_value(self):             # <<<<<<<<<<<<<<
 *         ret = self._mock_return_value
 *         if self._mock_delegate is not None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cymock.NonCallableMock.__get_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":537
 * 
 * 
 *     def __set_return_value(self, value):             # <<<<<<<<<<<<<<
 *         if self._mock_delegate is not None:
 *             self._mock_delegate.return_value = value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_13__set_return_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_13__set_return_value = {"__set_return_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_13__set_return_value, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_13__set_return_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set_return_value (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__set_return_value", 1, 2, 2, 1); __PYX_ERR(0, 537, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__set_return_value") < 0)) __PYX_ERR(0, 537, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__set_return_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 537, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.__set_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_12__set_return_value(__pyx_self, __pyx_v_self, __pyx_v_value);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_12__set_return_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__set_return_value", 0);

  /* "cymock.pyx":538
 * 
 *     def __set_return_value(self, value):
 *         if self._mock_delegate is not None:             # <<<<<<<<<<<<<<
 *             self._mock_delegate.return_value = value
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":539
 *     def __set_return_value(self, value):
 *         if self._mock_delegate is not None:
 *             self._mock_delegate.return_value = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._mock_return_value = value
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_return_value, __pyx_v_value) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":538
 * 
 *     def __set_return_value(self, value):
 *         if self._mock_delegate is not None:             # <<<<<<<<<<<<<<
 *             self._mock_delegate.return_value = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":541
 *             self._mock_delegate.return_value = value
 *         else:
 *             self._mock_return_value = value             # <<<<<<<<<<<<<<
 *             _check_and_set_parent(self, value, None, '()')
 * 
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mock_return_value, __pyx_v_value) < 0) __PYX_ERR(0, 541, __pyx_L1_error)

    /* "cymock.pyx":542
 *         else:
 *             self._mock_return_value = value
 *             _check_and_set_parent(self, value, None, '()')             # <<<<<<<<<<<<<<
 * 
 *     __return_value_doc = "The value to be returned when the mock is called."
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_and_set_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_self, __pyx_v_value, Py_None, __pyx_kp_u__32};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_self, __pyx_v_value, Py_None, __pyx_kp_u__32};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value);
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, Py_None);
      __Pyx_INCREF(__pyx_kp_u__32);
      __Pyx_GIVEREF(__pyx_kp_u__32);
      PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_kp_u__32);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "cymock.pyx":537
 * 
 * 
 *     def __set_return_value(self, value):             # <<<<<<<<<<<<<<
 *         if self._mock_delegate is not None:
 *             self._mock_delegate.return_value = value
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.NonCallableMock.__set_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":550
 * 
 *     @property
 *     def __class__(self):             # <<<<<<<<<<<<<<
 *         if self._spec_class is None:
 *             return type(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_15__class__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_15__class__ = {"__class__", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_15__class__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_15__class__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__class__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_14__class__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_14__class__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__class__", 0);

  /* "cymock.pyx":551
 *     @property
 *     def __class__(self):
 *         if self._spec_class is None:             # <<<<<<<<<<<<<<
 *             return type(self)
 *         return self._spec_class
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":552
 *     def __class__(self):
 *         if self._spec_class is None:
 *             return type(self)             # <<<<<<<<<<<<<<
 *         return self._spec_class
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self)));
    __pyx_r = ((PyObject *)Py_TYPE(__pyx_v_self));
    goto __pyx_L0;

    /* "cymock.pyx":551
 *     @property
 *     def __class__(self):
 *         if self._spec_class is None:             # <<<<<<<<<<<<<<
 *             return type(self)
 *         return self._spec_class
 */
  }

  /* "cymock.pyx":553
 *         if self._spec_class is None:
 *             return type(self)
 *         return self._spec_class             # <<<<<<<<<<<<<<
 * 
 *     called = _delegating_property('called')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":550
 * 
 *     @property
 *     def __class__(self):             # <<<<<<<<<<<<<<
 *         if self._spec_class is None:
 *             return type(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock.NonCallableMock.__class__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":562
 * 
 * 
 *     def __get_side_effect(self):             # <<<<<<<<<<<<<<
 *         delegated = self._mock_delegate
 *         if delegated is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_17__get_side_effect(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_17__get_side_effect = {"__get_side_effect", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_17__get_side_effect, METH_O, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_17__get_side_effect(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get_side_effect (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_16__get_side_effect(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_16__get_side_effect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_delegated = NULL;
  PyObject *__pyx_v_sf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get_side_effect", 0);

  /* "cymock.pyx":563
 * 
 *     def __get_side_effect(self):
 *         delegated = self._mock_delegate             # <<<<<<<<<<<<<<
 *         if delegated is None:
 *             return self._mock_side_effect
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delegated = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":564
 *     def __get_side_effect(self):
 *         delegated = self._mock_delegate
 *         if delegated is None:             # <<<<<<<<<<<<<<
 *             return self._mock_side_effect
 *         sf = delegated.side_effect
 */
  __pyx_t_2 = (__pyx_v_delegated == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":565
 *         delegated = self._mock_delegate
 *         if delegated is None:
 *             return self._mock_side_effect             # <<<<<<<<<<<<<<
 *         sf = delegated.side_effect
 *         if (sf is not None and not callable(sf)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_side_effect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":564
 *     def __get_side_effect(self):
 *         delegated = self._mock_delegate
 *         if delegated is None:             # <<<<<<<<<<<<<<
 *             return self._mock_side_effect
 *         sf = delegated.side_effect
 */
  }

  /* "cymock.pyx":566
 *         if delegated is None:
 *             return self._mock_side_effect
 *         sf = delegated.side_effect             # <<<<<<<<<<<<<<
 *         if (sf is not None and not callable(sf)
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_delegated, __pyx_n_s_side_effect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":567
 *             return self._mock_side_effect
 *         sf = delegated.side_effect
 *         if (sf is not None and not callable(sf)             # <<<<<<<<<<<<<<
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):
 *             sf = _MockIter(sf)
 */
  __pyx_t_2 = (__pyx_v_sf != Py_None);
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cymock.pyx":568
 *         sf = delegated.side_effect
 *         if (sf is not None and not callable(sf)
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):             # <<<<<<<<<<<<<<
 *             sf = _MockIter(sf)
 *             delegated.side_effect = sf
 */
  __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_sf); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 567, __pyx_L1_error)

  /* "cymock.pyx":567
 *             return self._mock_side_effect
 *         sf = delegated.side_effect
 *         if (sf is not None and not callable(sf)             # <<<<<<<<<<<<<<
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):
 *             sf = _MockIter(sf)
 */
  __pyx_t_2 = ((!(__pyx_t_4 != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }

  /* "cymock.pyx":568
 *         sf = delegated.side_effect
 *         if (sf is not None and not callable(sf)
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):             # <<<<<<<<<<<<<<
 *             sf = _MockIter(sf)
 *             delegated.side_effect = sf
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MockIter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_sf, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_sf) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_sf);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = ((!__pyx_t_4) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;

  /* "cymock.pyx":567
 *             return self._mock_side_effect
 *         sf = delegated.side_effect
 *         if (sf is not None and not callable(sf)             # <<<<<<<<<<<<<<
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):
 *             sf = _MockIter(sf)
 */
  if (__pyx_t_3) {

    /* "cymock.pyx":569
 *         if (sf is not None and not callable(sf)
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):
 *             sf = _MockIter(sf)             # <<<<<<<<<<<<<<
 *             delegated.side_effect = sf
 *         return sf
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_MockIter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_sf) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_sf);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_sf, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":570
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):
 *             sf = _MockIter(sf)
 *             delegated.side_effect = sf             # <<<<<<<<<<<<<<
 *         return sf
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_delegated, __pyx_n_s_side_effect, __pyx_v_sf) < 0) __PYX_ERR(0, 570, __pyx_L1_error)

    /* "cymock.pyx":567
 *             return self._mock_side_effect
 *         sf = delegated.side_effect
 *         if (sf is not None and not callable(sf)             # <<<<<<<<<<<<<<
 *                 and not isinstance(sf, _MockIter) and not _is_exception(sf)):
 *             sf = _MockIter(sf)
 */
  }

  /* "cymock.pyx":571
 *             sf = _MockIter(sf)
 *             delegated.side_effect = sf
 *         return sf             # <<<<<<<<<<<<<<
 * 
 *     def __set_side_effect(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_sf);
  __pyx_r = __pyx_v_sf;
  goto __pyx_L0;

  /* "cymock.pyx":562
 * 
 * 
 *     def __get_side_effect(self):             # <<<<<<<<<<<<<<
 *         delegated = self._mock_delegate
 *         if delegated is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock.NonCallableMock.__get_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delegated);
  __Pyx_XDECREF(__pyx_v_sf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":573
 *         return sf
 * 
 *     def __set_side_effect(self, value):             # <<<<<<<<<<<<<<
 *         value = _try_iter(value)
 *         delegated = self._mock_delegate
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_19__set_side_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_19__set_side_effect = {"__set_side_effect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_19__set_side_effect, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_19__set_side_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set_side_effect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__set_side_effect", 1, 2, 2, 1); __PYX_ERR(0, 573, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__set_side_effect") < 0)) __PYX_ERR(0, 573, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__set_side_effect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 573, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.__set_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_18__set_side_effect(__pyx_self, __pyx_v_self, __pyx_v_value);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_18__set_side_effect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_delegated = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__set_side_effect", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "cymock.pyx":574
 * 
 *     def __set_side_effect(self, value):
 *         value = _try_iter(value)             # <<<<<<<<<<<<<<
 *         delegated = self._mock_delegate
 *         if delegated is None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_try_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":575
 *     def __set_side_effect(self, value):
 *         value = _try_iter(value)
 *         delegated = self._mock_delegate             # <<<<<<<<<<<<<<
 *         if delegated is None:
 *             self._mock_side_effect = value
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_delegate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delegated = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":576
 *         value = _try_iter(value)
 *         delegated = self._mock_delegate
 *         if delegated is None:             # <<<<<<<<<<<<<<
 *             self._mock_side_effect = value
 *         else:
 */
  __pyx_t_4 = (__pyx_v_delegated == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":577
 *         delegated = self._mock_delegate
 *         if delegated is None:
 *             self._mock_side_effect = value             # <<<<<<<<<<<<<<
 *         else:
 *             delegated.side_effect = value
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mock_side_effect, __pyx_v_value) < 0) __PYX_ERR(0, 577, __pyx_L1_error)

    /* "cymock.pyx":576
 *         value = _try_iter(value)
 *         delegated = self._mock_delegate
 *         if delegated is None:             # <<<<<<<<<<<<<<
 *             self._mock_side_effect = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":579
 *             self._mock_side_effect = value
 *         else:
 *             delegated.side_effect = value             # <<<<<<<<<<<<<<
 * 
 *     side_effect = property(__get_side_effect, __set_side_effect)
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_delegated, __pyx_n_s_side_effect, __pyx_v_value) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "cymock.pyx":573
 *         return sf
 * 
 *     def __set_side_effect(self, value):             # <<<<<<<<<<<<<<
 *         value = _try_iter(value)
 *         delegated = self._mock_delegate
 */

  /* 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_AddTraceback("cymock.NonCallableMock.__set_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delegated);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":584
 * 
 * 
 *     def reset_mock(self,  visited=None,*, return_value=False, side_effect=False):             # <<<<<<<<<<<<<<
 *         "Restore the mock object to its initial state."
 *         if visited is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_21reset_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_20reset_mock[] = "Restore the mock object to its initial state.";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_21reset_mock = {"reset_mock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_21reset_mock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_20reset_mock};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_21reset_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_visited = 0;
  PyObject *__pyx_v_return_value = 0;
  PyObject *__pyx_v_side_effect = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_mock (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_visited,&__pyx_n_s_return_value,&__pyx_n_s_side_effect,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_visited);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (kw_args > 0 && likely(kw_args <= 2)) {
        Py_ssize_t index;
        for (index = 2; index < 4 && kw_args > 0; index++) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
          if (value) { values[index] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reset_mock") < 0)) __PYX_ERR(0, 584, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_visited = values[1];
    __pyx_v_return_value = values[2];
    __pyx_v_side_effect = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reset_mock", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.reset_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_20reset_mock(__pyx_self, __pyx_v_self, __pyx_v_visited, __pyx_v_return_value, __pyx_v_side_effect);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_20reset_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_visited, PyObject *__pyx_v_return_value, PyObject *__pyx_v_side_effect) {
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("reset_mock", 0);
  __Pyx_INCREF(__pyx_v_visited);

  /* "cymock.pyx":586
 *     def reset_mock(self,  visited=None,*, return_value=False, side_effect=False):
 *         "Restore the mock object to its initial state."
 *         if visited is None:             # <<<<<<<<<<<<<<
 *             visited = []
 *         if id(self) in visited:
 */
  __pyx_t_1 = (__pyx_v_visited == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":587
 *         "Restore the mock object to its initial state."
 *         if visited is None:
 *             visited = []             # <<<<<<<<<<<<<<
 *         if id(self) in visited:
 *             return
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_visited, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":586
 *     def reset_mock(self,  visited=None,*, return_value=False, side_effect=False):
 *         "Restore the mock object to its initial state."
 *         if visited is None:             # <<<<<<<<<<<<<<
 *             visited = []
 *         if id(self) in visited:
 */
  }

  /* "cymock.pyx":588
 *         if visited is None:
 *             visited = []
 *         if id(self) in visited:             # <<<<<<<<<<<<<<
 *             return
 *         visited.append(id(self))
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_visited, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cymock.pyx":589
 *             visited = []
 *         if id(self) in visited:
 *             return             # <<<<<<<<<<<<<<
 *         visited.append(id(self))
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cymock.pyx":588
 *         if visited is None:
 *             visited = []
 *         if id(self) in visited:             # <<<<<<<<<<<<<<
 *             return
 *         visited.append(id(self))
 */
  }

  /* "cymock.pyx":590
 *         if id(self) in visited:
 *             return
 *         visited.append(id(self))             # <<<<<<<<<<<<<<
 * 
 *         self.called = False
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_visited, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":592
 *         visited.append(id(self))
 * 
 *         self.called = False             # <<<<<<<<<<<<<<
 *         self.call_args = None
 *         self.call_count = 0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_called, Py_False) < 0) __PYX_ERR(0, 592, __pyx_L1_error)

  /* "cymock.pyx":593
 * 
 *         self.called = False
 *         self.call_args = None             # <<<<<<<<<<<<<<
 *         self.call_count = 0
 *         self.mock_calls = _CallList()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_call_args, Py_None) < 0) __PYX_ERR(0, 593, __pyx_L1_error)

  /* "cymock.pyx":594
 *         self.called = False
 *         self.call_args = None
 *         self.call_count = 0             # <<<<<<<<<<<<<<
 *         self.mock_calls = _CallList()
 *         self.call_args_list = _CallList()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_call_count, __pyx_int_0) < 0) __PYX_ERR(0, 594, __pyx_L1_error)

  /* "cymock.pyx":595
 *         self.call_args = None
 *         self.call_count = 0
 *         self.mock_calls = _CallList()             # <<<<<<<<<<<<<<
 *         self.call_args_list = _CallList()
 *         self.method_calls = _CallList()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CallList); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mock_calls, __pyx_t_3) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":596
 *         self.call_count = 0
 *         self.mock_calls = _CallList()
 *         self.call_args_list = _CallList()             # <<<<<<<<<<<<<<
 *         self.method_calls = _CallList()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CallList); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_call_args_list, __pyx_t_3) < 0) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":597
 *         self.mock_calls = _CallList()
 *         self.call_args_list = _CallList()
 *         self.method_calls = _CallList()             # <<<<<<<<<<<<<<
 * 
 *         if return_value:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CallList); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_method_calls, __pyx_t_3) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":599
 *         self.method_calls = _CallList()
 * 
 *         if return_value:             # <<<<<<<<<<<<<<
 *             self._mock_return_value = DEFAULT
 *         if side_effect:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_return_value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 599, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cymock.pyx":600
 * 
 *         if return_value:
 *             self._mock_return_value = DEFAULT             # <<<<<<<<<<<<<<
 *         if side_effect:
 *             self._mock_side_effect = None
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mock_return_value, __pyx_t_3) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":599
 *         self.method_calls = _CallList()
 * 
 *         if return_value:             # <<<<<<<<<<<<<<
 *             self._mock_return_value = DEFAULT
 *         if side_effect:
 */
  }

  /* "cymock.pyx":601
 *         if return_value:
 *             self._mock_return_value = DEFAULT
 *         if side_effect:             # <<<<<<<<<<<<<<
 *             self._mock_side_effect = None
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_side_effect); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 601, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "cymock.pyx":602
 *             self._mock_return_value = DEFAULT
 *         if side_effect:
 *             self._mock_side_effect = None             # <<<<<<<<<<<<<<
 * 
 *         for child in self._mock_children.values():
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mock_side_effect, Py_None) < 0) __PYX_ERR(0, 602, __pyx_L1_error)

    /* "cymock.pyx":601
 *         if return_value:
 *             self._mock_return_value = DEFAULT
 *         if side_effect:             # <<<<<<<<<<<<<<
 *             self._mock_side_effect = None
 * 
 */
  }

  /* "cymock.pyx":604
 *             self._mock_side_effect = None
 * 
 *         for child in self._mock_children.values():             # <<<<<<<<<<<<<<
 *             if isinstance(child, _SpecState) or child is _deleted:
 *                 continue
 */
  __pyx_t_7 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
    __PYX_ERR(0, 604, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_values, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XDECREF(__pyx_t_3);
  __pyx_t_3 = __pyx_t_6;
  __pyx_t_6 = 0;
  while (1) {
    __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_8, &__pyx_t_7, NULL, &__pyx_t_6, NULL, __pyx_t_9);
    if (unlikely(__pyx_t_10 == 0)) break;
    if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cymock.pyx":605
 * 
 *         for child in self._mock_children.values():
 *             if isinstance(child, _SpecState) or child is _deleted:             # <<<<<<<<<<<<<<
 *                 continue
 *             child.reset_mock(visited)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_SpecState); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_child, __pyx_t_6); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = (__pyx_t_2 != 0);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L10_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_deleted); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = (__pyx_v_child == __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = (__pyx_t_11 != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_1) {

      /* "cymock.pyx":606
 *         for child in self._mock_children.values():
 *             if isinstance(child, _SpecState) or child is _deleted:
 *                 continue             # <<<<<<<<<<<<<<
 *             child.reset_mock(visited)
 * 
 */
      goto __pyx_L7_continue;

      /* "cymock.pyx":605
 * 
 *         for child in self._mock_children.values():
 *             if isinstance(child, _SpecState) or child is _deleted:             # <<<<<<<<<<<<<<
 *                 continue
 *             child.reset_mock(visited)
 */
    }

    /* "cymock.pyx":607
 *             if isinstance(child, _SpecState) or child is _deleted:
 *                 continue
 *             child.reset_mock(visited)             # <<<<<<<<<<<<<<
 * 
 *         ret = self._mock_return_value
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_reset_mock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_12, __pyx_v_visited) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_visited);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_L7_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":609
 *             child.reset_mock(visited)
 * 
 *         ret = self._mock_return_value             # <<<<<<<<<<<<<<
 *         if _is_instance_mock(ret) and ret is not self:
 *             ret.reset_mock(visited)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_return_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ret = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":610
 * 
 *         ret = self._mock_return_value
 *         if _is_instance_mock(ret) and ret is not self:             # <<<<<<<<<<<<<<
 *             ret.reset_mock(visited)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_is_instance_mock); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_ret) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_ret);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_ret != __pyx_v_self);
  __pyx_t_11 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_11;
  __pyx_L13_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cymock.pyx":611
 *         ret = self._mock_return_value
 *         if _is_instance_mock(ret) and ret is not self:
 *             ret.reset_mock(visited)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ret, __pyx_n_s_reset_mock); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_visited) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_visited);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":610
 * 
 *         ret = self._mock_return_value
 *         if _is_instance_mock(ret) and ret is not self:             # <<<<<<<<<<<<<<
 *             ret.reset_mock(visited)
 * 
 */
  }

  /* "cymock.pyx":584
 * 
 * 
 *     def reset_mock(self,  visited=None,*, return_value=False, side_effect=False):             # <<<<<<<<<<<<<<
 *         "Restore the mock object to its initial state."
 *         if visited is None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cymock.NonCallableMock.reset_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XDECREF(__pyx_v_visited);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":614
 * 
 * 
 *     def configure_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """Set attributes on the mock through keyword arguments.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_23configure_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_22configure_mock[] = "Set attributes on the mock through keyword arguments.\n\n        Attributes plus return values and side effects can be set on child\n        mocks using standard dot notation and unpacking a dictionary in the\n        method call:\n\n        >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}\n        >>> mock.configure_mock(**attrs)";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_23configure_mock = {"configure_mock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_23configure_mock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_22configure_mock};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_23configure_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("configure_mock (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "configure_mock") < 0)) __PYX_ERR(0, 614, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("configure_mock", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 614, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.NonCallableMock.configure_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_22configure_mock(__pyx_self, __pyx_v_self, __pyx_v_kwargs);

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

/* "cymock.pyx":627
 *                                # attributes are set before we set attributes on
 *                                # attributes
 *                                key=lambda entry: entry[0].count('.')):             # <<<<<<<<<<<<<<
 *             args = arg.split('.')
 *             final = args.pop()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_14configure_mock_lambda(PyObject *__pyx_self, PyObject *__pyx_v_entry); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_14configure_mock_lambda = {"lambda", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_14configure_mock_lambda, METH_O, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_14configure_mock_lambda(PyObject *__pyx_self, PyObject *__pyx_v_entry) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_entry));

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

static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_entry) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_entry, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_u__33) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u__33);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock.NonCallableMock.configure_mock.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":614
 * 
 * 
 *     def configure_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """Set attributes on the mock through keyword arguments.
 * 
 */

static PyObject *__pyx_pf_6cymock_15NonCallableMock_22configure_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_final = NULL;
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_v_entry = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("configure_mock", 0);

  /* "cymock.pyx":623
 *         >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
 *         >>> mock.configure_mock(**attrs)"""
 *         for arg, val in sorted(kwargs.items(),             # <<<<<<<<<<<<<<
 *                                # we sort on the number of dots so that
 *                                # attributes are set before we set attributes on
 */
  __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":627
 *                                # attributes are set before we set attributes on
 *                                # attributes
 *                                key=lambda entry: entry[0].count('.')):             # <<<<<<<<<<<<<<
 *             args = arg.split('.')
 *             final = args.pop()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_14configure_mock_lambda, 0, __pyx_n_s_NonCallableMock_configure_mock_l, NULL, __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":623
 *         >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
 *         >>> mock.configure_mock(**attrs)"""
 *         for arg, val in sorted(kwargs.items(),             # <<<<<<<<<<<<<<
 *                                # we sort on the number of dots so that
 *                                # attributes are set before we set attributes on
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 623, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 623, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 623, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cymock.pyx":628
 *                                # attributes
 *                                key=lambda entry: entry[0].count('.')):
 *             args = arg.split('.')             # <<<<<<<<<<<<<<
 *             final = args.pop()
 *             obj = self
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_kp_u__33) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u__33);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":629
 *                                key=lambda entry: entry[0].count('.')):
 *             args = arg.split('.')
 *             final = args.pop()             # <<<<<<<<<<<<<<
 *             obj = self
 *             for entry in args:
 */
    __pyx_t_3 = __Pyx_PyObject_Pop(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_final, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":630
 *             args = arg.split('.')
 *             final = args.pop()
 *             obj = self             # <<<<<<<<<<<<<<
 *             for entry in args:
 *                 obj = getattr(obj, entry)
 */
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_v_self);

    /* "cymock.pyx":631
 *             final = args.pop()
 *             obj = self
 *             for entry in args:             # <<<<<<<<<<<<<<
 *                 obj = getattr(obj, entry)
 *             setattr(obj, final, val)
 */
    if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) {
      __pyx_t_3 = __pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 631, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 631, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 631, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_10(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 631, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cymock.pyx":632
 *             obj = self
 *             for entry in args:
 *                 obj = getattr(obj, entry)             # <<<<<<<<<<<<<<
 *             setattr(obj, final, val)
 * 
 */
      __pyx_t_6 = __Pyx_GetAttr(__pyx_v_obj, __pyx_v_entry); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cymock.pyx":631
 *             final = args.pop()
 *             obj = self
 *             for entry in args:             # <<<<<<<<<<<<<<
 *                 obj = getattr(obj, entry)
 *             setattr(obj, final, val)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":633
 *             for entry in args:
 *                 obj = getattr(obj, entry)
 *             setattr(obj, final, val)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_11 = PyObject_SetAttr(__pyx_v_obj, __pyx_v_final, __pyx_v_val); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 633, __pyx_L1_error)

    /* "cymock.pyx":623
 *         >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
 *         >>> mock.configure_mock(**attrs)"""
 *         for arg, val in sorted(kwargs.items(),             # <<<<<<<<<<<<<<
 *                                # we sort on the number of dots so that
 *                                # attributes are set before we set attributes on
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":614
 * 
 * 
 *     def configure_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """Set attributes on the mock through keyword arguments.
 * 
 */

  /* 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("cymock.NonCallableMock.configure_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_final);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_entry);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":636
 * 
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name in {'_mock_methods', '_mock_unsafe'}:
 *             raise AttributeError(name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_25__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_25__getattr__ = {"__getattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_25__getattr__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_25__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 636, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 636, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_24__getattr__(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_24__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_wraps = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "cymock.pyx":637
 * 
 *     def __getattr__(self, name):
 *         if name in {'_mock_methods', '_mock_unsafe'}:             # <<<<<<<<<<<<<<
 *             raise AttributeError(name)
 *         elif self._mock_methods is not None:
 */
  __Pyx_INCREF(__pyx_v_name);
  __pyx_t_1 = __pyx_v_name;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_mock_methods, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_mock_unsafe, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":638
 *     def __getattr__(self, name):
 *         if name in {'_mock_methods', '_mock_unsafe'}:
 *             raise AttributeError(name)             # <<<<<<<<<<<<<<
 *         elif self._mock_methods is not None:
 *             if name not in self._mock_methods or name in _all_magics:
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 638, __pyx_L1_error)

    /* "cymock.pyx":637
 * 
 *     def __getattr__(self, name):
 *         if name in {'_mock_methods', '_mock_unsafe'}:             # <<<<<<<<<<<<<<
 *             raise AttributeError(name)
 *         elif self._mock_methods is not None:
 */
  }

  /* "cymock.pyx":639
 *         if name in {'_mock_methods', '_mock_unsafe'}:
 *             raise AttributeError(name)
 *         elif self._mock_methods is not None:             # <<<<<<<<<<<<<<
 *             if name not in self._mock_methods or name in _all_magics:
 *                 raise AttributeError("Mock object has no attribute %r" % name)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":640
 *             raise AttributeError(name)
 *         elif self._mock_methods is not None:
 *             if name not in self._mock_methods or name in _all_magics:             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Mock object has no attribute %r" % name)
 *         elif _is_magic(name):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 640, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L7_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_all_magics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 640, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__pyx_t_4 != 0);
    __pyx_t_2 = __pyx_t_3;
    __pyx_L7_bool_binop_done:;
    if (unlikely(__pyx_t_2)) {

      /* "cymock.pyx":641
 *         elif self._mock_methods is not None:
 *             if name not in self._mock_methods or name in _all_magics:
 *                 raise AttributeError("Mock object has no attribute %r" % name)             # <<<<<<<<<<<<<<
 *         elif _is_magic(name):
 *             raise AttributeError(name)
 */
      __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Mock_object_has_no_attribute_r, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 641, __pyx_L1_error)

      /* "cymock.pyx":640
 *             raise AttributeError(name)
 *         elif self._mock_methods is not None:
 *             if name not in self._mock_methods or name in _all_magics:             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Mock object has no attribute %r" % name)
 *         elif _is_magic(name):
 */
    }

    /* "cymock.pyx":639
 *         if name in {'_mock_methods', '_mock_unsafe'}:
 *             raise AttributeError(name)
 *         elif self._mock_methods is not None:             # <<<<<<<<<<<<<<
 *             if name not in self._mock_methods or name in _all_magics:
 *                 raise AttributeError("Mock object has no attribute %r" % name)
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":642
 *             if name not in self._mock_methods or name in _all_magics:
 *                 raise AttributeError("Mock object has no attribute %r" % name)
 *         elif _is_magic(name):             # <<<<<<<<<<<<<<
 *             raise AttributeError(name)
 *         if not self._mock_unsafe:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_magic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "cymock.pyx":643
 *                 raise AttributeError("Mock object has no attribute %r" % name)
 *         elif _is_magic(name):
 *             raise AttributeError(name)             # <<<<<<<<<<<<<<
 *         if not self._mock_unsafe:
 *             if name.startswith(('assert', 'assret')):
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 643, __pyx_L1_error)

    /* "cymock.pyx":642
 *             if name not in self._mock_methods or name in _all_magics:
 *                 raise AttributeError("Mock object has no attribute %r" % name)
 *         elif _is_magic(name):             # <<<<<<<<<<<<<<
 *             raise AttributeError(name)
 *         if not self._mock_unsafe:
 */
  }
  __pyx_L3:;

  /* "cymock.pyx":644
 *         elif _is_magic(name):
 *             raise AttributeError(name)
 *         if not self._mock_unsafe:             # <<<<<<<<<<<<<<
 *             if name.startswith(('assert', 'assret')):
 *                 raise AttributeError("Attributes cannot start with 'assert' "
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_unsafe); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":645
 *             raise AttributeError(name)
 *         if not self._mock_unsafe:
 *             if name.startswith(('assert', 'assret')):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Attributes cannot start with 'assert' "
 *                                      "or 'assret'")
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_tuple__34) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_tuple__34);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_t_3)) {

      /* "cymock.pyx":646
 *         if not self._mock_unsafe:
 *             if name.startswith(('assert', 'assret')):
 *                 raise AttributeError("Attributes cannot start with 'assert' "             # <<<<<<<<<<<<<<
 *                                      "or 'assret'")
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 646, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 646, __pyx_L1_error)

      /* "cymock.pyx":645
 *             raise AttributeError(name)
 *         if not self._mock_unsafe:
 *             if name.startswith(('assert', 'assret')):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Attributes cannot start with 'assert' "
 *                                      "or 'assret'")
 */
    }

    /* "cymock.pyx":644
 *         elif _is_magic(name):
 *             raise AttributeError(name)
 *         if not self._mock_unsafe:             # <<<<<<<<<<<<<<
 *             if name.startswith(('assert', 'assret')):
 *                 raise AttributeError("Attributes cannot start with 'assert' "
 */
  }

  /* "cymock.pyx":649
 *                                      "or 'assret'")
 * 
 *         result = self._mock_children.get(name)             # <<<<<<<<<<<<<<
 *         if result is _deleted:
 *             raise AttributeError(name)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_result = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cymock.pyx":650
 * 
 *         result = self._mock_children.get(name)
 *         if result is _deleted:             # <<<<<<<<<<<<<<
 *             raise AttributeError(name)
 *         elif result is None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_deleted); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = (__pyx_v_result == __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "cymock.pyx":651
 *         result = self._mock_children.get(name)
 *         if result is _deleted:
 *             raise AttributeError(name)             # <<<<<<<<<<<<<<
 *         elif result is None:
 *             wraps = None
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 651, __pyx_L1_error)

    /* "cymock.pyx":650
 * 
 *         result = self._mock_children.get(name)
 *         if result is _deleted:             # <<<<<<<<<<<<<<
 *             raise AttributeError(name)
 *         elif result is None:
 */
  }

  /* "cymock.pyx":652
 *         if result is _deleted:
 *             raise AttributeError(name)
 *         elif result is None:             # <<<<<<<<<<<<<<
 *             wraps = None
 *             if self._mock_wraps is not None:
 */
  __pyx_t_2 = (__pyx_v_result == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":653
 *             raise AttributeError(name)
 *         elif result is None:
 *             wraps = None             # <<<<<<<<<<<<<<
 *             if self._mock_wraps is not None:
 *                 # XXXX should we get the attribute without triggering code
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_wraps = Py_None;

    /* "cymock.pyx":654
 *         elif result is None:
 *             wraps = None
 *             if self._mock_wraps is not None:             # <<<<<<<<<<<<<<
 *                 # XXXX should we get the attribute without triggering code
 *                 # execution?
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_wraps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = (__pyx_t_5 != Py_None);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "cymock.pyx":657
 *                 # XXXX should we get the attribute without triggering code
 *                 # execution?
 *                 wraps = getattr(self._mock_wraps, name)             # <<<<<<<<<<<<<<
 * 
 *             result = self._get_child_mock(
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_wraps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_GetAttr(__pyx_t_5, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_wraps, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cymock.pyx":654
 *         elif result is None:
 *             wraps = None
 *             if self._mock_wraps is not None:             # <<<<<<<<<<<<<<
 *                 # XXXX should we get the attribute without triggering code
 *                 # execution?
 */
    }

    /* "cymock.pyx":659
 *                 wraps = getattr(self._mock_wraps, name)
 * 
 *             result = self._get_child_mock(             # <<<<<<<<<<<<<<
 *                 parent=self, name=name, wraps=wraps, _new_name=name,
 *                 _new_parent=self
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_child_mock); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "cymock.pyx":660
 * 
 *             result = self._get_child_mock(
 *                 parent=self, name=name, wraps=wraps, _new_name=name,             # <<<<<<<<<<<<<<
 *                 _new_parent=self
 *             )
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_parent, __pyx_v_self) < 0) __PYX_ERR(0, 660, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 660, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_wraps, __pyx_v_wraps) < 0) __PYX_ERR(0, 660, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_new_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 660, __pyx_L1_error)

    /* "cymock.pyx":661
 *             result = self._get_child_mock(
 *                 parent=self, name=name, wraps=wraps, _new_name=name,
 *                 _new_parent=self             # <<<<<<<<<<<<<<
 *             )
 *             self._mock_children[name]  = result
 */
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_new_parent, __pyx_v_self) < 0) __PYX_ERR(0, 660, __pyx_L1_error)

    /* "cymock.pyx":659
 *                 wraps = getattr(self._mock_wraps, name)
 * 
 *             result = self._get_child_mock(             # <<<<<<<<<<<<<<
 *                 parent=self, name=name, wraps=wraps, _new_name=name,
 *                 _new_parent=self
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":663
 *                 _new_parent=self
 *             )
 *             self._mock_children[name]  = result             # <<<<<<<<<<<<<<
 * 
 *         elif isinstance(result, _SpecState):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_result) < 0)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":652
 *         if result is _deleted:
 *             raise AttributeError(name)
 *         elif result is None:             # <<<<<<<<<<<<<<
 *             wraps = None
 *             if self._mock_wraps is not None:
 */
    goto __pyx_L11;
  }

  /* "cymock.pyx":665
 *             self._mock_children[name]  = result
 * 
 *         elif isinstance(result, _SpecState):             # <<<<<<<<<<<<<<
 *             result = create_autospec(
 *                 result.spec, result.spec_set, result.instance,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SpecState); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":666
 * 
 *         elif isinstance(result, _SpecState):
 *             result = create_autospec(             # <<<<<<<<<<<<<<
 *                 result.spec, result.spec_set, result.instance,
 *                 result.parent, result.name
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_create_autospec); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "cymock.pyx":667
 *         elif isinstance(result, _SpecState):
 *             result = create_autospec(
 *                 result.spec, result.spec_set, result.instance,             # <<<<<<<<<<<<<<
 *                 result.parent, result.name
 *             )
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_spec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_spec_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_instance); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "cymock.pyx":668
 *             result = create_autospec(
 *                 result.spec, result.spec_set, result.instance,
 *                 result.parent, result.name             # <<<<<<<<<<<<<<
 *             )
 *             self._mock_children[name]  = result
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_parent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_name_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = NULL;
    __pyx_t_12 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_12 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[6] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_12, 5+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[6] = {__pyx_t_11, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_12, 5+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else
    #endif
    {
      __pyx_t_13 = PyTuple_New(5+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (__pyx_t_11) {
        __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_12, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_12, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_12, __pyx_t_10);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;
      __pyx_t_10 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":670
 *                 result.parent, result.name
 *             )
 *             self._mock_children[name]  = result             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_result) < 0)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":665
 *             self._mock_children[name]  = result
 * 
 *         elif isinstance(result, _SpecState):             # <<<<<<<<<<<<<<
 *             result = create_autospec(
 *                 result.spec, result.spec_set, result.instance,
 */
  }
  __pyx_L11:;

  /* "cymock.pyx":672
 *             self._mock_children[name]  = result
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cymock.pyx":636
 * 
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name in {'_mock_methods', '_mock_unsafe'}:
 *             raise AttributeError(name)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cymock.NonCallableMock.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_wraps);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":675
 * 
 * 
 *     def _extract_mock_name(self):             # <<<<<<<<<<<<<<
 *         _name_list = [self._mock_new_name]
 *         _parent = self._mock_new_parent
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_27_extract_mock_name(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_27_extract_mock_name = {"_extract_mock_name", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_27_extract_mock_name, METH_O, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_27_extract_mock_name(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_extract_mock_name (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_26_extract_mock_name(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_26_extract_mock_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v__name_list = NULL;
  PyObject *__pyx_v__parent = NULL;
  PyObject *__pyx_v_last = NULL;
  PyObject *__pyx_v_dot = NULL;
  PyObject *__pyx_v__first = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("_extract_mock_name", 0);

  /* "cymock.pyx":676
 * 
 *     def _extract_mock_name(self):
 *         _name_list = [self._mock_new_name]             # <<<<<<<<<<<<<<
 *         _parent = self._mock_new_parent
 *         last = self
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_new_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v__name_list = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cymock.pyx":677
 *     def _extract_mock_name(self):
 *         _name_list = [self._mock_new_name]
 *         _parent = self._mock_new_parent             # <<<<<<<<<<<<<<
 *         last = self
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_new_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v__parent = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":678
 *         _name_list = [self._mock_new_name]
 *         _parent = self._mock_new_parent
 *         last = self             # <<<<<<<<<<<<<<
 * 
 *         dot = '.'
 */
  __Pyx_INCREF(__pyx_v_self);
  __pyx_v_last = __pyx_v_self;

  /* "cymock.pyx":680
 *         last = self
 * 
 *         dot = '.'             # <<<<<<<<<<<<<<
 *         if _name_list == ['()']:
 *             dot = ''
 */
  __Pyx_INCREF(__pyx_kp_u__33);
  __pyx_v_dot = __pyx_kp_u__33;

  /* "cymock.pyx":681
 * 
 *         dot = '.'
 *         if _name_list == ['()']:             # <<<<<<<<<<<<<<
 *             dot = ''
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_kp_u__32);
  __Pyx_GIVEREF(__pyx_kp_u__32);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__32);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v__name_list, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "cymock.pyx":682
 *         dot = '.'
 *         if _name_list == ['()']:
 *             dot = ''             # <<<<<<<<<<<<<<
 * 
 *         while _parent is not None:
 */
    __Pyx_INCREF(__pyx_kp_u__31);
    __Pyx_DECREF_SET(__pyx_v_dot, __pyx_kp_u__31);

    /* "cymock.pyx":681
 * 
 *         dot = '.'
 *         if _name_list == ['()']:             # <<<<<<<<<<<<<<
 *             dot = ''
 * 
 */
  }

  /* "cymock.pyx":684
 *             dot = ''
 * 
 *         while _parent is not None:             # <<<<<<<<<<<<<<
 *             last = _parent
 * 
 */
  while (1) {
    __pyx_t_3 = (__pyx_v__parent != Py_None);
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (!__pyx_t_4) break;

    /* "cymock.pyx":685
 * 
 *         while _parent is not None:
 *             last = _parent             # <<<<<<<<<<<<<<
 * 
 *             _name_list.append(_parent._mock_new_name + dot)
 */
    __Pyx_INCREF(__pyx_v__parent);
    __Pyx_DECREF_SET(__pyx_v_last, __pyx_v__parent);

    /* "cymock.pyx":687
 *             last = _parent
 * 
 *             _name_list.append(_parent._mock_new_name + dot)             # <<<<<<<<<<<<<<
 *             dot = '.'
 *             if _parent._mock_new_name == '()':
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__parent, __pyx_n_s_mock_new_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_dot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v__name_list, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cymock.pyx":688
 * 
 *             _name_list.append(_parent._mock_new_name + dot)
 *             dot = '.'             # <<<<<<<<<<<<<<
 *             if _parent._mock_new_name == '()':
 *                 dot = ''
 */
    __Pyx_INCREF(__pyx_kp_u__33);
    __Pyx_DECREF_SET(__pyx_v_dot, __pyx_kp_u__33);

    /* "cymock.pyx":689
 *             _name_list.append(_parent._mock_new_name + dot)
 *             dot = '.'
 *             if _parent._mock_new_name == '()':             # <<<<<<<<<<<<<<
 *                 dot = ''
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__parent, __pyx_n_s_mock_new_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_kp_u__32, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "cymock.pyx":690
 *             dot = '.'
 *             if _parent._mock_new_name == '()':
 *                 dot = ''             # <<<<<<<<<<<<<<
 * 
 *             _parent = _parent._mock_new_parent
 */
      __Pyx_INCREF(__pyx_kp_u__31);
      __Pyx_DECREF_SET(__pyx_v_dot, __pyx_kp_u__31);

      /* "cymock.pyx":689
 *             _name_list.append(_parent._mock_new_name + dot)
 *             dot = '.'
 *             if _parent._mock_new_name == '()':             # <<<<<<<<<<<<<<
 *                 dot = ''
 * 
 */
    }

    /* "cymock.pyx":692
 *                 dot = ''
 * 
 *             _parent = _parent._mock_new_parent             # <<<<<<<<<<<<<<
 * 
 *         _name_list = list(reversed(_name_list))
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__parent, __pyx_n_s_mock_new_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v__parent, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "cymock.pyx":694
 *             _parent = _parent._mock_new_parent
 * 
 *         _name_list = list(reversed(_name_list))             # <<<<<<<<<<<<<<
 *         _first = last._mock_name or 'mock'
 *         if len(_name_list) > 1:
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_v__name_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v__name_list, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "cymock.pyx":695
 * 
 *         _name_list = list(reversed(_name_list))
 *         _first = last._mock_name or 'mock'             # <<<<<<<<<<<<<<
 *         if len(_name_list) > 1:
 *             if _name_list[1] not in ('()', '().'):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_last, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 695, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L7_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_n_u_mock);
  __pyx_t_1 = __pyx_n_u_mock;
  __pyx_L7_bool_binop_done:;
  __pyx_v__first = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":696
 *         _name_list = list(reversed(_name_list))
 *         _first = last._mock_name or 'mock'
 *         if len(_name_list) > 1:             # <<<<<<<<<<<<<<
 *             if _name_list[1] not in ('()', '().'):
 *                 _first += '.'
 */
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v__name_list); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 696, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_6 > 1) != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":697
 *         _first = last._mock_name or 'mock'
 *         if len(_name_list) > 1:
 *             if _name_list[1] not in ('()', '().'):             # <<<<<<<<<<<<<<
 *                 _first += '.'
 *         _name_list[0] = _first
 */
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v__name_list, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__32, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 697, __pyx_L1_error)
    if (__pyx_t_3) {
    } else {
      __pyx_t_4 = __pyx_t_3;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__36, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 697, __pyx_L1_error)
    __pyx_t_4 = __pyx_t_3;
    __pyx_L11_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "cymock.pyx":698
 *         if len(_name_list) > 1:
 *             if _name_list[1] not in ('()', '().'):
 *                 _first += '.'             # <<<<<<<<<<<<<<
 *         _name_list[0] = _first
 *         return ''.join(_name_list)
 */
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v__first, __pyx_kp_u__33); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v__first, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cymock.pyx":697
 *         _first = last._mock_name or 'mock'
 *         if len(_name_list) > 1:
 *             if _name_list[1] not in ('()', '().'):             # <<<<<<<<<<<<<<
 *                 _first += '.'
 *         _name_list[0] = _first
 */
    }

    /* "cymock.pyx":696
 *         _name_list = list(reversed(_name_list))
 *         _first = last._mock_name or 'mock'
 *         if len(_name_list) > 1:             # <<<<<<<<<<<<<<
 *             if _name_list[1] not in ('()', '().'):
 *                 _first += '.'
 */
  }

  /* "cymock.pyx":699
 *             if _name_list[1] not in ('()', '().'):
 *                 _first += '.'
 *         _name_list[0] = _first             # <<<<<<<<<<<<<<
 *         return ''.join(_name_list)
 * 
 */
  if (unlikely(__Pyx_SetItemInt(__pyx_v__name_list, 0, __pyx_v__first, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 699, __pyx_L1_error)

  /* "cymock.pyx":700
 *                 _first += '.'
 *         _name_list[0] = _first
 *         return ''.join(_name_list)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__31, __pyx_v__name_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":675
 * 
 * 
 *     def _extract_mock_name(self):             # <<<<<<<<<<<<<<
 *         _name_list = [self._mock_new_name]
 *         _parent = self._mock_new_parent
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.NonCallableMock._extract_mock_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__name_list);
  __Pyx_XDECREF(__pyx_v__parent);
  __Pyx_XDECREF(__pyx_v_last);
  __Pyx_XDECREF(__pyx_v_dot);
  __Pyx_XDECREF(__pyx_v__first);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":702
 *         return ''.join(_name_list)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         name = self._extract_mock_name()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_29__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_29__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_29__repr__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_29__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_28__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_28__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_name_string = NULL;
  PyObject *__pyx_v_spec_string = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cymock.pyx":703
 * 
 *     def __repr__(self):
 *         name = self._extract_mock_name()             # <<<<<<<<<<<<<<
 * 
 *         name_string = ''
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extract_mock_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":705
 *         name = self._extract_mock_name()
 * 
 *         name_string = ''             # <<<<<<<<<<<<<<
 *         if name not in ('mock', 'mock.'):
 *             name_string = ' name=%r' % name
 */
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_v_name_string = __pyx_kp_u__31;

  /* "cymock.pyx":706
 * 
 *         name_string = ''
 *         if name not in ('mock', 'mock.'):             # <<<<<<<<<<<<<<
 *             name_string = ' name=%r' % name
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __pyx_t_1 = __pyx_v_name;
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_mock, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 706, __pyx_L1_error)
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_mock_3, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 706, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":707
 *         name_string = ''
 *         if name not in ('mock', 'mock.'):
 *             name_string = ' name=%r' % name             # <<<<<<<<<<<<<<
 * 
 *         spec_string = ''
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_name_r, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_name_string, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cymock.pyx":706
 * 
 *         name_string = ''
 *         if name not in ('mock', 'mock.'):             # <<<<<<<<<<<<<<
 *             name_string = ' name=%r' % name
 * 
 */
  }

  /* "cymock.pyx":709
 *             name_string = ' name=%r' % name
 * 
 *         spec_string = ''             # <<<<<<<<<<<<<<
 *         if self._spec_class is not None:
 *             spec_string = ' spec=%r'
 */
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_v_spec_string = __pyx_kp_u__31;

  /* "cymock.pyx":710
 * 
 *         spec_string = ''
 *         if self._spec_class is not None:             # <<<<<<<<<<<<<<
 *             spec_string = ' spec=%r'
 *             if self._spec_set:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":711
 *         spec_string = ''
 *         if self._spec_class is not None:
 *             spec_string = ' spec=%r'             # <<<<<<<<<<<<<<
 *             if self._spec_set:
 *                 spec_string = ' spec_set=%r'
 */
    __Pyx_INCREF(__pyx_kp_u_spec_r);
    __Pyx_DECREF_SET(__pyx_v_spec_string, __pyx_kp_u_spec_r);

    /* "cymock.pyx":712
 *         if self._spec_class is not None:
 *             spec_string = ' spec=%r'
 *             if self._spec_set:             # <<<<<<<<<<<<<<
 *                 spec_string = ' spec_set=%r'
 *             spec_string = spec_string % self._spec_class.__name__
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 712, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "cymock.pyx":713
 *             spec_string = ' spec=%r'
 *             if self._spec_set:
 *                 spec_string = ' spec_set=%r'             # <<<<<<<<<<<<<<
 *             spec_string = spec_string % self._spec_class.__name__
 *         return "<%s%s%s id='%s'>" % (
 */
      __Pyx_INCREF(__pyx_kp_u_spec_set_r);
      __Pyx_DECREF_SET(__pyx_v_spec_string, __pyx_kp_u_spec_set_r);

      /* "cymock.pyx":712
 *         if self._spec_class is not None:
 *             spec_string = ' spec=%r'
 *             if self._spec_set:             # <<<<<<<<<<<<<<
 *                 spec_string = ' spec_set=%r'
 *             spec_string = spec_string % self._spec_class.__name__
 */
    }

    /* "cymock.pyx":714
 *             if self._spec_set:
 *                 spec_string = ' spec_set=%r'
 *             spec_string = spec_string % self._spec_class.__name__             # <<<<<<<<<<<<<<
 *         return "<%s%s%s id='%s'>" % (
 *             type(self).__name__,
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __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, 714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_v_spec_string, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_spec_string, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":710
 * 
 *         spec_string = ''
 *         if self._spec_class is not None:             # <<<<<<<<<<<<<<
 *             spec_string = ' spec=%r'
 *             if self._spec_set:
 */
  }

  /* "cymock.pyx":715
 *                 spec_string = ' spec_set=%r'
 *             spec_string = spec_string % self._spec_class.__name__
 *         return "<%s%s%s id='%s'>" % (             # <<<<<<<<<<<<<<
 *             type(self).__name__,
 *             name_string,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __Pyx_INCREF(__pyx_kp_u__37);
  __pyx_t_6 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__37);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__37);

  /* "cymock.pyx":716
 *             spec_string = spec_string % self._spec_class.__name__
 *         return "<%s%s%s id='%s'>" % (
 *             type(self).__name__,             # <<<<<<<<<<<<<<
 *             name_string,
 *             spec_string,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cymock.pyx":717
 *         return "<%s%s%s id='%s'>" % (
 *             type(self).__name__,
 *             name_string,             # <<<<<<<<<<<<<<
 *             spec_string,
 *             id(self)
 */
  __Pyx_INCREF(__pyx_v_name_string);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_name_string) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_name_string) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_name_string);
  __Pyx_GIVEREF(__pyx_v_name_string);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_name_string);

  /* "cymock.pyx":718
 *             type(self).__name__,
 *             name_string,
 *             spec_string,             # <<<<<<<<<<<<<<
 *             id(self)
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_spec_string), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_INCREF(__pyx_kp_u_id_2);
  __pyx_t_6 += 5;
  __Pyx_GIVEREF(__pyx_kp_u_id_2);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_id_2);

  /* "cymock.pyx":719
 *             name_string,
 *             spec_string,
 *             id(self)             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_3), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_kp_u__38);
  __pyx_t_6 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__38);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__38);

  /* "cymock.pyx":715
 *                 spec_string = ' spec_set=%r'
 *             spec_string = spec_string % self._spec_class.__name__
 *         return "<%s%s%s id='%s'>" % (             # <<<<<<<<<<<<<<
 *             type(self).__name__,
 *             name_string,
 */
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __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;

  /* "cymock.pyx":702
 *         return ''.join(_name_list)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         name = self._extract_mock_name()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock.NonCallableMock.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_name_string);
  __Pyx_XDECREF(__pyx_v_spec_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":723
 * 
 * 
 *     def __dir__(self):             # <<<<<<<<<<<<<<
 *         """Filter the output of `dir(mock)` to only useful members."""
 *         if not FILTER_DIR:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_31__dir__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_30__dir__[] = "Filter the output of `dir(mock)` to only useful members.";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_31__dir__ = {"__dir__", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_31__dir__, METH_O, __pyx_doc_6cymock_15NonCallableMock_30__dir__};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_31__dir__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dir__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_30__dir__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_30__dir__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_extras = NULL;
  PyObject *__pyx_v_from_type = NULL;
  PyObject *__pyx_v_from_dict = NULL;
  PyObject *__pyx_v_from_child_mocks = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_m_name = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_m_value = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_e = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("__dir__", 0);

  /* "cymock.pyx":725
 *     def __dir__(self):
 *         """Filter the output of `dir(mock)` to only useful members."""
 *         if not FILTER_DIR:             # <<<<<<<<<<<<<<
 *             return object.__dir__(self)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FILTER_DIR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":726
 *         """Filter the output of `dir(mock)` to only useful members."""
 *         if not FILTER_DIR:
 *             return object.__dir__(self)             # <<<<<<<<<<<<<<
 * 
 *         extras = self._mock_methods or []
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_dir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":725
 *     def __dir__(self):
 *         """Filter the output of `dir(mock)` to only useful members."""
 *         if not FILTER_DIR:             # <<<<<<<<<<<<<<
 *             return object.__dir__(self)
 * 
 */
  }

  /* "cymock.pyx":728
 *             return object.__dir__(self)
 * 
 *         extras = self._mock_methods or []             # <<<<<<<<<<<<<<
 *         from_type = dir(type(self))
 *         from_dict = list(self.__dict__)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 728, __pyx_L1_error)
  if (!__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L4_bool_binop_done:;
  __pyx_v_extras = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":729
 * 
 *         extras = self._mock_methods or []
 *         from_type = dir(type(self))             # <<<<<<<<<<<<<<
 *         from_dict = list(self.__dict__)
 *         from_child_mocks = [
 */
  __pyx_t_1 = PyObject_Dir(((PyObject *)Py_TYPE(__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_from_type = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":730
 *         extras = self._mock_methods or []
 *         from_type = dir(type(self))
 *         from_dict = list(self.__dict__)             # <<<<<<<<<<<<<<
 *         from_child_mocks = [
 *             m_name for m_name, m_value in self._mock_children.items()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_from_dict = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cymock.pyx":731
 *         from_type = dir(type(self))
 *         from_dict = list(self.__dict__)
 *         from_child_mocks = [             # <<<<<<<<<<<<<<
 *             m_name for m_name, m_value in self._mock_children.items()
 *             if m_value is not _deleted]
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cymock.pyx":732
 *         from_dict = list(self.__dict__)
 *         from_child_mocks = [
 *             m_name for m_name, m_value in self._mock_children.items()             # <<<<<<<<<<<<<<
 *             if m_value is not _deleted]
 * 
 */
    __pyx_t_6 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 732, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__pyx_t_5 == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 732, __pyx_L8_error)
    }
    __pyx_t_9 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 732, __pyx_L8_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_9;
    __pyx_t_9 = 0;
    while (1) {
      __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_6, &__pyx_t_9, &__pyx_t_5, NULL, __pyx_t_8);
      if (unlikely(__pyx_t_10 == 0)) break;
      if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 732, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_m_name, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_m_value, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cymock.pyx":733
 *         from_child_mocks = [
 *             m_name for m_name, m_value in self._mock_children.items()
 *             if m_value is not _deleted]             # <<<<<<<<<<<<<<
 * 
 *         from_type = [e for e in from_type if not e.startswith('_')]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_deleted); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 733, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = (__pyx_8genexpr2__pyx_v_m_value != __pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "cymock.pyx":732
 *         from_dict = list(self.__dict__)
 *         from_child_mocks = [
 *             m_name for m_name, m_value in self._mock_children.items()             # <<<<<<<<<<<<<<
 *             if m_value is not _deleted]
 * 
 */
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr2__pyx_v_m_name))) __PYX_ERR(0, 731, __pyx_L8_error)

        /* "cymock.pyx":733
 *         from_child_mocks = [
 *             m_name for m_name, m_value in self._mock_children.items()
 *             if m_value is not _deleted]             # <<<<<<<<<<<<<<
 * 
 *         from_type = [e for e in from_type if not e.startswith('_')]
 */
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m_name); __pyx_8genexpr2__pyx_v_m_name = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m_value); __pyx_8genexpr2__pyx_v_m_value = 0;
    goto __pyx_L12_exit_scope;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m_name); __pyx_8genexpr2__pyx_v_m_name = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m_value); __pyx_8genexpr2__pyx_v_m_value = 0;
    goto __pyx_L1_error;
    __pyx_L12_exit_scope:;
  } /* exit inner scope */
  __pyx_v_from_child_mocks = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cymock.pyx":735
 *             if m_value is not _deleted]
 * 
 *         from_type = [e for e in from_type if not e.startswith('_')]             # <<<<<<<<<<<<<<
 *         from_dict = [e for e in from_dict if not e.startswith('_') or
 *                      _is_magic(e)]
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L15_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_from_type)) || PyTuple_CheckExact(__pyx_v_from_type)) {
      __pyx_t_1 = __pyx_v_from_type; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_from_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 735, __pyx_L15_error)
    }
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 735, __pyx_L15_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 735, __pyx_L15_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_11(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 735, __pyx_L15_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_e, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr3__pyx_v_e, __pyx_n_s_startswith); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 735, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_12, __pyx_n_u__39) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_n_u__39);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 735, __pyx_L15_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_3 = ((!__pyx_t_2) != 0);
      if (__pyx_t_3) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr3__pyx_v_e))) __PYX_ERR(0, 735, __pyx_L15_error)
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_e); __pyx_8genexpr3__pyx_v_e = 0;
    goto __pyx_L19_exit_scope;
    __pyx_L15_error:;
    __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_e); __pyx_8genexpr3__pyx_v_e = 0;
    goto __pyx_L1_error;
    __pyx_L19_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_from_type, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cymock.pyx":736
 * 
 *         from_type = [e for e in from_type if not e.startswith('_')]
 *         from_dict = [e for e in from_dict if not e.startswith('_') or             # <<<<<<<<<<<<<<
 *                      _is_magic(e)]
 *         return sorted(set(extras + from_type + from_dict + from_child_mocks))
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L22_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_v_from_dict; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
    for (;;) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 736, __pyx_L22_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_e, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr4__pyx_v_e, __pyx_n_s_startswith); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 736, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_12, __pyx_n_u__39) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_n_u__39);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 736, __pyx_L22_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_13 = ((!__pyx_t_2) != 0);
      if (!__pyx_t_13) {
      } else {
        __pyx_t_3 = __pyx_t_13;
        goto __pyx_L26_bool_binop_done;
      }

      /* "cymock.pyx":737
 *         from_type = [e for e in from_type if not e.startswith('_')]
 *         from_dict = [e for e in from_dict if not e.startswith('_') or
 *                      _is_magic(e)]             # <<<<<<<<<<<<<<
 *         return sorted(set(extras + from_type + from_dict + from_child_mocks))
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_is_magic); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 737, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_12, __pyx_8genexpr4__pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_8genexpr4__pyx_v_e);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L22_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 737, __pyx_L22_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_3 = __pyx_t_13;
      __pyx_L26_bool_binop_done:;

      /* "cymock.pyx":736
 * 
 *         from_type = [e for e in from_type if not e.startswith('_')]
 *         from_dict = [e for e in from_dict if not e.startswith('_') or             # <<<<<<<<<<<<<<
 *                      _is_magic(e)]
 *         return sorted(set(extras + from_type + from_dict + from_child_mocks))
 */
      if (__pyx_t_3) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_8genexpr4__pyx_v_e))) __PYX_ERR(0, 736, __pyx_L22_error)
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_e); __pyx_8genexpr4__pyx_v_e = 0;
    goto __pyx_L28_exit_scope;
    __pyx_L22_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_e); __pyx_8genexpr4__pyx_v_e = 0;
    goto __pyx_L1_error;
    __pyx_L28_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_from_dict, ((PyObject*)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "cymock.pyx":738
 *         from_dict = [e for e in from_dict if not e.startswith('_') or
 *                      _is_magic(e)]
 *         return sorted(set(extras + from_type + from_dict + from_child_mocks))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Add(__pyx_v_extras, __pyx_v_from_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_from_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_v_from_child_mocks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_14 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 738, __pyx_L1_error)
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":723
 * 
 * 
 *     def __dir__(self):             # <<<<<<<<<<<<<<
 *         """Filter the output of `dir(mock)` to only useful members."""
 *         if not FILTER_DIR:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cymock.NonCallableMock.__dir__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_extras);
  __Pyx_XDECREF(__pyx_v_from_type);
  __Pyx_XDECREF(__pyx_v_from_dict);
  __Pyx_XDECREF(__pyx_v_from_child_mocks);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m_name);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_m_value);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_e);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":741
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         if name in _allowed_names:
 *             # property setters go through here
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_33__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_33__setattr__ = {"__setattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_33__setattr__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_33__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name_2,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 741, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 741, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 741, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 741, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_32__setattr__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

/* "cymock.pyx":759
 *                 setattr(type(self), name, _get_method(name, value))
 *                 original = value
 *                 value = lambda *args, **kw: original(self, *args, **kw)             # <<<<<<<<<<<<<<
 *             else:
 *                 # only set _new_name and not name so that mock_calls is tracked
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_11__setattr___lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_11__setattr___lambda1 = {"lambda1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_11__setattr___lambda1, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_11__setattr___lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lambda1", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kw = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kw)) return NULL;
    __Pyx_GOTREF(__pyx_v_kw);
  } else {
    __pyx_v_kw = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_args, __pyx_v_kw);

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

static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
  struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_original)) { __Pyx_RaiseClosureNameError("original"); __PYX_ERR(0, 759, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 759, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_self);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_original, __pyx_t_2, __pyx_v_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.NonCallableMock.__setattr__.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":741
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         if name in _allowed_names:
 *             # property setters go through here
 */

static PyObject *__pyx_pf_6cymock_15NonCallableMock_32__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *__pyx_cur_scope;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_v_mock_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  __Pyx_RefNannySetupContext("__setattr__", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *)__pyx_tp_new_6cymock___pyx_scope_struct_4___setattr__(__pyx_ptype_6cymock___pyx_scope_struct_4___setattr__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 741, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_v_value);

  /* "cymock.pyx":742
 * 
 *     def __setattr__(self, name, value):
 *         if name in _allowed_names:             # <<<<<<<<<<<<<<
 *             # property setters go through here
 *             return object.__setattr__(self, name, value)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_allowed_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":744
 *         if name in _allowed_names:
 *             # property setters go through here
 *             return object.__setattr__(self, name, value)             # <<<<<<<<<<<<<<
 *         elif (self._spec_set and self._mock_methods is not None and
 *             name not in self._mock_methods and
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_self, __pyx_v_name, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_self, __pyx_v_name, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 744, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_self);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_value);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":742
 * 
 *     def __setattr__(self, name, value):
 *         if name in _allowed_names:             # <<<<<<<<<<<<<<
 *             # property setters go through here
 *             return object.__setattr__(self, name, value)
 */
  }

  /* "cymock.pyx":745
 *             # property setters go through here
 *             return object.__setattr__(self, name, value)
 *         elif (self._spec_set and self._mock_methods is not None and             # <<<<<<<<<<<<<<
 *             name not in self._mock_methods and
 *             name not in self.__dict__):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_spec_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (__pyx_t_2 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cymock.pyx":746
 *             return object.__setattr__(self, name, value)
 *         elif (self._spec_set and self._mock_methods is not None and
 *             name not in self._mock_methods and             # <<<<<<<<<<<<<<
 *             name not in self.__dict__):
 *             raise AttributeError("Mock object has no attribute '%s'" % name)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_8 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "cymock.pyx":747
 *         elif (self._spec_set and self._mock_methods is not None and
 *             name not in self._mock_methods and
 *             name not in self.__dict__):             # <<<<<<<<<<<<<<
 *             raise AttributeError("Mock object has no attribute '%s'" % name)
 *         elif name in _unsupported_magics:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (__pyx_t_2 != 0);
  __pyx_t_3 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;

  /* "cymock.pyx":745
 *             # property setters go through here
 *             return object.__setattr__(self, name, value)
 *         elif (self._spec_set and self._mock_methods is not None and             # <<<<<<<<<<<<<<
 *             name not in self._mock_methods and
 *             name not in self.__dict__):
 */
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":748
 *             name not in self._mock_methods and
 *             name not in self.__dict__):
 *             raise AttributeError("Mock object has no attribute '%s'" % name)             # <<<<<<<<<<<<<<
 *         elif name in _unsupported_magics:
 *             msg = 'Attempting to set unsupported magic method %r.' % name
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Mock_object_has_no_attribute_s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 748, __pyx_L1_error)

    /* "cymock.pyx":745
 *             # property setters go through here
 *             return object.__setattr__(self, name, value)
 *         elif (self._spec_set and self._mock_methods is not None and             # <<<<<<<<<<<<<<
 *             name not in self._mock_methods and
 *             name not in self.__dict__):
 */
  }

  /* "cymock.pyx":749
 *             name not in self.__dict__):
 *             raise AttributeError("Mock object has no attribute '%s'" % name)
 *         elif name in _unsupported_magics:             # <<<<<<<<<<<<<<
 *             msg = 'Attempting to set unsupported magic method %r.' % name
 *             raise AttributeError(msg)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unsupported_magics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 749, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_8)) {

    /* "cymock.pyx":750
 *             raise AttributeError("Mock object has no attribute '%s'" % name)
 *         elif name in _unsupported_magics:
 *             msg = 'Attempting to set unsupported magic method %r.' % name             # <<<<<<<<<<<<<<
 *             raise AttributeError(msg)
 *         elif name in _all_magics:
 */
    __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Attempting_to_set_unsupported_ma, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_msg = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":751
 *         elif name in _unsupported_magics:
 *             msg = 'Attempting to set unsupported magic method %r.' % name
 *             raise AttributeError(msg)             # <<<<<<<<<<<<<<
 *         elif name in _all_magics:
 *             if self._mock_methods is not None and name not in self._mock_methods:
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 751, __pyx_L1_error)

    /* "cymock.pyx":749
 *             name not in self.__dict__):
 *             raise AttributeError("Mock object has no attribute '%s'" % name)
 *         elif name in _unsupported_magics:             # <<<<<<<<<<<<<<
 *             msg = 'Attempting to set unsupported magic method %r.' % name
 *             raise AttributeError(msg)
 */
  }

  /* "cymock.pyx":752
 *             msg = 'Attempting to set unsupported magic method %r.' % name
 *             raise AttributeError(msg)
 *         elif name in _all_magics:             # <<<<<<<<<<<<<<
 *             if self._mock_methods is not None and name not in self._mock_methods:
 *                 raise AttributeError("Mock object has no attribute '%s'" % name)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_all_magics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_8 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":753
 *             raise AttributeError(msg)
 *         elif name in _all_magics:
 *             if self._mock_methods is not None and name not in self._mock_methods:             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Mock object has no attribute '%s'" % name)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = (__pyx_t_4 != Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (__pyx_t_8 != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = (__pyx_t_2 != 0);
    __pyx_t_3 = __pyx_t_8;
    __pyx_L9_bool_binop_done:;
    if (unlikely(__pyx_t_3)) {

      /* "cymock.pyx":754
 *         elif name in _all_magics:
 *             if self._mock_methods is not None and name not in self._mock_methods:
 *                 raise AttributeError("Mock object has no attribute '%s'" % name)             # <<<<<<<<<<<<<<
 * 
 *             if not _is_instance_mock(value):
 */
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Mock_object_has_no_attribute_s, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 754, __pyx_L1_error)

      /* "cymock.pyx":753
 *             raise AttributeError(msg)
 *         elif name in _all_magics:
 *             if self._mock_methods is not None and name not in self._mock_methods:             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Mock object has no attribute '%s'" % name)
 * 
 */
    }

    /* "cymock.pyx":756
 *                 raise AttributeError("Mock object has no attribute '%s'" % name)
 * 
 *             if not _is_instance_mock(value):             # <<<<<<<<<<<<<<
 *                 setattr(type(self), name, _get_method(name, value))
 *                 original = value
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_instance_mock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_value);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 756, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = ((!__pyx_t_3) != 0);
    if (__pyx_t_8) {

      /* "cymock.pyx":757
 * 
 *             if not _is_instance_mock(value):
 *                 setattr(type(self), name, _get_method(name, value))             # <<<<<<<<<<<<<<
 *                 original = value
 *                 value = lambda *args, **kw: original(self, *args, **kw)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_get_method); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_name, __pyx_v_value};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_name, __pyx_v_value};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_name);
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_value);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = PyObject_SetAttr(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_self)), __pyx_v_name, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 757, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cymock.pyx":758
 *             if not _is_instance_mock(value):
 *                 setattr(type(self), name, _get_method(name, value))
 *                 original = value             # <<<<<<<<<<<<<<
 *                 value = lambda *args, **kw: original(self, *args, **kw)
 *             else:
 */
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __pyx_cur_scope->__pyx_v_original = __pyx_v_value;

      /* "cymock.pyx":759
 *                 setattr(type(self), name, _get_method(name, value))
 *                 original = value
 *                 value = lambda *args, **kw: original(self, *args, **kw)             # <<<<<<<<<<<<<<
 *             else:
 *                 # only set _new_name and not name so that mock_calls is tracked
 */
      __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_11__setattr___lambda1, 0, __pyx_n_s_NonCallableMock___setattr___loca, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cymock.pyx":756
 *                 raise AttributeError("Mock object has no attribute '%s'" % name)
 * 
 *             if not _is_instance_mock(value):             # <<<<<<<<<<<<<<
 *                 setattr(type(self), name, _get_method(name, value))
 *                 original = value
 */
      goto __pyx_L11;
    }

    /* "cymock.pyx":763
 *                 # only set _new_name and not name so that mock_calls is tracked
 *                 # but not method calls
 *                 _check_and_set_parent(self, value, None, name)             # <<<<<<<<<<<<<<
 *                 setattr(type(self), name, value)
 *                 self._mock_children[name] = value
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_and_set_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_self, __pyx_v_value, Py_None, __pyx_v_name};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_self, __pyx_v_value, Py_None, __pyx_v_name};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_self);
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value);
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, Py_None);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_name);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cymock.pyx":764
 *                 # but not method calls
 *                 _check_and_set_parent(self, value, None, name)
 *                 setattr(type(self), name, value)             # <<<<<<<<<<<<<<
 *                 self._mock_children[name] = value
 *         elif name == '__class__':
 */
      __pyx_t_9 = PyObject_SetAttr(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_self)), __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 764, __pyx_L1_error)

      /* "cymock.pyx":765
 *                 _check_and_set_parent(self, value, None, name)
 *                 setattr(type(self), name, value)
 *                 self._mock_children[name] = value             # <<<<<<<<<<<<<<
 *         elif name == '__class__':
 *             self._spec_class = value
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L11:;

    /* "cymock.pyx":752
 *             msg = 'Attempting to set unsupported magic method %r.' % name
 *             raise AttributeError(msg)
 *         elif name in _all_magics:             # <<<<<<<<<<<<<<
 *             if self._mock_methods is not None and name not in self._mock_methods:
 *                 raise AttributeError("Mock object has no attribute '%s'" % name)
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":766
 *                 setattr(type(self), name, value)
 *                 self._mock_children[name] = value
 *         elif name == '__class__':             # <<<<<<<<<<<<<<
 *             self._spec_class = value
 *             return
 */
  __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_class, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 766, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "cymock.pyx":767
 *                 self._mock_children[name] = value
 *         elif name == '__class__':
 *             self._spec_class = value             # <<<<<<<<<<<<<<
 *             return
 *         else:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_spec_class, __pyx_v_value) < 0) __PYX_ERR(0, 767, __pyx_L1_error)

    /* "cymock.pyx":768
 *         elif name == '__class__':
 *             self._spec_class = value
 *             return             # <<<<<<<<<<<<<<
 *         else:
 *             if _check_and_set_parent(self, value, name, name):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cymock.pyx":766
 *                 setattr(type(self), name, value)
 *                 self._mock_children[name] = value
 *         elif name == '__class__':             # <<<<<<<<<<<<<<
 *             self._spec_class = value
 *             return
 */
  }

  /* "cymock.pyx":770
 *             return
 *         else:
 *             if _check_and_set_parent(self, value, name, name):             # <<<<<<<<<<<<<<
 *                 self._mock_children[name] = value
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_check_and_set_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_self, __pyx_v_value, __pyx_v_name, __pyx_v_name};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_self, __pyx_v_value, __pyx_v_name, __pyx_v_name};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_self);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_value);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_6, __pyx_v_name);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "cymock.pyx":771
 *         else:
 *             if _check_and_set_parent(self, value, name, name):
 *                 self._mock_children[name] = value             # <<<<<<<<<<<<<<
 * 
 *         if self._mock_sealed and not hasattr(self, name):
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 771, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cymock.pyx":770
 *             return
 *         else:
 *             if _check_and_set_parent(self, value, name, name):             # <<<<<<<<<<<<<<
 *                 self._mock_children[name] = value
 * 
 */
    }
  }
  __pyx_L3:;

  /* "cymock.pyx":773
 *                 self._mock_children[name] = value
 * 
 *         if self._mock_sealed and not hasattr(self, name):             # <<<<<<<<<<<<<<
 *             mock_name = f'{self._extract_mock_name()}.{name}'
 *             raise AttributeError(f'Cannot set {mock_name}')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_sealed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_8 = __pyx_t_3;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_self;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_v_name); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
  __pyx_t_8 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;
  if (unlikely(__pyx_t_8)) {

    /* "cymock.pyx":774
 * 
 *         if self._mock_sealed and not hasattr(self, name):
 *             mock_name = f'{self._extract_mock_name()}.{name}'             # <<<<<<<<<<<<<<
 *             raise AttributeError(f'Cannot set {mock_name}')
 * 
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = 0;
    __pyx_t_11 = 127;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_extract_mock_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
    __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__33);
    __pyx_t_10 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__33);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__33);
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
    __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_mock_name = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "cymock.pyx":775
 *         if self._mock_sealed and not hasattr(self, name):
 *             mock_name = f'{self._extract_mock_name()}.{name}'
 *             raise AttributeError(f'Cannot set {mock_name}')             # <<<<<<<<<<<<<<
 * 
 *         return object.__setattr__(self, name, value)
 */
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_set, __pyx_v_mock_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 775, __pyx_L1_error)

    /* "cymock.pyx":773
 *                 self._mock_children[name] = value
 * 
 *         if self._mock_sealed and not hasattr(self, name):             # <<<<<<<<<<<<<<
 *             mock_name = f'{self._extract_mock_name()}.{name}'
 *             raise AttributeError(f'Cannot set {mock_name}')
 */
  }

  /* "cymock.pyx":777
 *             raise AttributeError(f'Cannot set {mock_name}')
 * 
 *         return object.__setattr__(self, name, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_self, __pyx_v_name, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_self, __pyx_v_name, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_self);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_value);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":741
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         if name in _allowed_names:
 *             # property setters go through here
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.NonCallableMock.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_mock_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":780
 * 
 * 
 *     def __delattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name in _all_magics and name in type(self).__dict__:
 *             delattr(type(self), name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_35__delattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_35__delattr__ = {"__delattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_35__delattr__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_35__delattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, 1); __PYX_ERR(0, 780, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__delattr__") < 0)) __PYX_ERR(0, 780, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__delattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 780, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_34__delattr__(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_34__delattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__delattr__", 0);

  /* "cymock.pyx":781
 * 
 *     def __delattr__(self, name):
 *         if name in _all_magics and name in type(self).__dict__:             # <<<<<<<<<<<<<<
 *             delattr(type(self), name)
 *             if name not in self.__dict__:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_all_magics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cymock.pyx":782
 *     def __delattr__(self, name):
 *         if name in _all_magics and name in type(self).__dict__:
 *             delattr(type(self), name)             # <<<<<<<<<<<<<<
 *             if name not in self.__dict__:
 *                 # for magic methods that are still MagicProxy objects and
 */
    __pyx_t_5 = PyObject_DelAttr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_v_name); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 782, __pyx_L1_error)

    /* "cymock.pyx":783
 *         if name in _all_magics and name in type(self).__dict__:
 *             delattr(type(self), name)
 *             if name not in self.__dict__:             # <<<<<<<<<<<<<<
 *                 # for magic methods that are still MagicProxy objects and
 *                 # not set on the instance itself
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {

      /* "cymock.pyx":786
 *                 # for magic methods that are still MagicProxy objects and
 *                 # not set on the instance itself
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         obj = self._mock_children.get(name, _missing)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cymock.pyx":783
 *         if name in _all_magics and name in type(self).__dict__:
 *             delattr(type(self), name)
 *             if name not in self.__dict__:             # <<<<<<<<<<<<<<
 *                 # for magic methods that are still MagicProxy objects and
 *                 # not set on the instance itself
 */
    }

    /* "cymock.pyx":781
 * 
 *     def __delattr__(self, name):
 *         if name in _all_magics and name in type(self).__dict__:             # <<<<<<<<<<<<<<
 *             delattr(type(self), name)
 *             if name not in self.__dict__:
 */
  }

  /* "cymock.pyx":788
 *                 return
 * 
 *         obj = self._mock_children.get(name, _missing)             # <<<<<<<<<<<<<<
 *         if name in self.__dict__:
 *             _safe_super(NonCallableMock, self).__delattr__(name)
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_missing); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_name, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_name, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_obj = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":789
 * 
 *         obj = self._mock_children.get(name, _missing)
 *         if name in self.__dict__:             # <<<<<<<<<<<<<<
 *             _safe_super(NonCallableMock, self).__delattr__(name)
 *         elif obj is _deleted:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (__pyx_t_1) {

    /* "cymock.pyx":790
 *         obj = self._mock_children.get(name, _missing)
 *         if name in self.__dict__:
 *             _safe_super(NonCallableMock, self).__delattr__(name)             # <<<<<<<<<<<<<<
 *         elif obj is _deleted:
 *             raise AttributeError(name)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_safe_super); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_v_self};
      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_v_self};
      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 790, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_9, __pyx_v_self);
      __pyx_t_6 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_delattr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cymock.pyx":789
 * 
 *         obj = self._mock_children.get(name, _missing)
 *         if name in self.__dict__:             # <<<<<<<<<<<<<<
 *             _safe_super(NonCallableMock, self).__delattr__(name)
 *         elif obj is _deleted:
 */
    goto __pyx_L7;
  }

  /* "cymock.pyx":791
 *         if name in self.__dict__:
 *             _safe_super(NonCallableMock, self).__delattr__(name)
 *         elif obj is _deleted:             # <<<<<<<<<<<<<<
 *             raise AttributeError(name)
 *         if obj is not _missing:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_deleted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__pyx_v_obj == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":792
 *             _safe_super(NonCallableMock, self).__delattr__(name)
 *         elif obj is _deleted:
 *             raise AttributeError(name)             # <<<<<<<<<<<<<<
 *         if obj is not _missing:
 *             del self._mock_children[name]
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 792, __pyx_L1_error)

    /* "cymock.pyx":791
 *         if name in self.__dict__:
 *             _safe_super(NonCallableMock, self).__delattr__(name)
 *         elif obj is _deleted:             # <<<<<<<<<<<<<<
 *             raise AttributeError(name)
 *         if obj is not _missing:
 */
  }
  __pyx_L7:;

  /* "cymock.pyx":793
 *         elif obj is _deleted:
 *             raise AttributeError(name)
 *         if obj is not _missing:             # <<<<<<<<<<<<<<
 *             del self._mock_children[name]
 *         self._mock_children[name] = _deleted
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_missing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__pyx_v_obj != __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (__pyx_t_1) {

    /* "cymock.pyx":794
 *             raise AttributeError(name)
 *         if obj is not _missing:
 *             del self._mock_children[name]             # <<<<<<<<<<<<<<
 *         self._mock_children[name] = _deleted
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_v_name) < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cymock.pyx":793
 *         elif obj is _deleted:
 *             raise AttributeError(name)
 *         if obj is not _missing:             # <<<<<<<<<<<<<<
 *             del self._mock_children[name]
 *         self._mock_children[name] = _deleted
 */
  }

  /* "cymock.pyx":795
 *         if obj is not _missing:
 *             del self._mock_children[name]
 *         self._mock_children[name] = _deleted             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_deleted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_v_name, __pyx_t_2) < 0)) __PYX_ERR(0, 795, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":780
 * 
 * 
 *     def __delattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name in _all_magics and name in type(self).__dict__:
 *             delattr(type(self), name)
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cymock.NonCallableMock.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":798
 * 
 * 
 *     def _format_mock_call_signature(self, args, kwargs):             # <<<<<<<<<<<<<<
 *         name = self._mock_name or 'mock'
 *         return _format_call_signature(name, args, kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_37_format_mock_call_signature(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_37_format_mock_call_signature = {"_format_mock_call_signature", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_37_format_mock_call_signature, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_37_format_mock_call_signature(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format_mock_call_signature (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_format_mock_call_signature", 1, 3, 3, 1); __PYX_ERR(0, 798, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_format_mock_call_signature", 1, 3, 3, 2); __PYX_ERR(0, 798, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_format_mock_call_signature") < 0)) __PYX_ERR(0, 798, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kwargs = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_format_mock_call_signature", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 798, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock._format_mock_call_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_36_format_mock_call_signature(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_36_format_mock_call_signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_format_mock_call_signature", 0);

  /* "cymock.pyx":799
 * 
 *     def _format_mock_call_signature(self, args, kwargs):
 *         name = self._mock_name or 'mock'             # <<<<<<<<<<<<<<
 *         return _format_call_signature(name, args, kwargs)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 799, __pyx_L1_error)
  if (!__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_n_u_mock);
  __pyx_t_1 = __pyx_n_u_mock;
  __pyx_L3_bool_binop_done:;
  __pyx_v_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":800
 *     def _format_mock_call_signature(self, args, kwargs):
 *         name = self._mock_name or 'mock'
 *         return _format_call_signature(name, args, kwargs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_format_call_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_name, __pyx_v_args, __pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_name, __pyx_v_args, __pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
    __Pyx_INCREF(__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":798
 * 
 * 
 *     def _format_mock_call_signature(self, args, kwargs):             # <<<<<<<<<<<<<<
 *         name = self._mock_name or 'mock'
 *         return _format_call_signature(name, args, kwargs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock.NonCallableMock._format_mock_call_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":803
 * 
 * 
 *     def _format_mock_failure_message(self, args, kwargs, action='call'):             # <<<<<<<<<<<<<<
 *         message = 'expected %s not found.\nExpected: %s\nActual: %s'
 *         expected_string = self._format_mock_call_signature(args, kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_39_format_mock_failure_message(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_39_format_mock_failure_message = {"_format_mock_failure_message", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_39_format_mock_failure_message, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_39_format_mock_failure_message(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_v_action = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format_mock_failure_message (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_action,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject*)__pyx_n_u_call_2));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_format_mock_failure_message", 0, 3, 4, 1); __PYX_ERR(0, 803, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_format_mock_failure_message", 0, 3, 4, 2); __PYX_ERR(0, 803, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_action);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_format_mock_failure_message") < 0)) __PYX_ERR(0, 803, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kwargs = values[2];
    __pyx_v_action = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_format_mock_failure_message", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 803, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock._format_mock_failure_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_38_format_mock_failure_message(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs, __pyx_v_action);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_38_format_mock_failure_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_action) {
  PyObject *__pyx_v_message = NULL;
  PyObject *__pyx_v_expected_string = NULL;
  PyObject *__pyx_v_call_args = NULL;
  PyObject *__pyx_v_actual_string = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_format_mock_failure_message", 0);

  /* "cymock.pyx":804
 * 
 *     def _format_mock_failure_message(self, args, kwargs, action='call'):
 *         message = 'expected %s not found.\nExpected: %s\nActual: %s'             # <<<<<<<<<<<<<<
 *         expected_string = self._format_mock_call_signature(args, kwargs)
 *         call_args = self.call_args
 */
  __Pyx_INCREF(__pyx_kp_u_expected_s_not_found_Expected_s);
  __pyx_v_message = __pyx_kp_u_expected_s_not_found_Expected_s;

  /* "cymock.pyx":805
 *     def _format_mock_failure_message(self, args, kwargs, action='call'):
 *         message = 'expected %s not found.\nExpected: %s\nActual: %s'
 *         expected_string = self._format_mock_call_signature(args, kwargs)             # <<<<<<<<<<<<<<
 *         call_args = self.call_args
 *         actual_string = self._format_mock_call_signature(*call_args)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_mock_call_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_args, __pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_args, __pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_args);
    __Pyx_INCREF(__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_kwargs);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_expected_string = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":806
 *         message = 'expected %s not found.\nExpected: %s\nActual: %s'
 *         expected_string = self._format_mock_call_signature(args, kwargs)
 *         call_args = self.call_args             # <<<<<<<<<<<<<<
 *         actual_string = self._format_mock_call_signature(*call_args)
 *         return message % (action, expected_string, actual_string)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_call_args = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":807
 *         expected_string = self._format_mock_call_signature(args, kwargs)
 *         call_args = self.call_args
 *         actual_string = self._format_mock_call_signature(*call_args)             # <<<<<<<<<<<<<<
 *         return message % (action, expected_string, actual_string)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_mock_call_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_call_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_actual_string = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cymock.pyx":808
 *         call_args = self.call_args
 *         actual_string = self._format_mock_call_signature(*call_args)
 *         return message % (action, expected_string, actual_string)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_action);
  __Pyx_GIVEREF(__pyx_v_action);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_action);
  __Pyx_INCREF(__pyx_v_expected_string);
  __Pyx_GIVEREF(__pyx_v_expected_string);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_expected_string);
  __Pyx_INCREF(__pyx_v_actual_string);
  __Pyx_GIVEREF(__pyx_v_actual_string);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_actual_string);
  __pyx_t_2 = PyUnicode_Format(__pyx_v_message, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":803
 * 
 * 
 *     def _format_mock_failure_message(self, args, kwargs, action='call'):             # <<<<<<<<<<<<<<
 *         message = 'expected %s not found.\nExpected: %s\nActual: %s'
 *         expected_string = self._format_mock_call_signature(args, kwargs)
 */

  /* 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_5);
  __Pyx_AddTraceback("cymock.NonCallableMock._format_mock_failure_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XDECREF(__pyx_v_expected_string);
  __Pyx_XDECREF(__pyx_v_call_args);
  __Pyx_XDECREF(__pyx_v_actual_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":811
 * 
 * 
 *     def _get_call_signature_from_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         * If call objects are asserted against a method/function like obj.meth1
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_41_get_call_signature_from_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_40_get_call_signature_from_name[] = "\n        * If call objects are asserted against a method/function like obj.meth1\n        then there could be no name for the call object to lookup. Hence just\n        return the spec_signature of the method/function being asserted against.\n        * If the name is not empty then remove () and split by '.' to get\n        list of names to iterate through the children until a potential\n        match is found. A child mock is created only during attribute access\n        so if we get a _SpecState then no attributes of the spec were accessed\n        and can be safely exited.\n        ";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_41_get_call_signature_from_name = {"_get_call_signature_from_name", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_41_get_call_signature_from_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_40_get_call_signature_from_name};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_41_get_call_signature_from_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_call_signature_from_name (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_call_signature_from_name", 1, 2, 2, 1); __PYX_ERR(0, 811, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_call_signature_from_name") < 0)) __PYX_ERR(0, 811, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_call_signature_from_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 811, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock._get_call_signature_from_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_40_get_call_signature_from_name(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_40_get_call_signature_from_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_sig = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_children = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("_get_call_signature_from_name", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "cymock.pyx":822
 *         and can be safely exited.
 *         """
 *         if not name:             # <<<<<<<<<<<<<<
 *             return self._spec_signature
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 822, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":823
 *         """
 *         if not name:
 *             return self._spec_signature             # <<<<<<<<<<<<<<
 * 
 *         sig = None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_signature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":822
 *         and can be safely exited.
 *         """
 *         if not name:             # <<<<<<<<<<<<<<
 *             return self._spec_signature
 * 
 */
  }

  /* "cymock.pyx":825
 *             return self._spec_signature
 * 
 *         sig = None             # <<<<<<<<<<<<<<
 *         names = name.replace('()', '').split('.')
 *         children = self._mock_children
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_sig = Py_None;

  /* "cymock.pyx":826
 * 
 *         sig = None
 *         names = name.replace('()', '').split('.')             # <<<<<<<<<<<<<<
 *         children = self._mock_children
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u__33) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u__33);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_names = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":827
 *         sig = None
 *         names = name.replace('()', '').split('.')
 *         children = self._mock_children             # <<<<<<<<<<<<<<
 * 
 *         for name in names:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_children = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":829
 *         children = self._mock_children
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             child = children.get(name)
 *             if child is None or isinstance(child, _SpecState):
 */
  if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) {
    __pyx_t_3 = __pyx_v_names; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 829, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 829, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 829, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 829, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 829, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 829, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":830
 * 
 *         for name in names:
 *             child = children.get(name)             # <<<<<<<<<<<<<<
 *             if child is None or isinstance(child, _SpecState):
 *                 break
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_children, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":831
 *         for name in names:
 *             child = children.get(name)
 *             if child is None or isinstance(child, _SpecState):             # <<<<<<<<<<<<<<
 *                 break
 *             else:
 */
    __pyx_t_1 = (__pyx_v_child == Py_None);
    __pyx_t_9 = (__pyx_t_1 != 0);
    if (!__pyx_t_9) {
    } else {
      __pyx_t_2 = __pyx_t_9;
      goto __pyx_L7_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SpecState); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = PyObject_IsInstance(__pyx_v_child, __pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (__pyx_t_9 != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cymock.pyx":832
 *             child = children.get(name)
 *             if child is None or isinstance(child, _SpecState):
 *                 break             # <<<<<<<<<<<<<<
 *             else:
 *                 # If an autospecced object is attached using attach_mock the
 */
      goto __pyx_L5_break;

      /* "cymock.pyx":831
 *         for name in names:
 *             child = children.get(name)
 *             if child is None or isinstance(child, _SpecState):             # <<<<<<<<<<<<<<
 *                 break
 *             else:
 */
    }

    /* "cymock.pyx":837
 *                 # child would be a function with mock object as attribute from
 *                 # which signature has to be derived.
 *                 child = _extract_mock(child)             # <<<<<<<<<<<<<<
 *                 children = child._mock_children
 *                 sig = child._spec_signature
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_extract_mock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_child) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_child);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_child, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cymock.pyx":838
 *                 # which signature has to be derived.
 *                 child = _extract_mock(child)
 *                 children = child._mock_children             # <<<<<<<<<<<<<<
 *                 sig = child._spec_signature
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_children, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cymock.pyx":839
 *                 child = _extract_mock(child)
 *                 children = child._mock_children
 *                 sig = child._spec_signature             # <<<<<<<<<<<<<<
 * 
 *         return sig
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_spec_signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_sig, __pyx_t_4);
      __pyx_t_4 = 0;
    }

    /* "cymock.pyx":829
 *         children = self._mock_children
 * 
 *         for name in names:             # <<<<<<<<<<<<<<
 *             child = children.get(name)
 *             if child is None or isinstance(child, _SpecState):
 */
  }
  __pyx_L5_break:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":841
 *                 sig = child._spec_signature
 * 
 *         return sig             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_sig);
  __pyx_r = __pyx_v_sig;
  goto __pyx_L0;

  /* "cymock.pyx":811
 * 
 * 
 *     def _get_call_signature_from_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         * If call objects are asserted against a method/function like obj.meth1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock.NonCallableMock._get_call_signature_from_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_children);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":844
 * 
 * 
 *     def _call_matcher(self, _call):             # <<<<<<<<<<<<<<
 *         """
 *         Given a call (or simply an (args, kwargs) tuple), return a
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_43_call_matcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_42_call_matcher[] = "\n        Given a call (or simply an (args, kwargs) tuple), return a\n        comparison key suitable for matching with other calls.\n        This is a best effort method which relies on the spec's signature,\n        if available, or falls back on the arguments themselves.\n        ";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_43_call_matcher = {"_call_matcher", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_43_call_matcher, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_42_call_matcher};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_43_call_matcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v__call = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_call_matcher (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_call_3,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_call_3)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_call_matcher", 1, 2, 2, 1); __PYX_ERR(0, 844, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_call_matcher") < 0)) __PYX_ERR(0, 844, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v__call = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_call_matcher", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 844, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock._call_matcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_42_call_matcher(__pyx_self, __pyx_v_self, __pyx_v__call);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_42_call_matcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__call) {
  PyObject *__pyx_v_sig = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_kwargs = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  __Pyx_RefNannySetupContext("_call_matcher", 0);

  /* "cymock.pyx":852
 *         """
 * 
 *         if isinstance(_call, tuple) and len(_call) > 2:             # <<<<<<<<<<<<<<
 *             sig = self._get_call_signature_from_name(_call[0])
 *         else:
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v__call); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = PyObject_Length(__pyx_v__call); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 852, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_4 > 2) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cymock.pyx":853
 * 
 *         if isinstance(_call, tuple) and len(_call) > 2:
 *             sig = self._get_call_signature_from_name(_call[0])             # <<<<<<<<<<<<<<
 *         else:
 *             sig = self._spec_signature
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_call_signature_from_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v__call, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_sig = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cymock.pyx":852
 *         """
 * 
 *         if isinstance(_call, tuple) and len(_call) > 2:             # <<<<<<<<<<<<<<
 *             sig = self._get_call_signature_from_name(_call[0])
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":855
 *             sig = self._get_call_signature_from_name(_call[0])
 *         else:
 *             sig = self._spec_signature             # <<<<<<<<<<<<<<
 * 
 *         if sig is not None:
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_signature); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_sig = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "cymock.pyx":857
 *             sig = self._spec_signature
 * 
 *         if sig is not None:             # <<<<<<<<<<<<<<
 *             if len(_call) == 2:
 *                 name = ''
 */
  __pyx_t_1 = (__pyx_v_sig != Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":858
 * 
 *         if sig is not None:
 *             if len(_call) == 2:             # <<<<<<<<<<<<<<
 *                 name = ''
 *                 args, kwargs = _call
 */
    __pyx_t_4 = PyObject_Length(__pyx_v__call); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 858, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_t_4 == 2) != 0);
    if (__pyx_t_3) {

      /* "cymock.pyx":859
 *         if sig is not None:
 *             if len(_call) == 2:
 *                 name = ''             # <<<<<<<<<<<<<<
 *                 args, kwargs = _call
 *             else:
 */
      __Pyx_INCREF(__pyx_kp_u__31);
      __pyx_v_name = __pyx_kp_u__31;

      /* "cymock.pyx":860
 *             if len(_call) == 2:
 *                 name = ''
 *                 args, kwargs = _call             # <<<<<<<<<<<<<<
 *             else:
 *                 name, args, kwargs = _call
 */
      if ((likely(PyTuple_CheckExact(__pyx_v__call))) || (PyList_CheckExact(__pyx_v__call))) {
        PyObject* sequence = __pyx_v__call;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 860, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        #else
        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 860, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 860, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_7 = PyObject_GetIter(__pyx_v__call); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 2) < 0) __PYX_ERR(0, 860, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 860, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __pyx_v_args = __pyx_t_5;
      __pyx_t_5 = 0;
      __pyx_v_kwargs = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "cymock.pyx":858
 * 
 *         if sig is not None:
 *             if len(_call) == 2:             # <<<<<<<<<<<<<<
 *                 name = ''
 *                 args, kwargs = _call
 */
      goto __pyx_L7;
    }

    /* "cymock.pyx":862
 *                 args, kwargs = _call
 *             else:
 *                 name, args, kwargs = _call             # <<<<<<<<<<<<<<
 *             try:
 *                 return name, sig.bind(*args, **kwargs)
 */
    /*else*/ {
      if ((likely(PyTuple_CheckExact(__pyx_v__call))) || (PyList_CheckExact(__pyx_v__call))) {
        PyObject* sequence = __pyx_v__call;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 862, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_v__call); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L11_unpacking_done;
        __pyx_L10_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 862, __pyx_L1_error)
        __pyx_L11_unpacking_done:;
      }
      __pyx_v_name = __pyx_t_6;
      __pyx_t_6 = 0;
      __pyx_v_args = __pyx_t_5;
      __pyx_t_5 = 0;
      __pyx_v_kwargs = __pyx_t_7;
      __pyx_t_7 = 0;
    }
    __pyx_L7:;

    /* "cymock.pyx":863
 *             else:
 *                 name, args, kwargs = _call
 *             try:             # <<<<<<<<<<<<<<
 *                 return name, sig.bind(*args, **kwargs)
 *             except TypeError as e:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "cymock.pyx":864
 *                 name, args, kwargs = _call
 *             try:
 *                 return name, sig.bind(*args, **kwargs)             # <<<<<<<<<<<<<<
 *             except TypeError as e:
 *                 return e.with_traceback(None)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_bind); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 864, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 864, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__pyx_v_kwargs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
          __PYX_ERR(0, 864, __pyx_L12_error)
        }
        if (likely(PyDict_CheckExact(__pyx_v_kwargs))) {
          __pyx_t_6 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_6);
        } else {
          __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kwargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 864, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 864, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 864, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L16_try_return;

        /* "cymock.pyx":863
 *             else:
 *                 name, args, kwargs = _call
 *             try:             # <<<<<<<<<<<<<<
 *                 return name, sig.bind(*args, **kwargs)
 *             except TypeError as e:
 */
      }
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cymock.pyx":865
 *             try:
 *                 return name, sig.bind(*args, **kwargs)
 *             except TypeError as e:             # <<<<<<<<<<<<<<
 *                 return e.with_traceback(None)
 *         else:
 */
      __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_13) {
        __Pyx_AddTraceback("cymock.NonCallableMock._call_matcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_8, &__pyx_t_5) < 0) __PYX_ERR(0, 865, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __pyx_v_e = __pyx_t_8;
        /*try:*/ {

          /* "cymock.pyx":866
 *                 return name, sig.bind(*args, **kwargs)
 *             except TypeError as e:
 *                 return e.with_traceback(None)             # <<<<<<<<<<<<<<
 *         else:
 *             return _call
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_with_traceback); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 866, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_15)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          __pyx_t_7 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_14, Py_None);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 866, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_r = __pyx_t_7;
          __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L22_return;
        }

        /* "cymock.pyx":865
 *             try:
 *                 return name, sig.bind(*args, **kwargs)
 *             except TypeError as e:             # <<<<<<<<<<<<<<
 *                 return e.with_traceback(None)
 *         else:
 */
        /*finally:*/ {
          __pyx_L23_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e);
              __pyx_v_e = NULL;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
            __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
            goto __pyx_L14_except_error;
          }
          __pyx_L22_return: {
            __pyx_t_23 = __pyx_r;
            __pyx_r = 0;
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
            __pyx_r = __pyx_t_23;
            __pyx_t_23 = 0;
            goto __pyx_L15_except_return;
          }
        }
      }
      goto __pyx_L14_except_error;
      __pyx_L14_except_error:;

      /* "cymock.pyx":863
 *             else:
 *                 name, args, kwargs = _call
 *             try:             # <<<<<<<<<<<<<<
 *                 return name, sig.bind(*args, **kwargs)
 *             except TypeError as e:
 */
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L16_try_return:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L0;
      __pyx_L15_except_return:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L0;
    }

    /* "cymock.pyx":857
 *             sig = self._spec_signature
 * 
 *         if sig is not None:             # <<<<<<<<<<<<<<
 *             if len(_call) == 2:
 *                 name = ''
 */
  }

  /* "cymock.pyx":868
 *                 return e.with_traceback(None)
 *         else:
 *             return _call             # <<<<<<<<<<<<<<
 * 
 *     def assert_not_called(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v__call);
    __pyx_r = __pyx_v__call;
    goto __pyx_L0;
  }

  /* "cymock.pyx":844
 * 
 * 
 *     def _call_matcher(self, _call):             # <<<<<<<<<<<<<<
 *         """
 *         Given a call (or simply an (args, kwargs) tuple), return a
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("cymock.NonCallableMock._call_matcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sig);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":870
 *             return _call
 * 
 *     def assert_not_called(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was never called.
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_45assert_not_called(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_44assert_not_called[] = "assert that the mock was never called.\n        ";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_45assert_not_called = {"assert_not_called", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_45assert_not_called, METH_O, __pyx_doc_6cymock_15NonCallableMock_44assert_not_called};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_45assert_not_called(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_not_called (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_44assert_not_called(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_44assert_not_called(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("assert_not_called", 0);

  /* "cymock.pyx":873
 *         """assert that the mock was never called.
 *         """
 *         if self.call_count != 0:             # <<<<<<<<<<<<<<
 *             msg = ("Expected '%s' to not have been called. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 873, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":874
 *         """
 *         if self.call_count != 0:
 *             msg = ("Expected '%s' to not have been called. Called %s times.%s"             # <<<<<<<<<<<<<<
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 */
    __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expected);
    __pyx_t_4 += 10;
    __Pyx_GIVEREF(__pyx_kp_u_Expected);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expected);

    /* "cymock.pyx":875
 *         if self.call_count != 0:
 *             msg = ("Expected '%s' to not have been called. Called %s times.%s"
 *                    % (self._mock_name or 'mock',             # <<<<<<<<<<<<<<
 *                       self.call_count,
 *                       self._calls_repr()))
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 875, __pyx_L1_error)
    if (!__pyx_t_3) {
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_1 = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_1 = __pyx_n_u_mock;
    __pyx_L4_bool_binop_done:;
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_to_not_have_been_called_Called);
    __pyx_t_4 += 34;
    __Pyx_GIVEREF(__pyx_kp_u_to_not_have_been_called_Called);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_to_not_have_been_called_Called);

    /* "cymock.pyx":876
 *             msg = ("Expected '%s' to not have been called. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,             # <<<<<<<<<<<<<<
 *                       self._calls_repr()))
 *             raise AssertionError(msg)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_times);
    __pyx_t_4 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_times);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_times);

    /* "cymock.pyx":877
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 *                       self._calls_repr()))             # <<<<<<<<<<<<<<
 *             raise AssertionError(msg)
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calls_repr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cymock.pyx":874
 *         """
 *         if self.call_count != 0:
 *             msg = ("Expected '%s' to not have been called. Called %s times.%s"             # <<<<<<<<<<<<<<
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 */
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_msg = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cymock.pyx":878
 *                       self.call_count,
 *                       self._calls_repr()))
 *             raise AssertionError(msg)             # <<<<<<<<<<<<<<
 * 
 *     def assert_called(self):
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 878, __pyx_L1_error)

    /* "cymock.pyx":873
 *         """assert that the mock was never called.
 *         """
 *         if self.call_count != 0:             # <<<<<<<<<<<<<<
 *             msg = ("Expected '%s' to not have been called. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 */
  }

  /* "cymock.pyx":870
 *             return _call
 * 
 *     def assert_not_called(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was never called.
 *         """
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_not_called", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":880
 *             raise AssertionError(msg)
 * 
 *     def assert_called(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called at least once
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_47assert_called(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_46assert_called[] = "assert that the mock was called at least once\n        ";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_47assert_called = {"assert_called", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_47assert_called, METH_O, __pyx_doc_6cymock_15NonCallableMock_46assert_called};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_47assert_called(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_called (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_46assert_called(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_46assert_called(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("assert_called", 0);

  /* "cymock.pyx":883
 *         """assert that the mock was called at least once
 *         """
 *         if self.call_count == 0:             # <<<<<<<<<<<<<<
 *             msg = ("Expected '%s' to have been called." %
 *                    (self._mock_name or 'mock'))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":885
 *         if self.call_count == 0:
 *             msg = ("Expected '%s' to have been called." %
 *                    (self._mock_name or 'mock'))             # <<<<<<<<<<<<<<
 *             raise AssertionError(msg)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 885, __pyx_L1_error)
    if (!__pyx_t_3) {
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_2 = __pyx_t_1;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_2 = __pyx_n_u_mock;
    __pyx_L4_bool_binop_done:;

    /* "cymock.pyx":884
 *         """
 *         if self.call_count == 0:
 *             msg = ("Expected '%s' to have been called." %             # <<<<<<<<<<<<<<
 *                    (self._mock_name or 'mock'))
 *             raise AssertionError(msg)
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Expected_s_to_have_been_called, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_msg = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":886
 *             msg = ("Expected '%s' to have been called." %
 *                    (self._mock_name or 'mock'))
 *             raise AssertionError(msg)             # <<<<<<<<<<<<<<
 * 
 *     def assert_called_once(self):
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 886, __pyx_L1_error)

    /* "cymock.pyx":883
 *         """assert that the mock was called at least once
 *         """
 *         if self.call_count == 0:             # <<<<<<<<<<<<<<
 *             msg = ("Expected '%s' to have been called." %
 *                    (self._mock_name or 'mock'))
 */
  }

  /* "cymock.pyx":880
 *             raise AssertionError(msg)
 * 
 *     def assert_called(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called at least once
 *         """
 */

  /* 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("cymock.NonCallableMock.assert_called", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":888
 *             raise AssertionError(msg)
 * 
 *     def assert_called_once(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called only once.
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_49assert_called_once(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_48assert_called_once[] = "assert that the mock was called only once.\n        ";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_49assert_called_once = {"assert_called_once", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_49assert_called_once, METH_O, __pyx_doc_6cymock_15NonCallableMock_48assert_called_once};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_49assert_called_once(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_called_once (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_48assert_called_once(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_48assert_called_once(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("assert_called_once", 0);

  /* "cymock.pyx":891
 *         """assert that the mock was called only once.
 *         """
 *         if not self.call_count == 1:             # <<<<<<<<<<<<<<
 *             msg = ("Expected '%s' to have been called once. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "cymock.pyx":892
 *         """
 *         if not self.call_count == 1:
 *             msg = ("Expected '%s' to have been called once. Called %s times.%s"             # <<<<<<<<<<<<<<
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 */
    __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expected);
    __pyx_t_5 += 10;
    __Pyx_GIVEREF(__pyx_kp_u_Expected);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expected);

    /* "cymock.pyx":893
 *         if not self.call_count == 1:
 *             msg = ("Expected '%s' to have been called once. Called %s times.%s"
 *                    % (self._mock_name or 'mock',             # <<<<<<<<<<<<<<
 *                       self.call_count,
 *                       self._calls_repr()))
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 893, __pyx_L1_error)
    if (!__pyx_t_4) {
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_1 = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_1 = __pyx_n_u_mock;
    __pyx_L4_bool_binop_done:;
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_to_have_been_called_once_Called);
    __pyx_t_5 += 35;
    __Pyx_GIVEREF(__pyx_kp_u_to_have_been_called_once_Called);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_to_have_been_called_once_Called);

    /* "cymock.pyx":894
 *             msg = ("Expected '%s' to have been called once. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,             # <<<<<<<<<<<<<<
 *                       self._calls_repr()))
 *             raise AssertionError(msg)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_times);
    __pyx_t_5 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_times);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_times);

    /* "cymock.pyx":895
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 *                       self._calls_repr()))             # <<<<<<<<<<<<<<
 *             raise AssertionError(msg)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calls_repr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cymock.pyx":892
 *         """
 *         if not self.call_count == 1:
 *             msg = ("Expected '%s' to have been called once. Called %s times.%s"             # <<<<<<<<<<<<<<
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 6, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_msg = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "cymock.pyx":896
 *                       self.call_count,
 *                       self._calls_repr()))
 *             raise AssertionError(msg)             # <<<<<<<<<<<<<<
 * 
 *     def assert_called_with(self, *args, **kwargs):
 */
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_msg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 896, __pyx_L1_error)

    /* "cymock.pyx":891
 *         """assert that the mock was called only once.
 *         """
 *         if not self.call_count == 1:             # <<<<<<<<<<<<<<
 *             msg = ("Expected '%s' to have been called once. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 */
  }

  /* "cymock.pyx":888
 *             raise AssertionError(msg)
 * 
 *     def assert_called_once(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called only once.
 *         """
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_called_once", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":898
 *             raise AssertionError(msg)
 * 
 *     def assert_called_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the last call was made with the specified arguments.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_51assert_called_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_50assert_called_with[] = "assert that the last call was made with the specified arguments.\n\n        Raises an AssertionError if the args and keyword args passed in are\n        different to the last call to the mock.";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_51assert_called_with = {"assert_called_with", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_51assert_called_with, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_50assert_called_with};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_51assert_called_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_called_with (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "assert_called_with") < 0)) __PYX_ERR(0, 898, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assert_called_with", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 898, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_CLEAR(__pyx_v_args);
  __Pyx_CLEAR(__pyx_v_kwargs);
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_called_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_50assert_called_with(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

/* "cymock.pyx":910
 *             raise AssertionError(error_message)
 * 
 *         def _error_message():             # <<<<<<<<<<<<<<
 *             msg = self._format_mock_failure_message(args, kwargs)
 *             return msg
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_18assert_called_with_1_error_message(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_18assert_called_with_1_error_message = {"_error_message", (PyCFunction)__pyx_pw_6cymock_15NonCallableMock_18assert_called_with_1_error_message, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_18assert_called_with_1_error_message(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_error_message (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_18assert_called_with__error_message(__pyx_self);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_18assert_called_with__error_message(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *__pyx_outer_scope;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_error_message", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":911
 * 
 *         def _error_message():
 *             msg = self._format_mock_failure_message(args, kwargs)             # <<<<<<<<<<<<<<
 *             return msg
 *         expected = self._call_matcher((args, kwargs))
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 911, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_format_mock_failure_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); __PYX_ERR(0, 911, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 911, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_args);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_kwargs);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_msg = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":912
 *         def _error_message():
 *             msg = self._format_mock_failure_message(args, kwargs)
 *             return msg             # <<<<<<<<<<<<<<
 *         expected = self._call_matcher((args, kwargs))
 *         actual = self._call_matcher(self.call_args)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_msg);
  __pyx_r = __pyx_v_msg;
  goto __pyx_L0;

  /* "cymock.pyx":910
 *             raise AssertionError(error_message)
 * 
 *         def _error_message():             # <<<<<<<<<<<<<<
 *             msg = self._format_mock_failure_message(args, kwargs)
 *             return msg
 */

  /* 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_5);
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_called_with._error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":898
 *             raise AssertionError(msg)
 * 
 *     def assert_called_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the last call was made with the specified arguments.
 * 
 */

static PyObject *__pyx_pf_6cymock_15NonCallableMock_50assert_called_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *__pyx_cur_scope;
  PyObject *__pyx_v_expected = NULL;
  PyObject *__pyx_v_actual = NULL;
  PyObject *__pyx_v_error_message = NULL;
  PyObject *__pyx_v__error_message = 0;
  PyObject *__pyx_v_cause = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  __Pyx_RefNannySetupContext("assert_called_with", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *)__pyx_tp_new_6cymock___pyx_scope_struct_5_assert_called_with(__pyx_ptype_6cymock___pyx_scope_struct_5_assert_called_with, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 898, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);

  /* "cymock.pyx":903
 *         Raises an AssertionError if the args and keyword args passed in are
 *         different to the last call to the mock."""
 *         if self.call_args is None:             # <<<<<<<<<<<<<<
 *             expected = self._format_mock_call_signature(args, kwargs)
 *             actual = 'not called.'
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":904
 *         different to the last call to the mock."""
 *         if self.call_args is None:
 *             expected = self._format_mock_call_signature(args, kwargs)             # <<<<<<<<<<<<<<
 *             actual = 'not called.'
 *             error_message = ('expected call not found.\nExpected: %s\nActual: %s'
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_format_mock_call_signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 904, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_args);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_cur_scope->__pyx_v_kwargs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_expected = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":905
 *         if self.call_args is None:
 *             expected = self._format_mock_call_signature(args, kwargs)
 *             actual = 'not called.'             # <<<<<<<<<<<<<<
 *             error_message = ('expected call not found.\nExpected: %s\nActual: %s'
 *                     % (expected, actual))
 */
    __Pyx_INCREF(__pyx_kp_u_not_called);
    __pyx_v_actual = __pyx_kp_u_not_called;

    /* "cymock.pyx":906
 *             expected = self._format_mock_call_signature(args, kwargs)
 *             actual = 'not called.'
 *             error_message = ('expected call not found.\nExpected: %s\nActual: %s'             # <<<<<<<<<<<<<<
 *                     % (expected, actual))
 *             raise AssertionError(error_message)
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_expected_call_not_found_Expected);
    __pyx_t_8 += 35;
    __Pyx_GIVEREF(__pyx_kp_u_expected_call_not_found_Expected);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_expected_call_not_found_Expected);

    /* "cymock.pyx":907
 *             actual = 'not called.'
 *             error_message = ('expected call not found.\nExpected: %s\nActual: %s'
 *                     % (expected, actual))             # <<<<<<<<<<<<<<
 *             raise AssertionError(error_message)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_expected), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u_Actual);
    __pyx_t_8 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_Actual);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_Actual);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_actual), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":906
 *             expected = self._format_mock_call_signature(args, kwargs)
 *             actual = 'not called.'
 *             error_message = ('expected call not found.\nExpected: %s\nActual: %s'             # <<<<<<<<<<<<<<
 *                     % (expected, actual))
 *             raise AssertionError(error_message)
 */
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_error_message = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":908
 *             error_message = ('expected call not found.\nExpected: %s\nActual: %s'
 *                     % (expected, actual))
 *             raise AssertionError(error_message)             # <<<<<<<<<<<<<<
 * 
 *         def _error_message():
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 908, __pyx_L1_error)

    /* "cymock.pyx":903
 *         Raises an AssertionError if the args and keyword args passed in are
 *         different to the last call to the mock."""
 *         if self.call_args is None:             # <<<<<<<<<<<<<<
 *             expected = self._format_mock_call_signature(args, kwargs)
 *             actual = 'not called.'
 */
  }

  /* "cymock.pyx":910
 *             raise AssertionError(error_message)
 * 
 *         def _error_message():             # <<<<<<<<<<<<<<
 *             msg = self._format_mock_failure_message(args, kwargs)
 *             return msg
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_18assert_called_with_1_error_message, 0, __pyx_n_s_NonCallableMock_assert_called_wi, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v__error_message = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":913
 *             msg = self._format_mock_failure_message(args, kwargs)
 *             return msg
 *         expected = self._call_matcher((args, kwargs))             # <<<<<<<<<<<<<<
 *         actual = self._call_matcher(self.call_args)
 *         if expected != actual:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_args);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_cur_scope->__pyx_v_kwargs);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_expected = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":914
 *             return msg
 *         expected = self._call_matcher((args, kwargs))
 *         actual = self._call_matcher(self.call_args)             # <<<<<<<<<<<<<<
 *         if expected != actual:
 *             cause = expected if isinstance(expected, Exception) else None
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_actual = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":915
 *         expected = self._call_matcher((args, kwargs))
 *         actual = self._call_matcher(self.call_args)
 *         if expected != actual:             # <<<<<<<<<<<<<<
 *             cause = expected if isinstance(expected, Exception) else None
 *             raise AssertionError(_error_message()) from cause
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_expected, __pyx_v_actual, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 915, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":916
 *         actual = self._call_matcher(self.call_args)
 *         if expected != actual:
 *             cause = expected if isinstance(expected, Exception) else None             # <<<<<<<<<<<<<<
 *             raise AssertionError(_error_message()) from cause
 * 
 */
    __pyx_t_3 = __Pyx_PyException_Check(__pyx_v_expected); 
    if ((__pyx_t_3 != 0)) {
      __Pyx_INCREF(__pyx_v_expected);
      __pyx_t_4 = __pyx_v_expected;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }
    __pyx_v_cause = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cymock.pyx":917
 *         if expected != actual:
 *             cause = expected if isinstance(expected, Exception) else None
 *             raise AssertionError(_error_message()) from cause             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_pf_6cymock_15NonCallableMock_18assert_called_with__error_message(__pyx_v__error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, __pyx_v_cause);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 917, __pyx_L1_error)

    /* "cymock.pyx":915
 *         expected = self._call_matcher((args, kwargs))
 *         actual = self._call_matcher(self.call_args)
 *         if expected != actual:             # <<<<<<<<<<<<<<
 *             cause = expected if isinstance(expected, Exception) else None
 *             raise AssertionError(_error_message()) from cause
 */
  }

  /* "cymock.pyx":898
 *             raise AssertionError(msg)
 * 
 *     def assert_called_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the last call was made with the specified arguments.
 * 
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_called_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expected);
  __Pyx_XDECREF(__pyx_v_actual);
  __Pyx_XDECREF(__pyx_v_error_message);
  __Pyx_XDECREF(__pyx_v__error_message);
  __Pyx_XDECREF(__pyx_v_cause);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":920
 * 
 * 
 *     def assert_called_once_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called exactly once and that that call was
 *         with the specified arguments."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_53assert_called_once_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_52assert_called_once_with[] = "assert that the mock was called exactly once and that that call was\n        with the specified arguments.";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_53assert_called_once_with = {"assert_called_once_with", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_53assert_called_once_with, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_52assert_called_once_with};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_53assert_called_once_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_called_once_with (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "assert_called_once_with") < 0)) __PYX_ERR(0, 920, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assert_called_once_with", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 920, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_called_once_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_52assert_called_once_with(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_52assert_called_once_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("assert_called_once_with", 0);

  /* "cymock.pyx":923
 *         """assert that the mock was called exactly once and that that call was
 *         with the specified arguments."""
 *         if not self.call_count == 1:             # <<<<<<<<<<<<<<
 *             msg = ("Expected '%s' to be called once. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 923, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "cymock.pyx":924
 *         with the specified arguments."""
 *         if not self.call_count == 1:
 *             msg = ("Expected '%s' to be called once. Called %s times.%s"             # <<<<<<<<<<<<<<
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 */
    __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expected);
    __pyx_t_5 += 10;
    __Pyx_GIVEREF(__pyx_kp_u_Expected);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expected);

    /* "cymock.pyx":925
 *         if not self.call_count == 1:
 *             msg = ("Expected '%s' to be called once. Called %s times.%s"
 *                    % (self._mock_name or 'mock',             # <<<<<<<<<<<<<<
 *                       self.call_count,
 *                       self._calls_repr()))
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 925, __pyx_L1_error)
    if (!__pyx_t_4) {
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_1 = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_1 = __pyx_n_u_mock;
    __pyx_L4_bool_binop_done:;
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_to_be_called_once_Called);
    __pyx_t_5 += 28;
    __Pyx_GIVEREF(__pyx_kp_u_to_be_called_once_Called);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_to_be_called_once_Called);

    /* "cymock.pyx":926
 *             msg = ("Expected '%s' to be called once. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,             # <<<<<<<<<<<<<<
 *                       self._calls_repr()))
 *             raise AssertionError(msg)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_times);
    __pyx_t_5 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_times);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_times);

    /* "cymock.pyx":927
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 *                       self._calls_repr()))             # <<<<<<<<<<<<<<
 *             raise AssertionError(msg)
 *         return self.assert_called_with(*args, **kwargs)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calls_repr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_1), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cymock.pyx":924
 *         with the specified arguments."""
 *         if not self.call_count == 1:
 *             msg = ("Expected '%s' to be called once. Called %s times.%s"             # <<<<<<<<<<<<<<
 *                    % (self._mock_name or 'mock',
 *                       self.call_count,
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 6, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_msg = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "cymock.pyx":928
 *                       self.call_count,
 *                       self._calls_repr()))
 *             raise AssertionError(msg)             # <<<<<<<<<<<<<<
 *         return self.assert_called_with(*args, **kwargs)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_msg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 928, __pyx_L1_error)

    /* "cymock.pyx":923
 *         """assert that the mock was called exactly once and that that call was
 *         with the specified arguments."""
 *         if not self.call_count == 1:             # <<<<<<<<<<<<<<
 *             msg = ("Expected '%s' to be called once. Called %s times.%s"
 *                    % (self._mock_name or 'mock',
 */
  }

  /* "cymock.pyx":929
 *                       self._calls_repr()))
 *             raise AssertionError(msg)
 *         return self.assert_called_with(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assert_called_with); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":920
 * 
 * 
 *     def assert_called_once_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called exactly once and that that call was
 *         with the specified arguments."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_called_once_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":932
 * 
 * 
 *     def assert_has_calls(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified calls.
 *         The `mock_calls` list is checked for the calls.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_55assert_has_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_54assert_has_calls[] = "assert the mock has been called with the specified calls.\n        The `mock_calls` list is checked for the calls.\n\n        If `any_order` is False (the default) then the calls must be\n        sequential. There can be extra calls before or after the\n        specified calls.\n\n        If `any_order` is True then the calls can be in any order, but\n        they must all appear in `mock_calls`.";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_55assert_has_calls = {"assert_has_calls", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_55assert_has_calls, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_54assert_has_calls};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_55assert_has_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_calls = 0;
  PyObject *__pyx_v_any_order = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_has_calls (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_calls,&__pyx_n_s_any_order,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calls)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("assert_has_calls", 0, 2, 3, 1); __PYX_ERR(0, 932, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_any_order);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assert_has_calls") < 0)) __PYX_ERR(0, 932, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_calls = values[1];
    __pyx_v_any_order = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assert_has_calls", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 932, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_has_calls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_54assert_has_calls(__pyx_self, __pyx_v_self, __pyx_v_calls, __pyx_v_any_order);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_15NonCallableMock_16assert_has_calls_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":943
 *         they must all appear in `mock_calls`."""
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)             # <<<<<<<<<<<<<<
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
 *         if not any_order:
 */

static PyObject *__pyx_pf_6cymock_15NonCallableMock_16assert_has_calls_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *)__pyx_tp_new_6cymock___pyx_scope_struct_7_genexpr(__pyx_ptype_6cymock___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 943, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_15NonCallableMock_16assert_has_calls_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_NonCallableMock_assert_has_calls, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 943, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_has_calls.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_15NonCallableMock_16assert_has_calls_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 943, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_expected)) { __Pyx_RaiseClosureNameError("expected"); __PYX_ERR(0, 943, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_expected == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 943, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_expected; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 943, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyException_Check(__pyx_cur_scope->__pyx_v_e); 
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
      __pyx_r = __pyx_cur_scope->__pyx_v_e;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 943, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_15NonCallableMock_16assert_has_calls_5generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":944
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)             # <<<<<<<<<<<<<<
 *         if not any_order:
 *             if expected not in all_calls:
 */

static PyObject *__pyx_pf_6cymock_15NonCallableMock_16assert_has_calls_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *)__pyx_tp_new_6cymock___pyx_scope_struct_8_genexpr(__pyx_ptype_6cymock___pyx_scope_struct_8_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 944, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_15NonCallableMock_16assert_has_calls_5generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_NonCallableMock_assert_has_calls, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 944, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_has_calls.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_15NonCallableMock_16assert_has_calls_5generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 944, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 944, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_mock_calls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 944, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 944, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 944, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 944, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 944, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_c) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 944, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":932
 * 
 * 
 *     def assert_has_calls(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified calls.
 *         The `mock_calls` list is checked for the calls.
 */

static PyObject *__pyx_pf_6cymock_15NonCallableMock_54assert_has_calls(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_calls, PyObject *__pyx_v_any_order) {
  struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *__pyx_cur_scope;
  PyObject *__pyx_v_cause = NULL;
  PyObject *__pyx_v_all_calls = NULL;
  PyObject *__pyx_v_problem = NULL;
  PyObject *__pyx_v_not_found = NULL;
  PyObject *__pyx_v_kall = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_c = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_UCS4 __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("assert_has_calls", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *)__pyx_tp_new_6cymock___pyx_scope_struct_6_assert_has_calls(__pyx_ptype_6cymock___pyx_scope_struct_6_assert_has_calls, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 932, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "cymock.pyx":942
 *         If `any_order` is True then the calls can be in any order, but
 *         they must all appear in `mock_calls`."""
 *         expected = [self._call_matcher(c) for c in calls]             # <<<<<<<<<<<<<<
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_calls)) || PyTuple_CheckExact(__pyx_v_calls)) {
      __pyx_t_2 = __pyx_v_calls; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_calls); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 942, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 942, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 942, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 942, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 942, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_c, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 942, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_8genexpr5__pyx_v_c) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr5__pyx_v_c);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 942, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 942, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_c); __pyx_8genexpr5__pyx_v_c = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_c); __pyx_8genexpr5__pyx_v_c = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_expected = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":943
 *         they must all appear in `mock_calls`."""
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)             # <<<<<<<<<<<<<<
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
 *         if not any_order:
 */
  __pyx_t_1 = __pyx_pf_6cymock_15NonCallableMock_16assert_has_calls_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next2(__pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cause = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":944
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)             # <<<<<<<<<<<<<<
 *         if not any_order:
 *             if expected not in all_calls:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CallList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __pyx_pf_6cymock_15NonCallableMock_16assert_has_calls_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_all_calls = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":945
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
 *         if not any_order:             # <<<<<<<<<<<<<<
 *             if expected not in all_calls:
 *                 if cause is None:
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_any_order); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 945, __pyx_L1_error)
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "cymock.pyx":946
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
 *         if not any_order:
 *             if expected not in all_calls:             # <<<<<<<<<<<<<<
 *                 if cause is None:
 *                     problem = 'Calls not found.'
 */
    __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_expected, __pyx_v_all_calls, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 946, __pyx_L1_error)
    __pyx_t_8 = (__pyx_t_9 != 0);
    if (__pyx_t_8) {

      /* "cymock.pyx":947
 *         if not any_order:
 *             if expected not in all_calls:
 *                 if cause is None:             # <<<<<<<<<<<<<<
 *                     problem = 'Calls not found.'
 *                 else:
 */
      __pyx_t_8 = (__pyx_v_cause == Py_None);
      __pyx_t_9 = (__pyx_t_8 != 0);
      if (__pyx_t_9) {

        /* "cymock.pyx":948
 *             if expected not in all_calls:
 *                 if cause is None:
 *                     problem = 'Calls not found.'             # <<<<<<<<<<<<<<
 *                 else:
 *                     problem = ('Error processing expected calls.\n'
 */
        __Pyx_INCREF(__pyx_kp_u_Calls_not_found);
        __pyx_v_problem = __pyx_kp_u_Calls_not_found;

        /* "cymock.pyx":947
 *         if not any_order:
 *             if expected not in all_calls:
 *                 if cause is None:             # <<<<<<<<<<<<<<
 *                     problem = 'Calls not found.'
 *                 else:
 */
        goto __pyx_L11;
      }

      /* "cymock.pyx":951
 *                 else:
 *                     problem = ('Error processing expected calls.\n'
 *                                'Errors: {}').format(             # <<<<<<<<<<<<<<
 *                                    [e if isinstance(e, Exception) else None
 *                                     for e in expected])
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Error_processing_expected_calls, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        { /* enter inner scope */

          /* "cymock.pyx":952
 *                     problem = ('Error processing expected calls.\n'
 *                                'Errors: {}').format(
 *                                    [e if isinstance(e, Exception) else None             # <<<<<<<<<<<<<<
 *                                     for e in expected])
 *                 raise AssertionError(
 */
          __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 952, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_5);

          /* "cymock.pyx":953
 *                                'Errors: {}').format(
 *                                    [e if isinstance(e, Exception) else None
 *                                     for e in expected])             # <<<<<<<<<<<<<<
 *                 raise AssertionError(
 *                     f'{problem}\n'
 */
          __pyx_t_6 = __pyx_cur_scope->__pyx_v_expected; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
          for (;;) {
            if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 953, __pyx_L14_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 953, __pyx_L14_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
            __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_e, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "cymock.pyx":952
 *                     problem = ('Error processing expected calls.\n'
 *                                'Errors: {}').format(
 *                                    [e if isinstance(e, Exception) else None             # <<<<<<<<<<<<<<
 *                                     for e in expected])
 *                 raise AssertionError(
 */
            __pyx_t_9 = __Pyx_PyException_Check(__pyx_8genexpr8__pyx_v_e); 
            if ((__pyx_t_9 != 0)) {
              __Pyx_INCREF(__pyx_8genexpr8__pyx_v_e);
              __pyx_t_7 = __pyx_8genexpr8__pyx_v_e;
            } else {
              __Pyx_INCREF(Py_None);
              __pyx_t_7 = Py_None;
            }
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 952, __pyx_L14_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

            /* "cymock.pyx":953
 *                                'Errors: {}').format(
 *                                    [e if isinstance(e, Exception) else None
 *                                     for e in expected])             # <<<<<<<<<<<<<<
 *                 raise AssertionError(
 *                     f'{problem}\n'
 */
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_e); __pyx_8genexpr8__pyx_v_e = 0;
          goto __pyx_L17_exit_scope;
          __pyx_L14_error:;
          __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_e); __pyx_8genexpr8__pyx_v_e = 0;
          goto __pyx_L1_error;
          __pyx_L17_exit_scope:;
        } /* exit inner scope */
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_problem = __pyx_t_2;
        __pyx_t_2 = 0;
      }
      __pyx_L11:;

      /* "cymock.pyx":955
 *                                     for e in expected])
 *                 raise AssertionError(
 *                     f'{problem}\n'             # <<<<<<<<<<<<<<
 *                     f'Expected: {_CallList(calls)}'
 *                     f'{self._calls_repr(prefix="Actual").rstrip(".")}'
 */
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_10 = 127;
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_problem, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_10;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_kp_u_Expected_2);
      __pyx_t_3 += 11;
      __Pyx_GIVEREF(__pyx_kp_u_Expected_2);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_Expected_2);

      /* "cymock.pyx":956
 *                 raise AssertionError(
 *                     f'{problem}\n'
 *                     f'Expected: {_CallList(calls)}'             # <<<<<<<<<<<<<<
 *                     f'{self._calls_repr(prefix="Actual").rstrip(".")}'
 *                 ) from cause
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CallList); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 956, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_calls) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_calls);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 956, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_10;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cymock.pyx":957
 *                     f'{problem}\n'
 *                     f'Expected: {_CallList(calls)}'
 *                     f'{self._calls_repr(prefix="Actual").rstrip(".")}'             # <<<<<<<<<<<<<<
 *                 ) from cause
 *             return
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_calls_repr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_prefix, __pyx_n_u_Actual_2) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_rstrip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_kp_u__33) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u__33);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_10;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cymock.pyx":955
 *                                     for e in expected])
 *                 raise AssertionError(
 *                     f'{problem}\n'             # <<<<<<<<<<<<<<
 *                     f'Expected: {_CallList(calls)}'
 *                     f'{self._calls_repr(prefix="Actual").rstrip(".")}'
 */
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 955, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cymock.pyx":954
 *                                    [e if isinstance(e, Exception) else None
 *                                     for e in expected])
 *                 raise AssertionError(             # <<<<<<<<<<<<<<
 *                     f'{problem}\n'
 *                     f'Expected: {_CallList(calls)}'
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cymock.pyx":958
 *                     f'Expected: {_CallList(calls)}'
 *                     f'{self._calls_repr(prefix="Actual").rstrip(".")}'
 *                 ) from cause             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __Pyx_Raise(__pyx_t_2, 0, 0, __pyx_v_cause);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 954, __pyx_L1_error)

      /* "cymock.pyx":946
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
 *         if not any_order:
 *             if expected not in all_calls:             # <<<<<<<<<<<<<<
 *                 if cause is None:
 *                     problem = 'Calls not found.'
 */
    }

    /* "cymock.pyx":959
 *                     f'{self._calls_repr(prefix="Actual").rstrip(".")}'
 *                 ) from cause
 *             return             # <<<<<<<<<<<<<<
 * 
 *         all_calls = list(all_calls)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cymock.pyx":945
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
 *         if not any_order:             # <<<<<<<<<<<<<<
 *             if expected not in all_calls:
 *                 if cause is None:
 */
  }

  /* "cymock.pyx":961
 *             return
 * 
 *         all_calls = list(all_calls)             # <<<<<<<<<<<<<<
 * 
 *         not_found = []
 */
  __pyx_t_2 = PySequence_List(__pyx_v_all_calls); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_all_calls, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cymock.pyx":963
 *         all_calls = list(all_calls)
 * 
 *         not_found = []             # <<<<<<<<<<<<<<
 *         for kall in expected:
 *             try:
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_not_found = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cymock.pyx":964
 * 
 *         not_found = []
 *         for kall in expected:             # <<<<<<<<<<<<<<
 *             try:
 *                 all_calls.remove(kall)
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_expected; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_kall, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "cymock.pyx":965
 *         not_found = []
 *         for kall in expected:
 *             try:             # <<<<<<<<<<<<<<
 *                 all_calls.remove(kall)
 *             except ValueError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      /*try:*/ {

        /* "cymock.pyx":966
 *         for kall in expected:
 *             try:
 *                 all_calls.remove(kall)             # <<<<<<<<<<<<<<
 *             except ValueError:
 *                 not_found.append(kall)
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_all_calls, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_v_kall) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_kall);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 966, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cymock.pyx":965
 *         not_found = []
 *         for kall in expected:
 *             try:             # <<<<<<<<<<<<<<
 *                 all_calls.remove(kall)
 *             except ValueError:
 */
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L27_try_end;
      __pyx_L20_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cymock.pyx":967
 *             try:
 *                 all_calls.remove(kall)
 *             except ValueError:             # <<<<<<<<<<<<<<
 *                 not_found.append(kall)
 *         if not_found:
 */
      __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_14) {
        __Pyx_AddTraceback("cymock.NonCallableMock.assert_has_calls", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 967, __pyx_L22_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_7);

        /* "cymock.pyx":968
 *                 all_calls.remove(kall)
 *             except ValueError:
 *                 not_found.append(kall)             # <<<<<<<<<<<<<<
 *         if not_found:
 *             raise AssertionError(
 */
        __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_not_found, __pyx_v_kall); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 968, __pyx_L22_except_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L21_exception_handled;
      }
      goto __pyx_L22_except_error;
      __pyx_L22_except_error:;

      /* "cymock.pyx":965
 *         not_found = []
 *         for kall in expected:
 *             try:             # <<<<<<<<<<<<<<
 *                 all_calls.remove(kall)
 *             except ValueError:
 */
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L1_error;
      __pyx_L21_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_L27_try_end:;
    }

    /* "cymock.pyx":964
 * 
 *         not_found = []
 *         for kall in expected:             # <<<<<<<<<<<<<<
 *             try:
 *                 all_calls.remove(kall)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":969
 *             except ValueError:
 *                 not_found.append(kall)
 *         if not_found:             # <<<<<<<<<<<<<<
 *             raise AssertionError(
 *                 '%r does not contain all of %r in its call list, '
 */
  __pyx_t_9 = (PyList_GET_SIZE(__pyx_v_not_found) != 0);
  if (unlikely(__pyx_t_9)) {

    /* "cymock.pyx":971
 *         if not_found:
 *             raise AssertionError(
 *                 '%r does not contain all of %r in its call list, '             # <<<<<<<<<<<<<<
 *                 'found %r instead' % (self._mock_name or 'mock',
 *                                       tuple(not_found), all_calls)
 */
    __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_10 = 127;

    /* "cymock.pyx":972
 *             raise AssertionError(
 *                 '%r does not contain all of %r in its call list, '
 *                 'found %r instead' % (self._mock_name or 'mock',             # <<<<<<<<<<<<<<
 *                                       tuple(not_found), all_calls)
 *             ) from cause
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 972, __pyx_L1_error)
    if (!__pyx_t_9) {
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L31_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_7 = __pyx_n_u_mock;
    __pyx_L31_bool_binop_done:;
    __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_10;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u_does_not_contain_all_of);
    __pyx_t_3 += 25;
    __Pyx_GIVEREF(__pyx_kp_u_does_not_contain_all_of);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_does_not_contain_all_of);

    /* "cymock.pyx":973
 *                 '%r does not contain all of %r in its call list, '
 *                 'found %r instead' % (self._mock_name or 'mock',
 *                                       tuple(not_found), all_calls)             # <<<<<<<<<<<<<<
 *             ) from cause
 * 
 */
    __pyx_t_5 = PyList_AsTuple(__pyx_v_not_found); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_10;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_in_its_call_list_found);
    __pyx_t_3 += 25;
    __Pyx_GIVEREF(__pyx_kp_u_in_its_call_list_found);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u_in_its_call_list_found);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_all_calls), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_10;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_instead);
    __pyx_t_3 += 8;
    __Pyx_GIVEREF(__pyx_kp_u_instead);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_kp_u_instead);

    /* "cymock.pyx":971
 *         if not_found:
 *             raise AssertionError(
 *                 '%r does not contain all of %r in its call list, '             # <<<<<<<<<<<<<<
 *                 'found %r instead' % (self._mock_name or 'mock',
 *                                       tuple(not_found), all_calls)
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 6, __pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cymock.pyx":970
 *                 not_found.append(kall)
 *         if not_found:
 *             raise AssertionError(             # <<<<<<<<<<<<<<
 *                 '%r does not contain all of %r in its call list, '
 *                 'found %r instead' % (self._mock_name or 'mock',
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cymock.pyx":974
 *                 'found %r instead' % (self._mock_name or 'mock',
 *                                       tuple(not_found), all_calls)
 *             ) from cause             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_Raise(__pyx_t_2, 0, 0, __pyx_v_cause);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 970, __pyx_L1_error)

    /* "cymock.pyx":969
 *             except ValueError:
 *                 not_found.append(kall)
 *         if not_found:             # <<<<<<<<<<<<<<
 *             raise AssertionError(
 *                 '%r does not contain all of %r in its call list, '
 */
  }

  /* "cymock.pyx":932
 * 
 * 
 *     def assert_has_calls(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified calls.
 *         The `mock_calls` list is checked for the calls.
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_has_calls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cause);
  __Pyx_XDECREF(__pyx_v_all_calls);
  __Pyx_XDECREF(__pyx_v_problem);
  __Pyx_XDECREF(__pyx_v_not_found);
  __Pyx_XDECREF(__pyx_v_kall);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_c);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_e);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":977
 * 
 * 
 *     def assert_any_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified arguments.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_57assert_any_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_56assert_any_call[] = "assert the mock has been called with the specified arguments.\n\n        The assert passes if the mock has *ever* been called, unlike\n        `assert_called_with` and `assert_called_once_with` that only pass if\n        the call is the most recent one.";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_57assert_any_call = {"assert_any_call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_57assert_any_call, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_56assert_any_call};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_57assert_any_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_any_call (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "assert_any_call") < 0)) __PYX_ERR(0, 977, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assert_any_call", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 977, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_any_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_56assert_any_call(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_56assert_any_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_expected = NULL;
  PyObject *__pyx_v_actual = NULL;
  PyObject *__pyx_v_cause = NULL;
  PyObject *__pyx_v_expected_string = NULL;
  PyObject *__pyx_8genexpr9__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("assert_any_call", 0);

  /* "cymock.pyx":983
 *         `assert_called_with` and `assert_called_once_with` that only pass if
 *         the call is the most recent one."""
 *         expected = self._call_matcher((args, kwargs))             # <<<<<<<<<<<<<<
 *         actual = [self._call_matcher(c) for c in self.call_args_list]
 *         if expected not in actual:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_kwargs);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_expected = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":984
 *         the call is the most recent one."""
 *         expected = self._call_matcher((args, kwargs))
 *         actual = [self._call_matcher(c) for c in self.call_args_list]             # <<<<<<<<<<<<<<
 *         if expected not in actual:
 *             cause = expected if isinstance(expected, Exception) else None
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_args_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 984, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 984, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 984, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 984, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_c, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_8genexpr9__pyx_v_c) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_8genexpr9__pyx_v_c);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 984, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_c); __pyx_8genexpr9__pyx_v_c = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_c); __pyx_8genexpr9__pyx_v_c = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_v_actual = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":985
 *         expected = self._call_matcher((args, kwargs))
 *         actual = [self._call_matcher(c) for c in self.call_args_list]
 *         if expected not in actual:             # <<<<<<<<<<<<<<
 *             cause = expected if isinstance(expected, Exception) else None
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 */
  __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_expected, __pyx_v_actual, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 985, __pyx_L1_error)
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (unlikely(__pyx_t_9)) {

    /* "cymock.pyx":986
 *         actual = [self._call_matcher(c) for c in self.call_args_list]
 *         if expected not in actual:
 *             cause = expected if isinstance(expected, Exception) else None             # <<<<<<<<<<<<<<
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(
 */
    __pyx_t_9 = __Pyx_PyException_Check(__pyx_v_expected); 
    if ((__pyx_t_9 != 0)) {
      __Pyx_INCREF(__pyx_v_expected);
      __pyx_t_1 = __pyx_v_expected;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_1 = Py_None;
    }
    __pyx_v_cause = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":987
 *         if expected not in actual:
 *             cause = expected if isinstance(expected, Exception) else None
 *             expected_string = self._format_mock_call_signature(args, kwargs)             # <<<<<<<<<<<<<<
 *             raise AssertionError(
 *                 '%s call not found' % expected_string
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_mock_call_signature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_args, __pyx_v_kwargs};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_args, __pyx_v_kwargs};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_10, __pyx_v_args);
      __Pyx_INCREF(__pyx_v_kwargs);
      __Pyx_GIVEREF(__pyx_v_kwargs);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_10, __pyx_v_kwargs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_expected_string = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":989
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(
 *                 '%s call not found' % expected_string             # <<<<<<<<<<<<<<
 *             ) from cause
 * 
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_call_not_found, __pyx_v_expected_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cymock.pyx":988
 *             cause = expected if isinstance(expected, Exception) else None
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(             # <<<<<<<<<<<<<<
 *                 '%s call not found' % expected_string
 *             ) from cause
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":990
 *             raise AssertionError(
 *                 '%s call not found' % expected_string
 *             ) from cause             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_Raise(__pyx_t_3, 0, 0, __pyx_v_cause);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 988, __pyx_L1_error)

    /* "cymock.pyx":985
 *         expected = self._call_matcher((args, kwargs))
 *         actual = [self._call_matcher(c) for c in self.call_args_list]
 *         if expected not in actual:             # <<<<<<<<<<<<<<
 *             cause = expected if isinstance(expected, Exception) else None
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 */
  }

  /* "cymock.pyx":977
 * 
 * 
 *     def assert_any_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified arguments.
 * 
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.NonCallableMock.assert_any_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expected);
  __Pyx_XDECREF(__pyx_v_actual);
  __Pyx_XDECREF(__pyx_v_cause);
  __Pyx_XDECREF(__pyx_v_expected_string);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":993
 * 
 * 
 *     def _get_child_mock(self, **kw):             # <<<<<<<<<<<<<<
 *         """Create the child mocks for attributes and return value.
 *         By default child mocks will be the same type as the parent.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_59_get_child_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_58_get_child_mock[] = "Create the child mocks for attributes and return value.\n        By default child mocks will be the same type as the parent.\n        Subclasses of Mock may want to override this to customize the way\n        child mocks are made.\n\n        For non-callable mocks the callable variant will be used (rather than\n        any custom subclass).";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_59_get_child_mock = {"_get_child_mock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_59_get_child_mock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_58_get_child_mock};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_59_get_child_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_child_mock (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "_get_child_mock") < 0)) __PYX_ERR(0, 993, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_child_mock", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 993, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("cymock.NonCallableMock._get_child_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_58_get_child_mock(__pyx_self, __pyx_v_self, __pyx_v_kw);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_58_get_child_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v__new_name = NULL;
  PyTypeObject *__pyx_v__type = NULL;
  PyObject *__pyx_v_klass = NULL;
  PyObject *__pyx_v_attribute = NULL;
  PyObject *__pyx_v_mock_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_get_child_mock", 0);

  /* "cymock.pyx":1001
 *         For non-callable mocks the callable variant will be used (rather than
 *         any custom subclass)."""
 *         _new_name = kw.get("_new_name")             # <<<<<<<<<<<<<<
 *         if _new_name in self.__dict__['_spec_asyncs']:
 *             return AsyncMock(**kw)
 */
  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_u_new_name_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__new_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1002
 *         any custom subclass)."""
 *         _new_name = kw.get("_new_name")
 *         if _new_name in self.__dict__['_spec_asyncs']:             # <<<<<<<<<<<<<<
 *             return AsyncMock(**kw)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_spec_asyncs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v__new_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":1003
 *         _new_name = kw.get("_new_name")
 *         if _new_name in self.__dict__['_spec_asyncs']:
 *             return AsyncMock(**kw)             # <<<<<<<<<<<<<<
 * 
 *         _type = type(self)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_v_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __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;

    /* "cymock.pyx":1002
 *         any custom subclass)."""
 *         _new_name = kw.get("_new_name")
 *         if _new_name in self.__dict__['_spec_asyncs']:             # <<<<<<<<<<<<<<
 *             return AsyncMock(**kw)
 * 
 */
  }

  /* "cymock.pyx":1005
 *             return AsyncMock(**kw)
 * 
 *         _type = type(self)             # <<<<<<<<<<<<<<
 *         if issubclass(_type, MagicMock) and _new_name in _async_method_magics:
 *             # Any asynchronous magic becomes an AsyncMock
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self)));
  __pyx_v__type = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_self)));

  /* "cymock.pyx":1006
 * 
 *         _type = type(self)
 *         if issubclass(_type, MagicMock) and _new_name in _async_method_magics:             # <<<<<<<<<<<<<<
 *             # Any asynchronous magic becomes an AsyncMock
 *             klass = AsyncMock
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_IsSubclass(((PyObject *)__pyx_v__type), __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_3 != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_async_method_magics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v__new_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_5 != 0);
  __pyx_t_4 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "cymock.pyx":1008
 *         if issubclass(_type, MagicMock) and _new_name in _async_method_magics:
 *             # Any asynchronous magic becomes an AsyncMock
 *             klass = AsyncMock             # <<<<<<<<<<<<<<
 *         elif issubclass(_type, AsyncMockMixin):
 *             if (_new_name in _all_sync_magics or
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_klass = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":1006
 * 
 *         _type = type(self)
 *         if issubclass(_type, MagicMock) and _new_name in _async_method_magics:             # <<<<<<<<<<<<<<
 *             # Any asynchronous magic becomes an AsyncMock
 *             klass = AsyncMock
 */
    goto __pyx_L4;
  }

  /* "cymock.pyx":1009
 *             # Any asynchronous magic becomes an AsyncMock
 *             klass = AsyncMock
 *         elif issubclass(_type, AsyncMockMixin):             # <<<<<<<<<<<<<<
 *             if (_new_name in _all_sync_magics or
 *                     self._mock_methods and _new_name in self._mock_methods):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AsyncMockMixin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_IsSubclass(((PyObject *)__pyx_v__type), __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1009, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1010
 *             klass = AsyncMock
 *         elif issubclass(_type, AsyncMockMixin):
 *             if (_new_name in _all_sync_magics or             # <<<<<<<<<<<<<<
 *                     self._mock_methods and _new_name in self._mock_methods):
 *                 # Any synchronous method on AsyncMock becomes a MagicMock
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_all_sync_magics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v__new_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1010, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }

    /* "cymock.pyx":1011
 *         elif issubclass(_type, AsyncMockMixin):
 *             if (_new_name in _all_sync_magics or
 *                     self._mock_methods and _new_name in self._mock_methods):             # <<<<<<<<<<<<<<
 *                 # Any synchronous method on AsyncMock becomes a MagicMock
 *                 klass = MagicMock
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v__new_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_t_5 != 0);
    __pyx_t_3 = __pyx_t_4;
    __pyx_L8_bool_binop_done:;

    /* "cymock.pyx":1010
 *             klass = AsyncMock
 *         elif issubclass(_type, AsyncMockMixin):
 *             if (_new_name in _all_sync_magics or             # <<<<<<<<<<<<<<
 *                     self._mock_methods and _new_name in self._mock_methods):
 *                 # Any synchronous method on AsyncMock becomes a MagicMock
 */
    if (__pyx_t_3) {

      /* "cymock.pyx":1013
 *                     self._mock_methods and _new_name in self._mock_methods):
 *                 # Any synchronous method on AsyncMock becomes a MagicMock
 *                 klass = MagicMock             # <<<<<<<<<<<<<<
 *             else:
 *                 klass = AsyncMock
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_klass = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cymock.pyx":1010
 *             klass = AsyncMock
 *         elif issubclass(_type, AsyncMockMixin):
 *             if (_new_name in _all_sync_magics or             # <<<<<<<<<<<<<<
 *                     self._mock_methods and _new_name in self._mock_methods):
 *                 # Any synchronous method on AsyncMock becomes a MagicMock
 */
      goto __pyx_L7;
    }

    /* "cymock.pyx":1015
 *                 klass = MagicMock
 *             else:
 *                 klass = AsyncMock             # <<<<<<<<<<<<<<
 *         elif not issubclass(_type, CallableMixin):
 *             if issubclass(_type, NonCallableMagicMock):
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_klass = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_L7:;

    /* "cymock.pyx":1009
 *             # Any asynchronous magic becomes an AsyncMock
 *             klass = AsyncMock
 *         elif issubclass(_type, AsyncMockMixin):             # <<<<<<<<<<<<<<
 *             if (_new_name in _all_sync_magics or
 *                     self._mock_methods and _new_name in self._mock_methods):
 */
    goto __pyx_L4;
  }

  /* "cymock.pyx":1016
 *             else:
 *                 klass = AsyncMock
 *         elif not issubclass(_type, CallableMixin):             # <<<<<<<<<<<<<<
 *             if issubclass(_type, NonCallableMagicMock):
 *                 klass = MagicMock
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CallableMixin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_IsSubclass(((PyObject *)__pyx_v__type), __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":1017
 *                 klass = AsyncMock
 *         elif not issubclass(_type, CallableMixin):
 *             if issubclass(_type, NonCallableMagicMock):             # <<<<<<<<<<<<<<
 *                 klass = MagicMock
 *             elif issubclass(_type, NonCallableMock):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMagicMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_IsSubclass(((PyObject *)__pyx_v__type), __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "cymock.pyx":1018
 *         elif not issubclass(_type, CallableMixin):
 *             if issubclass(_type, NonCallableMagicMock):
 *                 klass = MagicMock             # <<<<<<<<<<<<<<
 *             elif issubclass(_type, NonCallableMock):
 *                 klass = Mock
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_klass = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cymock.pyx":1017
 *                 klass = AsyncMock
 *         elif not issubclass(_type, CallableMixin):
 *             if issubclass(_type, NonCallableMagicMock):             # <<<<<<<<<<<<<<
 *                 klass = MagicMock
 *             elif issubclass(_type, NonCallableMock):
 */
      goto __pyx_L11;
    }

    /* "cymock.pyx":1019
 *             if issubclass(_type, NonCallableMagicMock):
 *                 klass = MagicMock
 *             elif issubclass(_type, NonCallableMock):             # <<<<<<<<<<<<<<
 *                 klass = Mock
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_IsSubclass(((PyObject *)__pyx_v__type), __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1019, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (__pyx_t_4) {

      /* "cymock.pyx":1020
 *                 klass = MagicMock
 *             elif issubclass(_type, NonCallableMock):
 *                 klass = Mock             # <<<<<<<<<<<<<<
 *         else:
 *             klass = _type.__mro__[1]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Mock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_klass = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cymock.pyx":1019
 *             if issubclass(_type, NonCallableMagicMock):
 *                 klass = MagicMock
 *             elif issubclass(_type, NonCallableMock):             # <<<<<<<<<<<<<<
 *                 klass = Mock
 *         else:
 */
    }
    __pyx_L11:;

    /* "cymock.pyx":1016
 *             else:
 *                 klass = AsyncMock
 *         elif not issubclass(_type, CallableMixin):             # <<<<<<<<<<<<<<
 *             if issubclass(_type, NonCallableMagicMock):
 *                 klass = MagicMock
 */
    goto __pyx_L4;
  }

  /* "cymock.pyx":1022
 *                 klass = Mock
 *         else:
 *             klass = _type.__mro__[1]             # <<<<<<<<<<<<<<
 * 
 *         if self._mock_sealed:
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v__type), __pyx_n_s_mro); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_klass = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "cymock.pyx":1024
 *             klass = _type.__mro__[1]
 * 
 *         if self._mock_sealed:             # <<<<<<<<<<<<<<
 *             attribute = "." + kw["name"] if "name" in kw else "()"
 *             mock_name = self._extract_mock_name() + attribute
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_sealed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1024, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "cymock.pyx":1025
 * 
 *         if self._mock_sealed:
 *             attribute = "." + kw["name"] if "name" in kw else "()"             # <<<<<<<<<<<<<<
 *             mock_name = self._extract_mock_name() + attribute
 *             raise AttributeError(mock_name)
 */
    __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_name_2, __pyx_v_kw, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1025, __pyx_L1_error)
    if ((__pyx_t_4 != 0)) {
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_kw, __pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyNumber_Add(__pyx_kp_u__33, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1025, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_2 = __pyx_t_6;
      __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(__pyx_kp_u__32);
      __pyx_t_2 = __pyx_kp_u__32;
    }
    __pyx_v_attribute = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "cymock.pyx":1026
 *         if self._mock_sealed:
 *             attribute = "." + kw["name"] if "name" in kw else "()"
 *             mock_name = self._extract_mock_name() + attribute             # <<<<<<<<<<<<<<
 *             raise AttributeError(mock_name)
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extract_mock_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_v_attribute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_mock_name = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cymock.pyx":1027
 *             attribute = "." + kw["name"] if "name" in kw else "()"
 *             mock_name = self._extract_mock_name() + attribute
 *             raise AttributeError(mock_name)             # <<<<<<<<<<<<<<
 * 
 *         return klass(**kw)
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_mock_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1027, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 1027, __pyx_L1_error)

    /* "cymock.pyx":1024
 *             klass = _type.__mro__[1]
 * 
 *         if self._mock_sealed:             # <<<<<<<<<<<<<<
 *             attribute = "." + kw["name"] if "name" in kw else "()"
 *             mock_name = self._extract_mock_name() + attribute
 */
  }

  /* "cymock.pyx":1029
 *             raise AttributeError(mock_name)
 * 
 *         return klass(**kw)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_klass)) { __Pyx_RaiseUnboundLocalError("klass"); __PYX_ERR(0, 1029, __pyx_L1_error) }
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_klass, __pyx_empty_tuple, __pyx_v_kw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":993
 * 
 * 
 *     def _get_child_mock(self, **kw):             # <<<<<<<<<<<<<<
 *         """Create the child mocks for attributes and return value.
 *         By default child mocks will be the same type as the parent.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock.NonCallableMock._get_child_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__new_name);
  __Pyx_XDECREF(__pyx_v__type);
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF(__pyx_v_attribute);
  __Pyx_XDECREF(__pyx_v_mock_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1032
 * 
 * 
 *     def _calls_repr(self, prefix="Calls"):             # <<<<<<<<<<<<<<
 *         """Renders self.mock_calls as a string.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15NonCallableMock_61_calls_repr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_15NonCallableMock_60_calls_repr[] = "Renders self.mock_calls as a string.\n\n        Example: \"\nCalls: [call(1), call(2)].\"\n\n        If self.mock_calls is empty, an empty string is returned. The\n        output will be truncated if very long.\n        ";
static PyMethodDef __pyx_mdef_6cymock_15NonCallableMock_61_calls_repr = {"_calls_repr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15NonCallableMock_61_calls_repr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_15NonCallableMock_60_calls_repr};
static PyObject *__pyx_pw_6cymock_15NonCallableMock_61_calls_repr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_prefix = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calls_repr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_prefix,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_n_u_Calls));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_calls_repr") < 0)) __PYX_ERR(0, 1032, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_prefix = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calls_repr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1032, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMock._calls_repr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15NonCallableMock_60_calls_repr(__pyx_self, __pyx_v_self, __pyx_v_prefix);

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

static PyObject *__pyx_pf_6cymock_15NonCallableMock_60_calls_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_prefix) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_calls_repr", 0);

  /* "cymock.pyx":1040
 *         output will be truncated if very long.
 *         """
 *         if not self.mock_calls:             # <<<<<<<<<<<<<<
 *             return ""
 *         return f"\n{prefix}: {safe_repr(self.mock_calls)}."
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_calls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1040, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1041
 *         """
 *         if not self.mock_calls:
 *             return ""             # <<<<<<<<<<<<<<
 *         return f"\n{prefix}: {safe_repr(self.mock_calls)}."
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_kp_u__31);
    __pyx_r = __pyx_kp_u__31;
    goto __pyx_L0;

    /* "cymock.pyx":1040
 *         output will be truncated if very long.
 *         """
 *         if not self.mock_calls:             # <<<<<<<<<<<<<<
 *             return ""
 *         return f"\n{prefix}: {safe_repr(self.mock_calls)}."
 */
  }

  /* "cymock.pyx":1042
 *         if not self.mock_calls:
 *             return ""
 *         return f"\n{prefix}: {safe_repr(self.mock_calls)}."             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_5 = 127;
  __Pyx_INCREF(__pyx_kp_u__43);
  __pyx_t_4 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__43);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__43);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_prefix, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u__44);
  __pyx_t_4 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__44);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__44);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_repr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_calls); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
  __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
  __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_kp_u__33);
  __pyx_t_4 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__33);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__33);
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1032
 * 
 * 
 *     def _calls_repr(self, prefix="Calls"):             # <<<<<<<<<<<<<<
 *         """Renders self.mock_calls as a string.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cymock.NonCallableMock._calls_repr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1046
 * 
 * 
 * def _try_iter(obj):             # <<<<<<<<<<<<<<
 *     if obj is None:
 *         return obj
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_35_try_iter(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_35_try_iter = {"_try_iter", (PyCFunction)__pyx_pw_6cymock_35_try_iter, METH_O, 0};
static PyObject *__pyx_pw_6cymock_35_try_iter(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_try_iter (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_34_try_iter(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_6cymock_34_try_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("_try_iter", 0);

  /* "cymock.pyx":1047
 * 
 * def _try_iter(obj):
 *     if obj is None:             # <<<<<<<<<<<<<<
 *         return obj
 *     if _is_exception(obj):
 */
  __pyx_t_1 = (__pyx_v_obj == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":1048
 * def _try_iter(obj):
 *     if obj is None:
 *         return obj             # <<<<<<<<<<<<<<
 *     if _is_exception(obj):
 *         return obj
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_r = __pyx_v_obj;
    goto __pyx_L0;

    /* "cymock.pyx":1047
 * 
 * def _try_iter(obj):
 *     if obj is None:             # <<<<<<<<<<<<<<
 *         return obj
 *     if _is_exception(obj):
 */
  }

  /* "cymock.pyx":1049
 *     if obj is None:
 *         return obj
 *     if _is_exception(obj):             # <<<<<<<<<<<<<<
 *         return obj
 *     if _callable(obj):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cymock.pyx":1050
 *         return obj
 *     if _is_exception(obj):
 *         return obj             # <<<<<<<<<<<<<<
 *     if _callable(obj):
 *         return obj
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_r = __pyx_v_obj;
    goto __pyx_L0;

    /* "cymock.pyx":1049
 *     if obj is None:
 *         return obj
 *     if _is_exception(obj):             # <<<<<<<<<<<<<<
 *         return obj
 *     if _callable(obj):
 */
  }

  /* "cymock.pyx":1051
 *     if _is_exception(obj):
 *         return obj
 *     if _callable(obj):             # <<<<<<<<<<<<<<
 *         return obj
 *     try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_callable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cymock.pyx":1052
 *         return obj
 *     if _callable(obj):
 *         return obj             # <<<<<<<<<<<<<<
 *     try:
 *         return iter(obj)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_r = __pyx_v_obj;
    goto __pyx_L0;

    /* "cymock.pyx":1051
 *     if _is_exception(obj):
 *         return obj
 *     if _callable(obj):             # <<<<<<<<<<<<<<
 *         return obj
 *     try:
 */
  }

  /* "cymock.pyx":1053
 *     if _callable(obj):
 *         return obj
 *     try:             # <<<<<<<<<<<<<<
 *         return iter(obj)
 *     except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "cymock.pyx":1054
 *         return obj
 *     try:
 *         return iter(obj)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         # XXXX backwards compatibility
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1054, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L10_try_return;

      /* "cymock.pyx":1053
 *     if _callable(obj):
 *         return obj
 *     try:             # <<<<<<<<<<<<<<
 *         return iter(obj)
 *     except TypeError:
 */
    }
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cymock.pyx":1055
 *     try:
 *         return iter(obj)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         # XXXX backwards compatibility
 *         # but this will blow up on first call - so maybe we should fail early?
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cymock._try_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 1055, __pyx_L8_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);

      /* "cymock.pyx":1058
 *         # XXXX backwards compatibility
 *         # but this will blow up on first call - so maybe we should fail early?
 *         return obj             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_obj);
      __pyx_r = __pyx_v_obj;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_except_return;
    }
    goto __pyx_L8_except_error;
    __pyx_L8_except_error:;

    /* "cymock.pyx":1053
 *     if _callable(obj):
 *         return obj
 *     try:             # <<<<<<<<<<<<<<
 *         return iter(obj)
 *     except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L10_try_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L9_except_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
  }

  /* "cymock.pyx":1046
 * 
 * 
 * def _try_iter(obj):             # <<<<<<<<<<<<<<
 *     if obj is None:
 *         return obj
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cymock._try_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1063
 * class CallableMixin(Base):
 * 
 *     def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,             # <<<<<<<<<<<<<<
 *                  wraps=None, name=None, spec_set=None, parent=None,
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):
 */

static PyObject *__pyx_pf_6cymock_86__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);

  /* "cymock.pyx":1065
 *     def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,
 *                  wraps=None, name=None, spec_set=None, parent=None,
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):             # <<<<<<<<<<<<<<
 *         self.__dict__['_mock_return_value'] = return_value
 *         _safe_super(CallableMixin, self).__init__(
 */
  __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_return_value);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_return_value);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_return_value);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_kp_u__31));
  __Pyx_GIVEREF(((PyObject*)__pyx_kp_u__31));
  PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject*)__pyx_kp_u__31));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 9, ((PyObject *)Py_None));

  /* "cymock.pyx":1063
 * class CallableMixin(Base):
 * 
 *     def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,             # <<<<<<<<<<<<<<
 *                  wraps=None, name=None, spec_set=None, parent=None,
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_13CallableMixin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_13CallableMixin_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_13CallableMixin_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_13CallableMixin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_side_effect = 0;
  PyObject *__pyx_v_return_value = 0;
  PyObject *__pyx_v_wraps = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v__spec_state = 0;
  PyObject *__pyx_v__new_name = 0;
  PyObject *__pyx_v__new_parent = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_spec,&__pyx_n_s_side_effect,&__pyx_n_s_return_value,&__pyx_n_s_wraps,&__pyx_n_s_name_2,&__pyx_n_s_spec_set,&__pyx_n_s_parent,&__pyx_n_s_spec_state,&__pyx_n_s_new_name_2,&__pyx_n_s_new_parent,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = __pyx_dynamic_args->__pyx_arg_return_value;
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_None));
    values[7] = ((PyObject *)((PyObject *)Py_None));
    values[8] = ((PyObject *)((PyObject *)Py_None));
    values[9] = ((PyObject *)((PyObject*)__pyx_kp_u__31));
    values[10] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_side_effect);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_value);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wraps);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_state);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_name_2);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_parent);
          if (value) { values[10] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1063, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_spec = values[1];
    __pyx_v_side_effect = values[2];
    __pyx_v_return_value = values[3];
    __pyx_v_wraps = values[4];
    __pyx_v_name = values[5];
    __pyx_v_spec_set = values[6];
    __pyx_v_parent = values[7];
    __pyx_v__spec_state = values[8];
    __pyx_v__new_name = values[9];
    __pyx_v__new_parent = values[10];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1063, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.CallableMixin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_13CallableMixin___init__(__pyx_self, __pyx_v_self, __pyx_v_spec, __pyx_v_side_effect, __pyx_v_return_value, __pyx_v_wraps, __pyx_v_name, __pyx_v_spec_set, __pyx_v_parent, __pyx_v__spec_state, __pyx_v__new_name, __pyx_v__new_parent, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_13CallableMixin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_side_effect, PyObject *__pyx_v_return_value, PyObject *__pyx_v_wraps, PyObject *__pyx_v_name, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_parent, PyObject *__pyx_v__spec_state, PyObject *__pyx_v__new_name, PyObject *__pyx_v__new_parent, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":1066
 *                  wraps=None, name=None, spec_set=None, parent=None,
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):
 *         self.__dict__['_mock_return_value'] = return_value             # <<<<<<<<<<<<<<
 *         _safe_super(CallableMixin, self).__init__(
 *             spec, wraps, name, spec_set, parent,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_mock_return_value, __pyx_v_return_value) < 0)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1067
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):
 *         self.__dict__['_mock_return_value'] = return_value
 *         _safe_super(CallableMixin, self).__init__(             # <<<<<<<<<<<<<<
 *             spec, wraps, name, spec_set, parent,
 *             _spec_state, _new_name, _new_parent, **kwargs
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_super); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CallableMixin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1069
 *         _safe_super(CallableMixin, self).__init__(
 *             spec, wraps, name, spec_set, parent,
 *             _spec_state, _new_name, _new_parent, **kwargs             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_spec);
  __Pyx_GIVEREF(__pyx_v_spec);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_spec);
  __Pyx_INCREF(__pyx_v_wraps);
  __Pyx_GIVEREF(__pyx_v_wraps);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_wraps);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_name);
  __Pyx_INCREF(__pyx_v_spec_set);
  __Pyx_GIVEREF(__pyx_v_spec_set);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_spec_set);
  __Pyx_INCREF(__pyx_v_parent);
  __Pyx_GIVEREF(__pyx_v_parent);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_parent);
  __Pyx_INCREF(__pyx_v__spec_state);
  __Pyx_GIVEREF(__pyx_v__spec_state);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v__spec_state);
  __Pyx_INCREF(__pyx_v__new_name);
  __Pyx_GIVEREF(__pyx_v__new_name);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v__new_name);
  __Pyx_INCREF(__pyx_v__new_parent);
  __Pyx_GIVEREF(__pyx_v__new_parent);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v__new_parent);

  /* "cymock.pyx":1067
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):
 *         self.__dict__['_mock_return_value'] = return_value
 *         _safe_super(CallableMixin, self).__init__(             # <<<<<<<<<<<<<<
 *             spec, wraps, name, spec_set, parent,
 *             _spec_state, _new_name, _new_parent, **kwargs
 */
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":1072
 *         )
 * 
 *         self.side_effect = side_effect             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_side_effect, __pyx_v_side_effect) < 0) __PYX_ERR(0, 1072, __pyx_L1_error)

  /* "cymock.pyx":1063
 * class CallableMixin(Base):
 * 
 *     def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,             # <<<<<<<<<<<<<<
 *                  wraps=None, name=None, spec_set=None, parent=None,
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock.CallableMixin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1075
 * 
 * 
 *     def _mock_check_sig(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # stub method that can be replaced with one with a specific signature
 *         pass
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_13CallableMixin_3_mock_check_sig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_13CallableMixin_3_mock_check_sig = {"_mock_check_sig", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_13CallableMixin_3_mock_check_sig, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_13CallableMixin_3_mock_check_sig(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_mock_check_sig (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "_mock_check_sig") < 0)) __PYX_ERR(0, 1075, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_mock_check_sig", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1075, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.CallableMixin._mock_check_sig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_13CallableMixin_2_mock_check_sig(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_13CallableMixin_2_mock_check_sig(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_mock_check_sig", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1080
 * 
 * 
 *     def __call__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # can't use self in-case a function / method we are mocking uses self
 *         # in the signature
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_13CallableMixin_5__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_13CallableMixin_5__call__ = {"__call__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_13CallableMixin_5__call__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_13CallableMixin_5__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__call__") < 0)) __PYX_ERR(0, 1080, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1080, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.CallableMixin.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_13CallableMixin_4__call__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_13CallableMixin_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "cymock.pyx":1083
 *         # can't use self in-case a function / method we are mocking uses self
 *         # in the signature
 *         self._mock_check_sig(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         self._increment_mock_call(*args, **kwargs)
 *         return self._mock_call(*args, **kwargs)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_check_sig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1084
 *         # in the signature
 *         self._mock_check_sig(*args, **kwargs)
 *         self._increment_mock_call(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         return self._mock_call(*args, **kwargs)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_increment_mock_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __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;

  /* "cymock.pyx":1085
 *         self._mock_check_sig(*args, **kwargs)
 *         self._increment_mock_call(*args, **kwargs)
 *         return self._mock_call(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_call); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1085, __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;

  /* "cymock.pyx":1080
 * 
 * 
 *     def __call__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # can't use self in-case a function / method we are mocking uses self
 *         # in the signature
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.CallableMixin.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1088
 * 
 * 
 *     def _mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self._execute_mock_call(*args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_13CallableMixin_7_mock_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_13CallableMixin_7_mock_call = {"_mock_call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_13CallableMixin_7_mock_call, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_13CallableMixin_7_mock_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_mock_call (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "_mock_call") < 0)) __PYX_ERR(0, 1088, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_mock_call", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1088, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.CallableMixin._mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_13CallableMixin_6_mock_call(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_13CallableMixin_6_mock_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_mock_call", 0);

  /* "cymock.pyx":1089
 * 
 *     def _mock_call(self, *args, **kwargs):
 *         return self._execute_mock_call(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def _increment_mock_call(self, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute_mock_call); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __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;

  /* "cymock.pyx":1088
 * 
 * 
 *     def _mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self._execute_mock_call(*args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.CallableMixin._mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1091
 *         return self._execute_mock_call(*args, **kwargs)
 * 
 *     def _increment_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.called = True
 *         self.call_count += 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_13CallableMixin_9_increment_mock_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_13CallableMixin_9_increment_mock_call = {"_increment_mock_call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_13CallableMixin_9_increment_mock_call, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_13CallableMixin_9_increment_mock_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_increment_mock_call (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "_increment_mock_call") < 0)) __PYX_ERR(0, 1091, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_increment_mock_call", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1091, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.CallableMixin._increment_mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_13CallableMixin_8_increment_mock_call(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_13CallableMixin_8_increment_mock_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v__call = NULL;
  PyObject *__pyx_v_do_method_calls = NULL;
  PyObject *__pyx_v_method_call_name = NULL;
  PyObject *__pyx_v_mock_call_name = NULL;
  PyObject *__pyx_v_is_a_call = NULL;
  PyObject *__pyx_v__new_parent = NULL;
  PyObject *__pyx_v_this_mock_call = NULL;
  PyObject *__pyx_v_dot = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_increment_mock_call", 0);

  /* "cymock.pyx":1092
 * 
 *     def _increment_mock_call(self, *args, **kwargs):
 *         self.called = True             # <<<<<<<<<<<<<<
 *         self.call_count += 1
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_called, Py_True) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)

  /* "cymock.pyx":1093
 *     def _increment_mock_call(self, *args, **kwargs):
 *         self.called = True
 *         self.call_count += 1             # <<<<<<<<<<<<<<
 * 
 *         # handle call_args
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_call_count, __pyx_t_2) < 0) __PYX_ERR(0, 1093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1098
 *         # needs to be set here so assertions on call arguments pass before
 *         # execution in the case of awaited calls
 *         _call = _Call((args, kwargs), two=True)             # <<<<<<<<<<<<<<
 *         self.call_args = _call
 *         self.call_args_list.append(_call)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_kwargs);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_two, Py_True) < 0) __PYX_ERR(0, 1098, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__call = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":1099
 *         # execution in the case of awaited calls
 *         _call = _Call((args, kwargs), two=True)
 *         self.call_args = _call             # <<<<<<<<<<<<<<
 *         self.call_args_list.append(_call)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_call_args, __pyx_v__call) < 0) __PYX_ERR(0, 1099, __pyx_L1_error)

  /* "cymock.pyx":1100
 *         _call = _Call((args, kwargs), two=True)
 *         self.call_args = _call
 *         self.call_args_list.append(_call)             # <<<<<<<<<<<<<<
 * 
 *         # initial stuff for method_calls:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_args_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v__call); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cymock.pyx":1103
 * 
 *         # initial stuff for method_calls:
 *         do_method_calls = self._mock_parent is not None             # <<<<<<<<<<<<<<
 *         method_call_name = self._mock_name
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_do_method_calls = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":1104
 *         # initial stuff for method_calls:
 *         do_method_calls = self._mock_parent is not None
 *         method_call_name = self._mock_name             # <<<<<<<<<<<<<<
 * 
 *         # initial stuff for mock_calls:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_method_call_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":1107
 * 
 *         # initial stuff for mock_calls:
 *         mock_call_name = self._mock_new_name             # <<<<<<<<<<<<<<
 *         is_a_call = mock_call_name == '()'
 *         self.mock_calls.append(_Call(('', args, kwargs)))
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_new_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_mock_call_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":1108
 *         # initial stuff for mock_calls:
 *         mock_call_name = self._mock_new_name
 *         is_a_call = mock_call_name == '()'             # <<<<<<<<<<<<<<
 *         self.mock_calls.append(_Call(('', args, kwargs)))
 * 
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_mock_call_name, __pyx_kp_u__32, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __pyx_v_is_a_call = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":1109
 *         mock_call_name = self._mock_new_name
 *         is_a_call = mock_call_name == '()'
 *         self.mock_calls.append(_Call(('', args, kwargs)))             # <<<<<<<<<<<<<<
 * 
 *         # follow up the chain of mocks:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_calls); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Call); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_kp_u__31);
  __Pyx_GIVEREF(__pyx_kp_u__31);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__31);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kwargs);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1112
 * 
 *         # follow up the chain of mocks:
 *         _new_parent = self._mock_new_parent             # <<<<<<<<<<<<<<
 *         while _new_parent is not None:
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_new_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__new_parent = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1113
 *         # follow up the chain of mocks:
 *         _new_parent = self._mock_new_parent
 *         while _new_parent is not None:             # <<<<<<<<<<<<<<
 * 
 *             # handle method_calls:
 */
  while (1) {
    __pyx_t_6 = (__pyx_v__new_parent != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) break;

    /* "cymock.pyx":1116
 * 
 *             # handle method_calls:
 *             if do_method_calls:             # <<<<<<<<<<<<<<
 *                 _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))
 *                 do_method_calls = _new_parent._mock_parent is not None
 */
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_do_method_calls); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1116, __pyx_L1_error)
    if (__pyx_t_8) {

      /* "cymock.pyx":1117
 *             # handle method_calls:
 *             if do_method_calls:
 *                 _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))             # <<<<<<<<<<<<<<
 *                 do_method_calls = _new_parent._mock_parent is not None
 *                 if do_method_calls:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__new_parent, __pyx_n_s_method_calls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Call); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_method_call_name);
      __Pyx_GIVEREF(__pyx_v_method_call_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_method_call_name);
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
      __Pyx_INCREF(__pyx_v_kwargs);
      __Pyx_GIVEREF(__pyx_v_kwargs);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kwargs);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1117, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cymock.pyx":1118
 *             if do_method_calls:
 *                 _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))
 *                 do_method_calls = _new_parent._mock_parent is not None             # <<<<<<<<<<<<<<
 *                 if do_method_calls:
 *                     method_call_name = _new_parent._mock_name + '.' + method_call_name
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__new_parent, __pyx_n_s_mock_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (__pyx_t_4 != Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_do_method_calls, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "cymock.pyx":1119
 *                 _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))
 *                 do_method_calls = _new_parent._mock_parent is not None
 *                 if do_method_calls:             # <<<<<<<<<<<<<<
 *                     method_call_name = _new_parent._mock_name + '.' + method_call_name
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_do_method_calls); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1119, __pyx_L1_error)
      if (__pyx_t_8) {

        /* "cymock.pyx":1120
 *                 do_method_calls = _new_parent._mock_parent is not None
 *                 if do_method_calls:
 *                     method_call_name = _new_parent._mock_name + '.' + method_call_name             # <<<<<<<<<<<<<<
 * 
 *             # handle mock_calls:
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__new_parent, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__33); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_method_call_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF_SET(__pyx_v_method_call_name, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cymock.pyx":1119
 *                 _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))
 *                 do_method_calls = _new_parent._mock_parent is not None
 *                 if do_method_calls:             # <<<<<<<<<<<<<<
 *                     method_call_name = _new_parent._mock_name + '.' + method_call_name
 * 
 */
      }

      /* "cymock.pyx":1116
 * 
 *             # handle method_calls:
 *             if do_method_calls:             # <<<<<<<<<<<<<<
 *                 _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))
 *                 do_method_calls = _new_parent._mock_parent is not None
 */
    }

    /* "cymock.pyx":1123
 * 
 *             # handle mock_calls:
 *             this_mock_call = _Call((mock_call_name, args, kwargs))             # <<<<<<<<<<<<<<
 *             _new_parent.mock_calls.append(this_mock_call)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Call); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_mock_call_name);
    __Pyx_GIVEREF(__pyx_v_mock_call_name);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_mock_call_name);
    __Pyx_INCREF(__pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
    __Pyx_INCREF(__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kwargs);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_this_mock_call, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":1124
 *             # handle mock_calls:
 *             this_mock_call = _Call((mock_call_name, args, kwargs))
 *             _new_parent.mock_calls.append(this_mock_call)             # <<<<<<<<<<<<<<
 * 
 *             if _new_parent._mock_new_name:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__new_parent, __pyx_n_s_mock_calls); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_this_mock_call); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cymock.pyx":1126
 *             _new_parent.mock_calls.append(this_mock_call)
 * 
 *             if _new_parent._mock_new_name:             # <<<<<<<<<<<<<<
 *                 if is_a_call:
 *                     dot = ''
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__new_parent, __pyx_n_s_mock_new_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1126, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {

      /* "cymock.pyx":1127
 * 
 *             if _new_parent._mock_new_name:
 *                 if is_a_call:             # <<<<<<<<<<<<<<
 *                     dot = ''
 *                 else:
 */
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_is_a_call); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1127, __pyx_L1_error)
      if (__pyx_t_8) {

        /* "cymock.pyx":1128
 *             if _new_parent._mock_new_name:
 *                 if is_a_call:
 *                     dot = ''             # <<<<<<<<<<<<<<
 *                 else:
 *                     dot = '.'
 */
        __Pyx_INCREF(__pyx_kp_u__31);
        __Pyx_XDECREF_SET(__pyx_v_dot, __pyx_kp_u__31);

        /* "cymock.pyx":1127
 * 
 *             if _new_parent._mock_new_name:
 *                 if is_a_call:             # <<<<<<<<<<<<<<
 *                     dot = ''
 *                 else:
 */
        goto __pyx_L8;
      }

      /* "cymock.pyx":1130
 *                     dot = ''
 *                 else:
 *                     dot = '.'             # <<<<<<<<<<<<<<
 *                 is_a_call = _new_parent._mock_new_name == '()'
 *                 mock_call_name = _new_parent._mock_new_name + dot + mock_call_name
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_kp_u__33);
        __Pyx_XDECREF_SET(__pyx_v_dot, __pyx_kp_u__33);
      }
      __pyx_L8:;

      /* "cymock.pyx":1131
 *                 else:
 *                     dot = '.'
 *                 is_a_call = _new_parent._mock_new_name == '()'             # <<<<<<<<<<<<<<
 *                 mock_call_name = _new_parent._mock_new_name + dot + mock_call_name
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__new_parent, __pyx_n_s_mock_new_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1131, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_kp_u__32, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_is_a_call, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cymock.pyx":1132
 *                     dot = '.'
 *                 is_a_call = _new_parent._mock_new_name == '()'
 *                 mock_call_name = _new_parent._mock_new_name + dot + mock_call_name             # <<<<<<<<<<<<<<
 * 
 *             # follow the parental chain:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__new_parent, __pyx_n_s_mock_new_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_mock_call_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_mock_call_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cymock.pyx":1126
 *             _new_parent.mock_calls.append(this_mock_call)
 * 
 *             if _new_parent._mock_new_name:             # <<<<<<<<<<<<<<
 *                 if is_a_call:
 *                     dot = ''
 */
    }

    /* "cymock.pyx":1135
 * 
 *             # follow the parental chain:
 *             _new_parent = _new_parent._mock_new_parent             # <<<<<<<<<<<<<<
 * 
 *     def _execute_mock_call(self, *args, **kwargs):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__new_parent, __pyx_n_s_mock_new_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v__new_parent, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "cymock.pyx":1091
 *         return self._execute_mock_call(*args, **kwargs)
 * 
 *     def _increment_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.called = True
 *         self.call_count += 1
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.CallableMixin._increment_mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__call);
  __Pyx_XDECREF(__pyx_v_do_method_calls);
  __Pyx_XDECREF(__pyx_v_method_call_name);
  __Pyx_XDECREF(__pyx_v_mock_call_name);
  __Pyx_XDECREF(__pyx_v_is_a_call);
  __Pyx_XDECREF(__pyx_v__new_parent);
  __Pyx_XDECREF(__pyx_v_this_mock_call);
  __Pyx_XDECREF(__pyx_v_dot);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1137
 *             _new_parent = _new_parent._mock_new_parent
 * 
 *     def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # separate from _increment_mock_call so that awaited functions are
 *         # executed separately from their call, also AsyncMock overrides this method
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_13CallableMixin_11_execute_mock_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_13CallableMixin_11_execute_mock_call = {"_execute_mock_call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_13CallableMixin_11_execute_mock_call, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_13CallableMixin_11_execute_mock_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_execute_mock_call (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "_execute_mock_call") < 0)) __PYX_ERR(0, 1137, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_execute_mock_call", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1137, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.CallableMixin._execute_mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_13CallableMixin_10_execute_mock_call(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_13CallableMixin_10_execute_mock_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_effect = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_execute_mock_call", 0);

  /* "cymock.pyx":1141
 *         # executed separately from their call, also AsyncMock overrides this method
 * 
 *         effect = self.side_effect             # <<<<<<<<<<<<<<
 *         if effect is not None:
 *             if _is_exception(effect):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_side_effect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_effect = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1142
 * 
 *         effect = self.side_effect
 *         if effect is not None:             # <<<<<<<<<<<<<<
 *             if _is_exception(effect):
 *                 raise effect
 */
  __pyx_t_2 = (__pyx_v_effect != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1143
 *         effect = self.side_effect
 *         if effect is not None:
 *             if _is_exception(effect):             # <<<<<<<<<<<<<<
 *                 raise effect
 *             elif not _callable(effect):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_effect) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_effect);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1143, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__pyx_t_3)) {

      /* "cymock.pyx":1144
 *         if effect is not None:
 *             if _is_exception(effect):
 *                 raise effect             # <<<<<<<<<<<<<<
 *             elif not _callable(effect):
 *                 result = next(effect)
 */
      __Pyx_Raise(__pyx_v_effect, 0, 0, 0);
      __PYX_ERR(0, 1144, __pyx_L1_error)

      /* "cymock.pyx":1143
 *         effect = self.side_effect
 *         if effect is not None:
 *             if _is_exception(effect):             # <<<<<<<<<<<<<<
 *                 raise effect
 *             elif not _callable(effect):
 */
    }

    /* "cymock.pyx":1145
 *             if _is_exception(effect):
 *                 raise effect
 *             elif not _callable(effect):             # <<<<<<<<<<<<<<
 *                 result = next(effect)
 *                 if _is_exception(result):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_callable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_effect) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_effect);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1145, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = ((!__pyx_t_3) != 0);
    if (__pyx_t_2) {

      /* "cymock.pyx":1146
 *                 raise effect
 *             elif not _callable(effect):
 *                 result = next(effect)             # <<<<<<<<<<<<<<
 *                 if _is_exception(result):
 *                     raise result
 */
      __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_effect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cymock.pyx":1147
 *             elif not _callable(effect):
 *                 result = next(effect)
 *                 if _is_exception(result):             # <<<<<<<<<<<<<<
 *                     raise result
 *             else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_result);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(__pyx_t_2)) {

        /* "cymock.pyx":1148
 *                 result = next(effect)
 *                 if _is_exception(result):
 *                     raise result             # <<<<<<<<<<<<<<
 *             else:
 *                 result = effect(*args, **kwargs)
 */
        __Pyx_Raise(__pyx_v_result, 0, 0, 0);
        __PYX_ERR(0, 1148, __pyx_L1_error)

        /* "cymock.pyx":1147
 *             elif not _callable(effect):
 *                 result = next(effect)
 *                 if _is_exception(result):             # <<<<<<<<<<<<<<
 *                     raise result
 *             else:
 */
      }

      /* "cymock.pyx":1145
 *             if _is_exception(effect):
 *                 raise effect
 *             elif not _callable(effect):             # <<<<<<<<<<<<<<
 *                 result = next(effect)
 *                 if _is_exception(result):
 */
      goto __pyx_L4;
    }

    /* "cymock.pyx":1150
 *                     raise result
 *             else:
 *                 result = effect(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *             if result is not DEFAULT:
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_effect, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_L4:;

    /* "cymock.pyx":1152
 *                 result = effect(*args, **kwargs)
 * 
 *             if result is not DEFAULT:             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__pyx_v_result != __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cymock.pyx":1153
 * 
 *             if result is not DEFAULT:
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if self._mock_return_value is not DEFAULT:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "cymock.pyx":1152
 *                 result = effect(*args, **kwargs)
 * 
 *             if result is not DEFAULT:             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "cymock.pyx":1142
 * 
 *         effect = self.side_effect
 *         if effect is not None:             # <<<<<<<<<<<<<<
 *             if _is_exception(effect):
 *                 raise effect
 */
  }

  /* "cymock.pyx":1155
 *                 return result
 * 
 *         if self._mock_return_value is not DEFAULT:             # <<<<<<<<<<<<<<
 *             return self.return_value
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__pyx_t_1 != __pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":1156
 * 
 *         if self._mock_return_value is not DEFAULT:
 *             return self.return_value             # <<<<<<<<<<<<<<
 * 
 *         if self._mock_wraps is not None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_return_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":1155
 *                 return result
 * 
 *         if self._mock_return_value is not DEFAULT:             # <<<<<<<<<<<<<<
 *             return self.return_value
 * 
 */
  }

  /* "cymock.pyx":1158
 *             return self.return_value
 * 
 *         if self._mock_wraps is not None:             # <<<<<<<<<<<<<<
 *             return self._mock_wraps(*args, **kwargs)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_wraps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1159
 * 
 *         if self._mock_wraps is not None:
 *             return self._mock_wraps(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *         return self.return_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_wraps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":1158
 *             return self.return_value
 * 
 *         if self._mock_wraps is not None:             # <<<<<<<<<<<<<<
 *             return self._mock_wraps(*args, **kwargs)
 * 
 */
  }

  /* "cymock.pyx":1161
 *             return self._mock_wraps(*args, **kwargs)
 * 
 *         return self.return_value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1137
 *             _new_parent = _new_parent._mock_new_parent
 * 
 *     def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # separate from _increment_mock_call so that awaited functions are
 *         # executed separately from their call, also AsyncMock overrides this method
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cymock.CallableMixin._execute_mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_effect);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1217
 * 
 * 
 * def _dot_lookup(thing, comp, import_path):             # <<<<<<<<<<<<<<
 *     try:
 *         return getattr(thing, comp)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_37_dot_lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_37_dot_lookup = {"_dot_lookup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_37_dot_lookup, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_37_dot_lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_thing = 0;
  PyObject *__pyx_v_comp = 0;
  PyObject *__pyx_v_import_path = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_dot_lookup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_thing,&__pyx_n_s_comp,&__pyx_n_s_import_path,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thing)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comp)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_dot_lookup", 1, 3, 3, 1); __PYX_ERR(0, 1217, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_import_path)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_dot_lookup", 1, 3, 3, 2); __PYX_ERR(0, 1217, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_dot_lookup") < 0)) __PYX_ERR(0, 1217, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_thing = values[0];
    __pyx_v_comp = values[1];
    __pyx_v_import_path = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_dot_lookup", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1217, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._dot_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_36_dot_lookup(__pyx_self, __pyx_v_thing, __pyx_v_comp, __pyx_v_import_path);

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

static PyObject *__pyx_pf_6cymock_36_dot_lookup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_thing, PyObject *__pyx_v_comp, PyObject *__pyx_v_import_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_dot_lookup", 0);

  /* "cymock.pyx":1218
 * 
 * def _dot_lookup(thing, comp, import_path):
 *     try:             # <<<<<<<<<<<<<<
 *         return getattr(thing, comp)
 *     except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "cymock.pyx":1219
 * def _dot_lookup(thing, comp, import_path):
 *     try:
 *         return getattr(thing, comp)             # <<<<<<<<<<<<<<
 *     except AttributeError:
 *         __import__(import_path)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetAttr(__pyx_v_thing, __pyx_v_comp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "cymock.pyx":1218
 * 
 * def _dot_lookup(thing, comp, import_path):
 *     try:             # <<<<<<<<<<<<<<
 *         return getattr(thing, comp)
 *     except AttributeError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cymock.pyx":1220
 *     try:
 *         return getattr(thing, comp)
 *     except AttributeError:             # <<<<<<<<<<<<<<
 *         __import__(import_path)
 *         return getattr(thing, comp)
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cymock._dot_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1220, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cymock.pyx":1221
 *         return getattr(thing, comp)
 *     except AttributeError:
 *         __import__(import_path)             # <<<<<<<<<<<<<<
 *         return getattr(thing, comp)
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin___import__, __pyx_v_import_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1221, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cymock.pyx":1222
 *     except AttributeError:
 *         __import__(import_path)
 *         return getattr(thing, comp)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_8 = __Pyx_GetAttr(__pyx_v_thing, __pyx_v_comp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1222, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cymock.pyx":1218
 * 
 * def _dot_lookup(thing, comp, import_path):
 *     try:             # <<<<<<<<<<<<<<
 *         return getattr(thing, comp)
 *     except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "cymock.pyx":1217
 * 
 * 
 * def _dot_lookup(thing, comp, import_path):             # <<<<<<<<<<<<<<
 *     try:
 *         return getattr(thing, comp)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock._dot_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1225
 * 
 * 
 * def _importer(target):             # <<<<<<<<<<<<<<
 *     components = target.split('.')
 *     import_path = components.pop(0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_39_importer(PyObject *__pyx_self, PyObject *__pyx_v_target); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_39_importer = {"_importer", (PyCFunction)__pyx_pw_6cymock_39_importer, METH_O, 0};
static PyObject *__pyx_pw_6cymock_39_importer(PyObject *__pyx_self, PyObject *__pyx_v_target) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_importer (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_38_importer(__pyx_self, ((PyObject *)__pyx_v_target));

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

static PyObject *__pyx_pf_6cymock_38_importer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target) {
  PyObject *__pyx_v_components = NULL;
  PyObject *__pyx_v_import_path = NULL;
  PyObject *__pyx_v_thing = NULL;
  PyObject *__pyx_v_comp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_importer", 0);

  /* "cymock.pyx":1226
 * 
 * def _importer(target):
 *     components = target.split('.')             # <<<<<<<<<<<<<<
 *     import_path = components.pop(0)
 *     thing = __import__(import_path)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_target, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u__33) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u__33);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_components = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1227
 * def _importer(target):
 *     components = target.split('.')
 *     import_path = components.pop(0)             # <<<<<<<<<<<<<<
 *     thing = __import__(import_path)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_PopIndex(__pyx_v_components, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_import_path = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1228
 *     components = target.split('.')
 *     import_path = components.pop(0)
 *     thing = __import__(import_path)             # <<<<<<<<<<<<<<
 * 
 *     for comp in components:
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin___import__, __pyx_v_import_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_thing = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1230
 *     thing = __import__(import_path)
 * 
 *     for comp in components:             # <<<<<<<<<<<<<<
 *         import_path += ".%s" % comp
 *         thing = _dot_lookup(thing, comp, import_path)
 */
  if (likely(PyList_CheckExact(__pyx_v_components)) || PyTuple_CheckExact(__pyx_v_components)) {
    __pyx_t_1 = __pyx_v_components; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_components); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1230, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1230, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1230, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_comp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cymock.pyx":1231
 * 
 *     for comp in components:
 *         import_path += ".%s" % comp             # <<<<<<<<<<<<<<
 *         thing = _dot_lookup(thing, comp, import_path)
 *     return thing
 */
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_2, __pyx_v_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_import_path, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_import_path, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":1232
 *     for comp in components:
 *         import_path += ".%s" % comp
 *         thing = _dot_lookup(thing, comp, import_path)             # <<<<<<<<<<<<<<
 *     return thing
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dot_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(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_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_thing, __pyx_v_comp, __pyx_v_import_path};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_thing, __pyx_v_comp, __pyx_v_import_path};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_thing);
      __Pyx_GIVEREF(__pyx_v_thing);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_thing);
      __Pyx_INCREF(__pyx_v_comp);
      __Pyx_GIVEREF(__pyx_v_comp);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_comp);
      __Pyx_INCREF(__pyx_v_import_path);
      __Pyx_GIVEREF(__pyx_v_import_path);
      PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_import_path);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_thing, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":1230
 *     thing = __import__(import_path)
 * 
 *     for comp in components:             # <<<<<<<<<<<<<<
 *         import_path += ".%s" % comp
 *         thing = _dot_lookup(thing, comp, import_path)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1233
 *         import_path += ".%s" % comp
 *         thing = _dot_lookup(thing, comp, import_path)
 *     return thing             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_thing);
  __pyx_r = __pyx_v_thing;
  goto __pyx_L0;

  /* "cymock.pyx":1225
 * 
 * 
 * def _importer(target):             # <<<<<<<<<<<<<<
 *     components = target.split('.')
 *     import_path = components.pop(0)
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock._importer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_components);
  __Pyx_XDECREF(__pyx_v_import_path);
  __Pyx_XDECREF(__pyx_v_thing);
  __Pyx_XDECREF(__pyx_v_comp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1236
 * 
 * 
 * def _is_started(patcher):             # <<<<<<<<<<<<<<
 *     # XXXX horrible
 *     return hasattr(patcher, 'is_local')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_41_is_started(PyObject *__pyx_self, PyObject *__pyx_v_patcher); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_41_is_started = {"_is_started", (PyCFunction)__pyx_pw_6cymock_41_is_started, METH_O, 0};
static PyObject *__pyx_pw_6cymock_41_is_started(PyObject *__pyx_self, PyObject *__pyx_v_patcher) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_started (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_40_is_started(__pyx_self, ((PyObject *)__pyx_v_patcher));

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

static PyObject *__pyx_pf_6cymock_40_is_started(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_patcher) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_is_started", 0);

  /* "cymock.pyx":1238
 * def _is_started(patcher):
 *     # XXXX horrible
 *     return hasattr(patcher, 'is_local')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_patcher, __pyx_n_u_is_local); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1238, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1236
 * 
 * 
 * def _is_started(patcher):             # <<<<<<<<<<<<<<
 *     # XXXX horrible
 *     return hasattr(patcher, 'is_local')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._is_started", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1246
 *     _active_patches = []
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, getter, attribute, new, spec, create,
 *             spec_set, autospec, new_callable, kwargs
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_6_patch_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_getter = 0;
  PyObject *__pyx_v_attribute = 0;
  PyObject *__pyx_v_new = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_create = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v_autospec = 0;
  PyObject *__pyx_v_new_callable = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_getter,&__pyx_n_s_attribute,&__pyx_n_s_new_2,&__pyx_n_s_spec,&__pyx_n_s_create,&__pyx_n_s_spec_set,&__pyx_n_s_autospec,&__pyx_n_s_new_callable,&__pyx_n_s_kwargs,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_getter)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 1); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attribute)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 2); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 3); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 4); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 5); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 6); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_autospec)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 7); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_callable)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 8); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 9); __PYX_ERR(0, 1246, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1246, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
      values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
    }
    __pyx_v_self = values[0];
    __pyx_v_getter = values[1];
    __pyx_v_attribute = values[2];
    __pyx_v_new = values[3];
    __pyx_v_spec = values[4];
    __pyx_v_create = values[5];
    __pyx_v_spec_set = values[6];
    __pyx_v_autospec = values[7];
    __pyx_v_new_callable = values[8];
    __pyx_v_kwargs = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1246, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._patch.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_6_patch___init__(__pyx_self, __pyx_v_self, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_6_patch___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_getter, PyObject *__pyx_v_attribute, PyObject *__pyx_v_new, PyObject *__pyx_v_spec, PyObject *__pyx_v_create, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_autospec, PyObject *__pyx_v_new_callable, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":1250
 *             spec_set, autospec, new_callable, kwargs
 *         ):
 *         if new_callable is not None:             # <<<<<<<<<<<<<<
 *             if new is not DEFAULT:
 *                 raise ValueError(
 */
  __pyx_t_1 = (__pyx_v_new_callable != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":1251
 *         ):
 *         if new_callable is not None:
 *             if new is not DEFAULT:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "Cannot use 'new' and 'new_callable' together"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = (__pyx_v_new != __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_1)) {

      /* "cymock.pyx":1252
 *         if new_callable is not None:
 *             if new is not DEFAULT:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "Cannot use 'new' and 'new_callable' together"
 *                 )
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1252, __pyx_L1_error)

      /* "cymock.pyx":1251
 *         ):
 *         if new_callable is not None:
 *             if new is not DEFAULT:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "Cannot use 'new' and 'new_callable' together"
 */
    }

    /* "cymock.pyx":1255
 *                     "Cannot use 'new' and 'new_callable' together"
 *                 )
 *             if autospec is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "Cannot use 'autospec' and 'new_callable' together"
 */
    __pyx_t_1 = (__pyx_v_autospec != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "cymock.pyx":1256
 *                 )
 *             if autospec is not None:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "Cannot use 'autospec' and 'new_callable' together"
 *                 )
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1256, __pyx_L1_error)

      /* "cymock.pyx":1255
 *                     "Cannot use 'new' and 'new_callable' together"
 *                 )
 *             if autospec is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "Cannot use 'autospec' and 'new_callable' together"
 */
    }

    /* "cymock.pyx":1250
 *             spec_set, autospec, new_callable, kwargs
 *         ):
 *         if new_callable is not None:             # <<<<<<<<<<<<<<
 *             if new is not DEFAULT:
 *                 raise ValueError(
 */
  }

  /* "cymock.pyx":1260
 *                 )
 * 
 *         self.getter = getter             # <<<<<<<<<<<<<<
 *         self.attribute = attribute
 *         self.new = new
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_getter, __pyx_v_getter) < 0) __PYX_ERR(0, 1260, __pyx_L1_error)

  /* "cymock.pyx":1261
 * 
 *         self.getter = getter
 *         self.attribute = attribute             # <<<<<<<<<<<<<<
 *         self.new = new
 *         self.new_callable = new_callable
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_attribute, __pyx_v_attribute) < 0) __PYX_ERR(0, 1261, __pyx_L1_error)

  /* "cymock.pyx":1262
 *         self.getter = getter
 *         self.attribute = attribute
 *         self.new = new             # <<<<<<<<<<<<<<
 *         self.new_callable = new_callable
 *         self.spec = spec
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_new_2, __pyx_v_new) < 0) __PYX_ERR(0, 1262, __pyx_L1_error)

  /* "cymock.pyx":1263
 *         self.attribute = attribute
 *         self.new = new
 *         self.new_callable = new_callable             # <<<<<<<<<<<<<<
 *         self.spec = spec
 *         self.create = create
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_new_callable, __pyx_v_new_callable) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)

  /* "cymock.pyx":1264
 *         self.new = new
 *         self.new_callable = new_callable
 *         self.spec = spec             # <<<<<<<<<<<<<<
 *         self.create = create
 *         self.has_local = False
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spec, __pyx_v_spec) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)

  /* "cymock.pyx":1265
 *         self.new_callable = new_callable
 *         self.spec = spec
 *         self.create = create             # <<<<<<<<<<<<<<
 *         self.has_local = False
 *         self.spec_set = spec_set
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_create, __pyx_v_create) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)

  /* "cymock.pyx":1266
 *         self.spec = spec
 *         self.create = create
 *         self.has_local = False             # <<<<<<<<<<<<<<
 *         self.spec_set = spec_set
 *         self.autospec = autospec
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_has_local, Py_False) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)

  /* "cymock.pyx":1267
 *         self.create = create
 *         self.has_local = False
 *         self.spec_set = spec_set             # <<<<<<<<<<<<<<
 *         self.autospec = autospec
 *         self.kwargs = kwargs
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spec_set, __pyx_v_spec_set) < 0) __PYX_ERR(0, 1267, __pyx_L1_error)

  /* "cymock.pyx":1268
 *         self.has_local = False
 *         self.spec_set = spec_set
 *         self.autospec = autospec             # <<<<<<<<<<<<<<
 *         self.kwargs = kwargs
 *         self.additional_patchers = []
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_autospec, __pyx_v_autospec) < 0) __PYX_ERR(0, 1268, __pyx_L1_error)

  /* "cymock.pyx":1269
 *         self.spec_set = spec_set
 *         self.autospec = autospec
 *         self.kwargs = kwargs             # <<<<<<<<<<<<<<
 *         self.additional_patchers = []
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_kwargs, __pyx_v_kwargs) < 0) __PYX_ERR(0, 1269, __pyx_L1_error)

  /* "cymock.pyx":1270
 *         self.autospec = autospec
 *         self.kwargs = kwargs
 *         self.additional_patchers = []             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_additional_patchers, __pyx_t_3) < 0) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1246
 *     _active_patches = []
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, getter, attribute, new, spec, create,
 *             spec_set, autospec, new_callable, kwargs
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._patch.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1273
 * 
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         patcher = _patch(
 *             self.getter, self.attribute, self.new, self.spec,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_3copy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_3copy = {"copy", (PyCFunction)__pyx_pw_6cymock_6_patch_3copy, METH_O, 0};
static PyObject *__pyx_pw_6cymock_6_patch_3copy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_6_patch_2copy(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_6_patch_2copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_patcher = NULL;
  PyObject *__pyx_9genexpr10__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  __Pyx_RefNannySetupContext("copy", 0);

  /* "cymock.pyx":1274
 * 
 *     def copy(self):
 *         patcher = _patch(             # <<<<<<<<<<<<<<
 *             self.getter, self.attribute, self.new, self.spec,
 *             self.create, self.spec_set,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_patch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cymock.pyx":1275
 *     def copy(self):
 *         patcher = _patch(
 *             self.getter, self.attribute, self.new, self.spec,             # <<<<<<<<<<<<<<
 *             self.create, self.spec_set,
 *             self.autospec, self.new_callable, self.kwargs
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_new_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "cymock.pyx":1276
 *         patcher = _patch(
 *             self.getter, self.attribute, self.new, self.spec,
 *             self.create, self.spec_set,             # <<<<<<<<<<<<<<
 *             self.autospec, self.new_callable, self.kwargs
 *         )
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_create); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_set); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "cymock.pyx":1277
 *             self.getter, self.attribute, self.new, self.spec,
 *             self.create, self.spec_set,
 *             self.autospec, self.new_callable, self.kwargs             # <<<<<<<<<<<<<<
 *         )
 *         patcher.attribute_name = self.attribute_name
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_autospec); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_new_callable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kwargs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = NULL;
  __pyx_t_13 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_13 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[10] = {__pyx_t_12, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 9+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[10] = {__pyx_t_12, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 9+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else
  #endif
  {
    __pyx_t_14 = PyTuple_New(9+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    if (__pyx_t_12) {
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_13, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_13, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_13, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_14, 5+__pyx_t_13, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_14, 6+__pyx_t_13, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_14, 7+__pyx_t_13, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_14, 8+__pyx_t_13, __pyx_t_11);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_t_10 = 0;
    __pyx_t_11 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_patcher = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1279
 *             self.autospec, self.new_callable, self.kwargs
 *         )
 *         patcher.attribute_name = self.attribute_name             # <<<<<<<<<<<<<<
 *         patcher.additional_patchers = [
 *             p.copy() for p in self.additional_patchers
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_patcher, __pyx_n_s_attribute_name, __pyx_t_1) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1280
 *         )
 *         patcher.attribute_name = self.attribute_name
 *         patcher.additional_patchers = [             # <<<<<<<<<<<<<<
 *             p.copy() for p in self.additional_patchers
 *         ]
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cymock.pyx":1281
 *         patcher.attribute_name = self.attribute_name
 *         patcher.additional_patchers = [
 *             p.copy() for p in self.additional_patchers             # <<<<<<<<<<<<<<
 *         ]
 *         return patcher
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_additional_patchers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_14 = __pyx_t_2; __Pyx_INCREF(__pyx_t_14); __pyx_t_15 = 0;
      __pyx_t_16 = NULL;
    } else {
      __pyx_t_15 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1281, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1281, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_16)) {
        if (likely(PyList_CheckExact(__pyx_t_14))) {
          if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_14)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1281, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_15); __Pyx_INCREF(__pyx_t_2); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1281, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_14, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_16(__pyx_t_14);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1281, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_p, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr10__pyx_v_p, __pyx_n_s_copy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1281, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1280, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_p); __pyx_9genexpr10__pyx_v_p = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_p); __pyx_9genexpr10__pyx_v_p = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */

  /* "cymock.pyx":1280
 *         )
 *         patcher.attribute_name = self.attribute_name
 *         patcher.additional_patchers = [             # <<<<<<<<<<<<<<
 *             p.copy() for p in self.additional_patchers
 *         ]
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_patcher, __pyx_n_s_additional_patchers, __pyx_t_1) < 0) __PYX_ERR(0, 1280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1283
 *             p.copy() for p in self.additional_patchers
 *         ]
 *         return patcher             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_patcher);
  __pyx_r = __pyx_v_patcher;
  goto __pyx_L0;

  /* "cymock.pyx":1273
 * 
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         patcher = _patch(
 *             self.getter, self.attribute, self.new, self.spec,
 */

  /* 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cymock._patch.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_patcher);
  __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1286
 * 
 * 
 *     def __call__(self, func):             # <<<<<<<<<<<<<<
 *         if isinstance(func, type):
 *             return self.decorate_class(func)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_5__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_5__call__ = {"__call__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_5__call__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_6_patch_5__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 1286, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1286, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1286, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._patch.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_6_patch_4__call__(__pyx_self, __pyx_v_self, __pyx_v_func);

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

static PyObject *__pyx_pf_6cymock_6_patch_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "cymock.pyx":1287
 * 
 *     def __call__(self, func):
 *         if isinstance(func, type):             # <<<<<<<<<<<<<<
 *             return self.decorate_class(func)
 *         if inspect.iscoroutinefunction(func):
 */
  __pyx_t_1 = PyType_Check(__pyx_v_func); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":1288
 *     def __call__(self, func):
 *         if isinstance(func, type):
 *             return self.decorate_class(func)             # <<<<<<<<<<<<<<
 *         if inspect.iscoroutinefunction(func):
 *             return self.decorate_async_callable(func)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decorate_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_func);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":1287
 * 
 *     def __call__(self, func):
 *         if isinstance(func, type):             # <<<<<<<<<<<<<<
 *             return self.decorate_class(func)
 *         if inspect.iscoroutinefunction(func):
 */
  }

  /* "cymock.pyx":1289
 *         if isinstance(func, type):
 *             return self.decorate_class(func)
 *         if inspect.iscoroutinefunction(func):             # <<<<<<<<<<<<<<
 *             return self.decorate_async_callable(func)
 *         return self.decorate_callable(func)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_inspect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_func);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "cymock.pyx":1290
 *             return self.decorate_class(func)
 *         if inspect.iscoroutinefunction(func):
 *             return self.decorate_async_callable(func)             # <<<<<<<<<<<<<<
 *         return self.decorate_callable(func)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decorate_async_callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_func);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":1289
 *         if isinstance(func, type):
 *             return self.decorate_class(func)
 *         if inspect.iscoroutinefunction(func):             # <<<<<<<<<<<<<<
 *             return self.decorate_async_callable(func)
 *         return self.decorate_callable(func)
 */
  }

  /* "cymock.pyx":1291
 *         if inspect.iscoroutinefunction(func):
 *             return self.decorate_async_callable(func)
 *         return self.decorate_callable(func)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_decorate_callable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_func);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1286
 * 
 * 
 *     def __call__(self, func):             # <<<<<<<<<<<<<<
 *         if isinstance(func, type):
 *             return self.decorate_class(func)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cymock._patch.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1294
 * 
 * 
 *     def decorate_class(self, klass):             # <<<<<<<<<<<<<<
 *         for attr in dir(klass):
 *             if not attr.startswith(patch.TEST_PREFIX):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_7decorate_class(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_7decorate_class = {"decorate_class", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_7decorate_class, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_6_patch_7decorate_class(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_klass = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorate_class (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_klass,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_klass)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("decorate_class", 1, 2, 2, 1); __PYX_ERR(0, 1294, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decorate_class") < 0)) __PYX_ERR(0, 1294, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_klass = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decorate_class", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1294, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._patch.decorate_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_6_patch_6decorate_class(__pyx_self, __pyx_v_self, __pyx_v_klass);

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

static PyObject *__pyx_pf_6cymock_6_patch_6decorate_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_klass) {
  PyObject *__pyx_v_attr = NULL;
  PyObject *__pyx_v_attr_value = NULL;
  PyObject *__pyx_v_patcher = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("decorate_class", 0);

  /* "cymock.pyx":1295
 * 
 *     def decorate_class(self, klass):
 *         for attr in dir(klass):             # <<<<<<<<<<<<<<
 *             if not attr.startswith(patch.TEST_PREFIX):
 *                 continue
 */
  __pyx_t_1 = PyObject_Dir(__pyx_v_klass); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1295, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1295, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":1296
 *     def decorate_class(self, klass):
 *         for attr in dir(klass):
 *             if not attr.startswith(patch.TEST_PREFIX):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_attr, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_patch_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_TEST_PREFIX); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1296, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = ((!__pyx_t_8) != 0);
    if (__pyx_t_9) {

      /* "cymock.pyx":1297
 *         for attr in dir(klass):
 *             if not attr.startswith(patch.TEST_PREFIX):
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             attr_value = getattr(klass, attr)
 */
      goto __pyx_L3_continue;

      /* "cymock.pyx":1296
 *     def decorate_class(self, klass):
 *         for attr in dir(klass):
 *             if not attr.startswith(patch.TEST_PREFIX):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "cymock.pyx":1299
 *                 continue
 * 
 *             attr_value = getattr(klass, attr)             # <<<<<<<<<<<<<<
 *             if not hasattr(attr_value, "__call__"):
 *                 continue
 */
    __pyx_t_1 = __Pyx_GetAttr(__pyx_v_klass, __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_attr_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":1300
 * 
 *             attr_value = getattr(klass, attr)
 *             if not hasattr(attr_value, "__call__"):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_9 = __Pyx_HasAttr(__pyx_v_attr_value, __pyx_n_u_call); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1300, __pyx_L1_error)
    __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0);
    if (__pyx_t_8) {

      /* "cymock.pyx":1301
 *             attr_value = getattr(klass, attr)
 *             if not hasattr(attr_value, "__call__"):
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             patcher = self.copy()
 */
      goto __pyx_L3_continue;

      /* "cymock.pyx":1300
 * 
 *             attr_value = getattr(klass, attr)
 *             if not hasattr(attr_value, "__call__"):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    }

    /* "cymock.pyx":1303
 *                 continue
 * 
 *             patcher = self.copy()             # <<<<<<<<<<<<<<
 *             setattr(klass, attr, patcher(attr_value))
 *         return klass
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_patcher, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":1304
 * 
 *             patcher = self.copy()
 *             setattr(klass, attr, patcher(attr_value))             # <<<<<<<<<<<<<<
 *         return klass
 * 
 */
    __Pyx_INCREF(__pyx_v_patcher);
    __pyx_t_5 = __pyx_v_patcher; __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_v_attr_value) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_attr_value);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = PyObject_SetAttr(__pyx_v_klass, __pyx_v_attr, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":1295
 * 
 *     def decorate_class(self, klass):
 *         for attr in dir(klass):             # <<<<<<<<<<<<<<
 *             if not attr.startswith(patch.TEST_PREFIX):
 *                 continue
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1305
 *             patcher = self.copy()
 *             setattr(klass, attr, patcher(attr_value))
 *         return klass             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_klass);
  __pyx_r = __pyx_v_klass;
  goto __pyx_L0;

  /* "cymock.pyx":1294
 * 
 * 
 *     def decorate_class(self, klass):             # <<<<<<<<<<<<<<
 *         for attr in dir(klass):
 *             if not attr.startswith(patch.TEST_PREFIX):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._patch.decorate_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attr);
  __Pyx_XDECREF(__pyx_v_attr_value);
  __Pyx_XDECREF(__pyx_v_patcher);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_6_patch_10generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":1309
 * 
 *     @contextlib.contextmanager
 *     def decoration_helper(self, patched, args, keywargs):             # <<<<<<<<<<<<<<
 *         extra_args = []
 *         entered_patchers = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_9decoration_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_9decoration_helper = {"decoration_helper", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_9decoration_helper, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_6_patch_9decoration_helper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_patched = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_keywargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decoration_helper (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_patched,&__pyx_n_s_args,&__pyx_n_s_keywargs,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_patched)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("decoration_helper", 1, 4, 4, 1); __PYX_ERR(0, 1309, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("decoration_helper", 1, 4, 4, 2); __PYX_ERR(0, 1309, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keywargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("decoration_helper", 1, 4, 4, 3); __PYX_ERR(0, 1309, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decoration_helper") < 0)) __PYX_ERR(0, 1309, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_patched = values[1];
    __pyx_v_args = values[2];
    __pyx_v_keywargs = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decoration_helper", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1309, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._patch.decoration_helper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_6_patch_8decoration_helper(__pyx_self, __pyx_v_self, __pyx_v_patched, __pyx_v_args, __pyx_v_keywargs);

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

static PyObject *__pyx_pf_6cymock_6_patch_8decoration_helper(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_patched, PyObject *__pyx_v_args, PyObject *__pyx_v_keywargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decoration_helper", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *)__pyx_tp_new_6cymock___pyx_scope_struct_9_decoration_helper(__pyx_ptype_6cymock___pyx_scope_struct_9_decoration_helper, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1309, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_patched = __pyx_v_patched;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_patched);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_patched);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_keywargs = __pyx_v_keywargs;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keywargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keywargs);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_6_patch_10generator, __pyx_codeobj__47, (PyObject *) __pyx_cur_scope, __pyx_n_s_decoration_helper, __pyx_n_s_patch_decoration_helper, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 1309, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock._patch.decoration_helper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_6_patch_10generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decoration_helper", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L16_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1309, __pyx_L1_error)

  /* "cymock.pyx":1310
 *     @contextlib.contextmanager
 *     def decoration_helper(self, patched, args, keywargs):
 *         extra_args = []             # <<<<<<<<<<<<<<
 *         entered_patchers = []
 *         patching = None
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_extra_args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":1311
 *     def decoration_helper(self, patched, args, keywargs):
 *         extra_args = []
 *         entered_patchers = []             # <<<<<<<<<<<<<<
 *         patching = None
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_entered_patchers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":1312
 *         extra_args = []
 *         entered_patchers = []
 *         patching = None             # <<<<<<<<<<<<<<
 * 
 *         exc_info = tuple()
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_patching = Py_None;

  /* "cymock.pyx":1314
 *         patching = None
 * 
 *         exc_info = tuple()             # <<<<<<<<<<<<<<
 *         try:
 *             for patching in patched.patchings:
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_exc_info = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1315
 * 
 *         exc_info = tuple()
 *         try:             # <<<<<<<<<<<<<<
 *             for patching in patched.patchings:
 *                 arg = patching.__enter__()
 */
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "cymock.pyx":1316
 *         exc_info = tuple()
 *         try:
 *             for patching in patched.patchings:             # <<<<<<<<<<<<<<
 *                 arg = patching.__enter__()
 *                 entered_patchers.append(patching)
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_patched, __pyx_n_s_patchings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
          __pyx_t_7 = NULL;
        } else {
          __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1316, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1316, __pyx_L7_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_7)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1316, __pyx_L7_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            } else {
              if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1316, __pyx_L7_error)
              #else
              __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              #endif
            }
          } else {
            __pyx_t_1 = __pyx_t_7(__pyx_t_5);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 1316, __pyx_L7_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_patching);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_patching, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;

          /* "cymock.pyx":1317
 *         try:
 *             for patching in patched.patchings:
 *                 arg = patching.__enter__()             # <<<<<<<<<<<<<<
 *                 entered_patchers.append(patching)
 *                 if patching.attribute_name is not None:
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_patching, __pyx_n_s_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1317, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_9)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
            }
          }
          __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_arg);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_arg, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;

          /* "cymock.pyx":1318
 *             for patching in patched.patchings:
 *                 arg = patching.__enter__()
 *                 entered_patchers.append(patching)             # <<<<<<<<<<<<<<
 *                 if patching.attribute_name is not None:
 *                     keywargs.update(arg)
 */
          __pyx_t_10 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_entered_patchers, __pyx_cur_scope->__pyx_v_patching); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1318, __pyx_L7_error)

          /* "cymock.pyx":1319
 *                 arg = patching.__enter__()
 *                 entered_patchers.append(patching)
 *                 if patching.attribute_name is not None:             # <<<<<<<<<<<<<<
 *                     keywargs.update(arg)
 *                 elif patching.new is DEFAULT:
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_patching, __pyx_n_s_attribute_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = (__pyx_t_1 != Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_12 = (__pyx_t_11 != 0);
          if (__pyx_t_12) {

            /* "cymock.pyx":1320
 *                 entered_patchers.append(patching)
 *                 if patching.attribute_name is not None:
 *                     keywargs.update(arg)             # <<<<<<<<<<<<<<
 *                 elif patching.new is DEFAULT:
 *                     extra_args.append(arg)
 */
            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_keywargs, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1320, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_9 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
              if (likely(__pyx_t_9)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
                __Pyx_INCREF(__pyx_t_9);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_8, function);
              }
            }
            __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_cur_scope->__pyx_v_arg) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_cur_scope->__pyx_v_arg);
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "cymock.pyx":1319
 *                 arg = patching.__enter__()
 *                 entered_patchers.append(patching)
 *                 if patching.attribute_name is not None:             # <<<<<<<<<<<<<<
 *                     keywargs.update(arg)
 *                 elif patching.new is DEFAULT:
 */
            goto __pyx_L15;
          }

          /* "cymock.pyx":1321
 *                 if patching.attribute_name is not None:
 *                     keywargs.update(arg)
 *                 elif patching.new is DEFAULT:             # <<<<<<<<<<<<<<
 *                     extra_args.append(arg)
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_patching, __pyx_n_s_new_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1321, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_12 = (__pyx_t_1 == __pyx_t_8);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_11 = (__pyx_t_12 != 0);
          if (__pyx_t_11) {

            /* "cymock.pyx":1322
 *                     keywargs.update(arg)
 *                 elif patching.new is DEFAULT:
 *                     extra_args.append(arg)             # <<<<<<<<<<<<<<
 * 
 *             args += tuple(extra_args)
 */
            __pyx_t_10 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_extra_args, __pyx_cur_scope->__pyx_v_arg); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1322, __pyx_L7_error)

            /* "cymock.pyx":1321
 *                 if patching.attribute_name is not None:
 *                     keywargs.update(arg)
 *                 elif patching.new is DEFAULT:             # <<<<<<<<<<<<<<
 *                     extra_args.append(arg)
 * 
 */
          }
          __pyx_L15:;

          /* "cymock.pyx":1316
 *         exc_info = tuple()
 *         try:
 *             for patching in patched.patchings:             # <<<<<<<<<<<<<<
 *                 arg = patching.__enter__()
 *                 entered_patchers.append(patching)
 */
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "cymock.pyx":1324
 *                     extra_args.append(arg)
 * 
 *             args += tuple(extra_args)             # <<<<<<<<<<<<<<
 *             yield (args, keywargs)
 *         except:
 */
        __pyx_t_5 = PyList_AsTuple(__pyx_cur_scope->__pyx_v_extra_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1324, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_args, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1324, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_args);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_args, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_t_8 = 0;

        /* "cymock.pyx":1325
 * 
 *             args += tuple(extra_args)
 *             yield (args, keywargs)             # <<<<<<<<<<<<<<
 *         except:
 *             if (patching not in entered_patchers and
 */
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1325, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_args);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keywargs);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keywargs);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_cur_scope->__pyx_v_keywargs);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        __Pyx_XGIVEREF(__pyx_t_2);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
        __Pyx_XGIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
        __Pyx_XGIVEREF(__pyx_t_4);
        __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L16_resume_from_yield:;
        __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
        __pyx_cur_scope->__pyx_t_1 = 0;
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
        __pyx_cur_scope->__pyx_t_2 = 0;
        __Pyx_XGOTREF(__pyx_t_4);
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1325, __pyx_L7_error)

        /* "cymock.pyx":1315
 * 
 *         exc_info = tuple()
 *         try:             # <<<<<<<<<<<<<<
 *             for patching in patched.patchings:
 *                 arg = patching.__enter__()
 */
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L12_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "cymock.pyx":1326
 *             args += tuple(extra_args)
 *             yield (args, keywargs)
 *         except:             # <<<<<<<<<<<<<<
 *             if (patching not in entered_patchers and
 *                 _is_started(patching)):
 */
      /*except:*/ {
        __Pyx_AddTraceback("cymock._patch.decoration_helper", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 1326, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_1);

        /* "cymock.pyx":1327
 *             yield (args, keywargs)
 *         except:
 *             if (patching not in entered_patchers and             # <<<<<<<<<<<<<<
 *                 _is_started(patching)):
 *                 # the patcher may have been started, but an exception
 */
        __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_patching, __pyx_cur_scope->__pyx_v_entered_patchers, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1327, __pyx_L9_except_error)
        __pyx_t_13 = (__pyx_t_12 != 0);
        if (__pyx_t_13) {
        } else {
          __pyx_t_11 = __pyx_t_13;
          goto __pyx_L20_bool_binop_done;
        }

        /* "cymock.pyx":1328
 *         except:
 *             if (patching not in entered_patchers and
 *                 _is_started(patching)):             # <<<<<<<<<<<<<<
 *                 # the patcher may have been started, but an exception
 *                 # raised whilst entering one of its additional_patchers
 */
        __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_is_started); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1328, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
          }
        }
        __pyx_t_9 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, __pyx_cur_scope->__pyx_v_patching) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_cur_scope->__pyx_v_patching);
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1328, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1328, __pyx_L9_except_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_11 = __pyx_t_13;
        __pyx_L20_bool_binop_done:;

        /* "cymock.pyx":1327
 *             yield (args, keywargs)
 *         except:
 *             if (patching not in entered_patchers and             # <<<<<<<<<<<<<<
 *                 _is_started(patching)):
 *                 # the patcher may have been started, but an exception
 */
        if (__pyx_t_11) {

          /* "cymock.pyx":1331
 *                 # the patcher may have been started, but an exception
 *                 # raised whilst entering one of its additional_patchers
 *                 entered_patchers.append(patching)             # <<<<<<<<<<<<<<
 *             # Pass the exception to __exit__
 *             exc_info = sys.exc_info()
 */
          __pyx_t_10 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_entered_patchers, __pyx_cur_scope->__pyx_v_patching); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1331, __pyx_L9_except_error)

          /* "cymock.pyx":1327
 *             yield (args, keywargs)
 *         except:
 *             if (patching not in entered_patchers and             # <<<<<<<<<<<<<<
 *                 _is_started(patching)):
 *                 # the patcher may have been started, but an exception
 */
        }

        /* "cymock.pyx":1333
 *                 entered_patchers.append(patching)
 *             # Pass the exception to __exit__
 *             exc_info = sys.exc_info()             # <<<<<<<<<<<<<<
 *             # re-raise the exception
 *             raise
 */
        __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1333, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1333, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_15, function);
          }
        }
        __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_15);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1333, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc_info);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc_info, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;

        /* "cymock.pyx":1335
 *             exc_info = sys.exc_info()
 *             # re-raise the exception
 *             raise             # <<<<<<<<<<<<<<
 *         finally:
 *             for patching in reversed(entered_patchers):
 */
        __Pyx_GIVEREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_5, __pyx_t_1);
        __pyx_t_8 = 0; __pyx_t_5 = 0; __pyx_t_1 = 0; 
        __PYX_ERR(0, 1335, __pyx_L9_except_error)
      }
      __pyx_L9_except_error:;

      /* "cymock.pyx":1315
 * 
 *         exc_info = tuple()
 *         try:             # <<<<<<<<<<<<<<
 *             for patching in patched.patchings:
 *                 arg = patching.__enter__()
 */
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L5_error;
      __pyx_L12_try_end:;
    }
  }

  /* "cymock.pyx":1337
 *             raise
 *         finally:
 *             for patching in reversed(entered_patchers):             # <<<<<<<<<<<<<<
 *                 patching.__exit__(*exc_info)
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_entered_patchers; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = PyList_GET_SIZE(__pyx_t_1) - 1;
      for (;;) {
        if (__pyx_t_6 < 0) break;
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6--; if (unlikely(0 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6--; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_patching);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_patching, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;

        /* "cymock.pyx":1338
 *         finally:
 *             for patching in reversed(entered_patchers):
 *                 patching.__exit__(*exc_info)             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_patching, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1338, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_exc_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1338, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1338, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "cymock.pyx":1337
 *             raise
 *         finally:
 *             for patching in reversed(entered_patchers):             # <<<<<<<<<<<<<<
 *                 patching.__exit__(*exc_info)
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L6;
    }
    __pyx_L5_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_21);
      __pyx_t_16 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
      {
        __pyx_t_1 = __pyx_cur_scope->__pyx_v_entered_patchers; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = PyList_GET_SIZE(__pyx_t_1) - 1;
        for (;;) {
          if (__pyx_t_6 < 0) break;
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6--; if (unlikely(0 < 0)) __PYX_ERR(0, 1337, __pyx_L25_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6--; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L25_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_patching);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_patching, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;

          /* "cymock.pyx":1338
 *         finally:
 *             for patching in reversed(entered_patchers):
 *                 patching.__exit__(*exc_info)             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_patching, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1338, __pyx_L25_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_exc_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1338, __pyx_L25_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1338, __pyx_L25_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "cymock.pyx":1337
 *             raise
 *         finally:
 *             for patching in reversed(entered_patchers):             # <<<<<<<<<<<<<<
 *                 patching.__exit__(*exc_info)
 * 
 */
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
      }
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
      __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
      goto __pyx_L1_error;
      __pyx_L25_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L6:;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "cymock.pyx":1309
 * 
 *     @contextlib.contextmanager
 *     def decoration_helper(self, patched, args, keywargs):             # <<<<<<<<<<<<<<
 *         extra_args = []
 *         entered_patchers = []
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("decoration_helper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1341
 * 
 * 
 *     def decorate_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_12decorate_callable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_12decorate_callable = {"decorate_callable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_12decorate_callable, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_6_patch_12decorate_callable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorate_callable (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("decorate_callable", 1, 2, 2, 1); __PYX_ERR(0, 1341, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decorate_callable") < 0)) __PYX_ERR(0, 1341, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decorate_callable", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1341, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._patch.decorate_callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_6_patch_11decorate_callable(__pyx_self, __pyx_v_self, __pyx_v_func);

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

/* "cymock.pyx":1348
 * 
 *         @wraps(func)
 *         def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_17decorate_callable_1patched(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_17decorate_callable_1patched = {"patched", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_17decorate_callable_1patched, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_6_patch_17decorate_callable_1patched(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_keywargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("patched (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "patched", 1))) return NULL;
  __pyx_v_keywargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_keywargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_keywargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_6_patch_17decorate_callable_patched(__pyx_self, __pyx_v_args, __pyx_v_keywargs);

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

static PyObject *__pyx_pf_6cymock_6_patch_17decorate_callable_patched(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_keywargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *__pyx_outer_scope;
  PyObject *__pyx_v_newargs = NULL;
  PyObject *__pyx_v_newkeywargs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("patched", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":1349
 *         @wraps(func)
 *         def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,             # <<<<<<<<<<<<<<
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 */
  /*with:*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1349, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_decoration_helper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_v_patched)) { __Pyx_RaiseClosureNameError("patched"); __PYX_ERR(0, 1349, __pyx_L1_error) }

    /* "cymock.pyx":1351
 *             with self.decoration_helper(patched,
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):             # <<<<<<<<<<<<<<
 *                 return func(*newargs, **newkeywargs)
 * 
 */
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && 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;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_patched, __pyx_v_args, __pyx_v_keywargs};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1349, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_patched, __pyx_v_args, __pyx_v_keywargs};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1349, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_patched);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_patched);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_patched);
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_args);
      __Pyx_INCREF(__pyx_v_keywargs);
      __Pyx_GIVEREF(__pyx_v_keywargs);
      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_keywargs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "cymock.pyx":1349
 *         @wraps(func)
 *         def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,             # <<<<<<<<<<<<<<
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 */
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1349, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
            PyObject* sequence = __pyx_t_5;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 1351, __pyx_L7_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_2);
            #else
            __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1351, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext;
            index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L13_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_1);
            index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1351, __pyx_L7_error)
            __pyx_t_10 = NULL;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L14_unpacking_done;
            __pyx_L13_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_10 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 1351, __pyx_L7_error)
            __pyx_L14_unpacking_done:;
          }

          /* "cymock.pyx":1351
 *             with self.decoration_helper(patched,
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):             # <<<<<<<<<<<<<<
 *                 return func(*newargs, **newkeywargs)
 * 
 */
          __pyx_v_newargs = __pyx_t_1;
          __pyx_t_1 = 0;
          __pyx_v_newkeywargs = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "cymock.pyx":1352
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 *                 return func(*newargs, **newkeywargs)             # <<<<<<<<<<<<<<
 * 
 *         patched.patchings = [self]
 */
          __Pyx_XDECREF(__pyx_r);
          if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(0, 1352, __pyx_L7_error) }
          __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_newargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (unlikely(__pyx_v_newkeywargs == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
            __PYX_ERR(0, 1352, __pyx_L7_error)
          }
          if (likely(PyDict_CheckExact(__pyx_v_newkeywargs))) {
            __pyx_t_2 = PyDict_Copy(__pyx_v_newkeywargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1352, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          } else {
            __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_newkeywargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1352, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_r = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L11_try_return;

          /* "cymock.pyx":1349
 *         @wraps(func)
 *         def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,             # <<<<<<<<<<<<<<
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 */
        }
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("cymock._patch.decorate_callable.patched", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 1349, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1349, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1349, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 1349, __pyx_L9_except_error)
          __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_5);
            __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; 
            __PYX_ERR(0, 1349, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__48, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1349, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_9 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_6) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__48, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1349, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __pyx_r = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L18;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L18:;
  }

  /* "cymock.pyx":1348
 * 
 *         @wraps(func)
 *         def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */

  /* 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_5);
  __Pyx_AddTraceback("cymock._patch.decorate_callable.patched", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_newargs);
  __Pyx_XDECREF(__pyx_v_newkeywargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1341
 * 
 * 
 *     def decorate_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):
 */

static PyObject *__pyx_pf_6cymock_6_patch_11decorate_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func) {
  struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("decorate_callable", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *)__pyx_tp_new_6cymock___pyx_scope_struct_10_decorate_callable(__pyx_ptype_6cymock___pyx_scope_struct_10_decorate_callable, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1341, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);

  /* "cymock.pyx":1343
 *     def decorate_callable(self, func):
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):             # <<<<<<<<<<<<<<
 *             func.patchings.append(self)
 *             return func
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_func;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_patchings); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1344
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):
 *             func.patchings.append(self)             # <<<<<<<<<<<<<<
 *             return func
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_patchings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_cur_scope->__pyx_v_self); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1344, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":1345
 *         if hasattr(func, 'patchings'):
 *             func.patchings.append(self)
 *             return func             # <<<<<<<<<<<<<<
 * 
 *         @wraps(func)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
    __pyx_r = __pyx_cur_scope->__pyx_v_func;
    goto __pyx_L0;

    /* "cymock.pyx":1343
 *     def decorate_callable(self, func):
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):             # <<<<<<<<<<<<<<
 *             func.patchings.append(self)
 *             return func
 */
  }

  /* "cymock.pyx":1347
 *             return func
 * 
 *         @wraps(func)             # <<<<<<<<<<<<<<
 *         def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_wraps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_cur_scope->__pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_func);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":1348
 * 
 *         @wraps(func)
 *         def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_17decorate_callable_1patched, 0, __pyx_n_s_patch_decorate_callable_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_patched = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1354
 *                 return func(*newargs, **newkeywargs)
 * 
 *         patched.patchings = [self]             # <<<<<<<<<<<<<<
 *         return patched
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_self);
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_patched, __pyx_n_s_patchings, __pyx_t_1) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1355
 * 
 *         patched.patchings = [self]
 *         return patched             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_patched);
  __pyx_r = __pyx_cur_scope->__pyx_v_patched;
  goto __pyx_L0;

  /* "cymock.pyx":1341
 * 
 * 
 *     def decorate_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._patch.decorate_callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1358
 * 
 * 
 *     def decorate_async_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_14decorate_async_callable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_14decorate_async_callable = {"decorate_async_callable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_14decorate_async_callable, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_6_patch_14decorate_async_callable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorate_async_callable (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("decorate_async_callable", 1, 2, 2, 1); __PYX_ERR(0, 1358, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decorate_async_callable") < 0)) __PYX_ERR(0, 1358, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decorate_async_callable", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1358, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._patch.decorate_async_callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_6_patch_13decorate_async_callable(__pyx_self, __pyx_v_self, __pyx_v_func);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_6_patch_23decorate_async_callable_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":1365
 * 
 *         @wraps(func)
 *         async def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_23decorate_async_callable_1patched(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_23decorate_async_callable_1patched = {"patched", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_23decorate_async_callable_1patched, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_6_patch_23decorate_async_callable_1patched(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_keywargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("patched (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "patched", 1))) return NULL;
  __pyx_v_keywargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_keywargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_keywargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_6_patch_23decorate_async_callable_patched(__pyx_self, __pyx_v_args, __pyx_v_keywargs);

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

static PyObject *__pyx_pf_6cymock_6_patch_23decorate_async_callable_patched(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_keywargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("patched", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *)__pyx_tp_new_6cymock___pyx_scope_struct_12_patched(__pyx_ptype_6cymock___pyx_scope_struct_12_patched, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1365, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_keywargs = __pyx_v_keywargs;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keywargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keywargs);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_6_patch_23decorate_async_callable_2generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_patched, __pyx_n_s_patch_decorate_async_callable_l, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 1365, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock._patch.decorate_async_callable.patched", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_6_patch_23decorate_async_callable_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("patched", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L16_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1365, __pyx_L1_error)

  /* "cymock.pyx":1366
 *         @wraps(func)
 *         async def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,             # <<<<<<<<<<<<<<
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 */
  /*with:*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1366, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_decoration_helper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_patched)) { __Pyx_RaiseClosureNameError("patched"); __PYX_ERR(0, 1366, __pyx_L1_error) }

    /* "cymock.pyx":1368
 *             with self.decoration_helper(patched,
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):             # <<<<<<<<<<<<<<
 *                 return await func(*newargs, **newkeywargs)
 * 
 */
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && 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;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_patched, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_keywargs};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_patched, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_keywargs};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_patched);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_patched);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_patched);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_args);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keywargs);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keywargs);
      PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_cur_scope->__pyx_v_keywargs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "cymock.pyx":1366
 *         @wraps(func)
 *         async def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,             # <<<<<<<<<<<<<<
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 */
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
            PyObject* sequence = __pyx_t_5;
            Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 1368, __pyx_L8_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_2);
            #else
            __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1368, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext;
            index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L14_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_1);
            index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L14_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1368, __pyx_L8_error)
            __pyx_t_10 = NULL;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L15_unpacking_done;
            __pyx_L14_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_10 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 1368, __pyx_L8_error)
            __pyx_L15_unpacking_done:;
          }

          /* "cymock.pyx":1368
 *             with self.decoration_helper(patched,
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):             # <<<<<<<<<<<<<<
 *                 return await func(*newargs, **newkeywargs)
 * 
 */
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_cur_scope->__pyx_v_newargs = __pyx_t_1;
          __pyx_t_1 = 0;
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_cur_scope->__pyx_v_newkeywargs = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "cymock.pyx":1369
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 *                 return await func(*newargs, **newkeywargs)             # <<<<<<<<<<<<<<
 * 
 *         patched.patchings = [self]
 */
          __Pyx_XDECREF(__pyx_r);
          if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(0, 1369, __pyx_L8_error) }
          __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_newargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (unlikely(__pyx_cur_scope->__pyx_v_newkeywargs == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
            __PYX_ERR(0, 1369, __pyx_L8_error)
          }
          if (likely(PyDict_CheckExact(__pyx_cur_scope->__pyx_v_newkeywargs))) {
            __pyx_t_2 = PyDict_Copy(__pyx_cur_scope->__pyx_v_newkeywargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
          } else {
            __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_cur_scope->__pyx_v_newkeywargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
          }
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_func, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_r);
          if (likely(__pyx_r)) {
            __Pyx_XGIVEREF(__pyx_t_6);
            __pyx_cur_scope->__pyx_t_0 = __pyx_t_6;
            __Pyx_XGIVEREF(__pyx_t_7);
            __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
            __Pyx_XGIVEREF(__pyx_t_8);
            __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
            __Pyx_XGIVEREF(__pyx_t_9);
            __pyx_cur_scope->__pyx_t_3 = __pyx_t_9;
            __Pyx_XGIVEREF(__pyx_r);
            __Pyx_RefNannyFinishContext();
            __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
            /* return from generator, awaiting value */
            __pyx_generator->resume_label = 1;
            return __pyx_r;
            __pyx_L16_resume_from_await:;
            __pyx_t_6 = __pyx_cur_scope->__pyx_t_0;
            __pyx_cur_scope->__pyx_t_0 = 0;
            __Pyx_XGOTREF(__pyx_t_6);
            __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
            __pyx_cur_scope->__pyx_t_1 = 0;
            __Pyx_XGOTREF(__pyx_t_7);
            __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
            __pyx_cur_scope->__pyx_t_2 = 0;
            __Pyx_XGOTREF(__pyx_t_8);
            __pyx_t_9 = __pyx_cur_scope->__pyx_t_3;
            __pyx_cur_scope->__pyx_t_3 = 0;
            __Pyx_XGOTREF(__pyx_t_9);
            if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1369, __pyx_L8_error)
            __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1);
          } else {
            __pyx_t_1 = NULL;
            if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 1369, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L12_try_return;

          /* "cymock.pyx":1366
 *         @wraps(func)
 *         async def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,             # <<<<<<<<<<<<<<
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 */
        }
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("cymock._patch.decorate_async_callable.patched", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 1366, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1366, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 1366, __pyx_L10_except_error)
          __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_5);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_5);
            __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; 
            __PYX_ERR(0, 1366, __pyx_L10_except_error)
          }
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L12_try_return:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L5_return;
        __pyx_L9_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__48, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1366, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L7;
      }
      __pyx_L5_return: {
        __Pyx_PyThreadState_assign
        __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_11 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_14, &__pyx_t_15);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        __pyx_t_16 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_6) {
          __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__48, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1366, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_17);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        }
        __pyx_r = __pyx_t_16;
        __pyx_t_16 = 0;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_14, __pyx_t_15);
        }
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ErrRestore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_11 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
        goto __pyx_L0;
      }
      __pyx_L7:;
    }
    goto __pyx_L20;
    __pyx_L4_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "cymock.pyx":1365
 * 
 *         @wraps(func)
 *         async def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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_5);
  __Pyx_AddTraceback("patched", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1358
 * 
 * 
 *     def decorate_async_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):
 */

static PyObject *__pyx_pf_6cymock_6_patch_13decorate_async_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func) {
  struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("decorate_async_callable", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *)__pyx_tp_new_6cymock___pyx_scope_struct_11_decorate_async_callable(__pyx_ptype_6cymock___pyx_scope_struct_11_decorate_async_callable, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1358, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);

  /* "cymock.pyx":1360
 *     def decorate_async_callable(self, func):
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):             # <<<<<<<<<<<<<<
 *             func.patchings.append(self)
 *             return func
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_func;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_patchings); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1361
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):
 *             func.patchings.append(self)             # <<<<<<<<<<<<<<
 *             return func
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_patchings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_cur_scope->__pyx_v_self); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1361, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":1362
 *         if hasattr(func, 'patchings'):
 *             func.patchings.append(self)
 *             return func             # <<<<<<<<<<<<<<
 * 
 *         @wraps(func)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
    __pyx_r = __pyx_cur_scope->__pyx_v_func;
    goto __pyx_L0;

    /* "cymock.pyx":1360
 *     def decorate_async_callable(self, func):
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):             # <<<<<<<<<<<<<<
 *             func.patchings.append(self)
 *             return func
 */
  }

  /* "cymock.pyx":1364
 *             return func
 * 
 *         @wraps(func)             # <<<<<<<<<<<<<<
 *         async def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_wraps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_cur_scope->__pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_func);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":1365
 * 
 *         @wraps(func)
 *         async def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_23decorate_async_callable_1patched, 0, __pyx_n_s_patch_decorate_async_callable_l, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_patched = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1371
 *                 return await func(*newargs, **newkeywargs)
 * 
 *         patched.patchings = [self]             # <<<<<<<<<<<<<<
 *         return patched
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_self);
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_patched, __pyx_n_s_patchings, __pyx_t_1) < 0) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1372
 * 
 *         patched.patchings = [self]
 *         return patched             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_patched);
  __pyx_r = __pyx_cur_scope->__pyx_v_patched;
  goto __pyx_L0;

  /* "cymock.pyx":1358
 * 
 * 
 *     def decorate_async_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._patch.decorate_async_callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1375
 * 
 * 
 *     def get_original(self):             # <<<<<<<<<<<<<<
 *         target = self.getter()
 *         name = self.attribute
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_16get_original(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_6_patch_16get_original = {"get_original", (PyCFunction)__pyx_pw_6cymock_6_patch_16get_original, METH_O, 0};
static PyObject *__pyx_pw_6cymock_6_patch_16get_original(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_original (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_6_patch_15get_original(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_6_patch_15get_original(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_target = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_original = NULL;
  int __pyx_v_local;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_UCS4 __pyx_t_14;
  __Pyx_RefNannySetupContext("get_original", 0);

  /* "cymock.pyx":1376
 * 
 *     def get_original(self):
 *         target = self.getter()             # <<<<<<<<<<<<<<
 *         name = self.attribute
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_target = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1377
 *     def get_original(self):
 *         target = self.getter()
 *         name = self.attribute             # <<<<<<<<<<<<<<
 * 
 *         original = DEFAULT
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1379
 *         name = self.attribute
 * 
 *         original = DEFAULT             # <<<<<<<<<<<<<<
 *         local = False
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_original = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1380
 * 
 *         original = DEFAULT
 *         local = False             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_v_local = 0;

  /* "cymock.pyx":1382
 *         local = False
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             original = target.__dict__[name]
 *         except (AttributeError, KeyError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "cymock.pyx":1383
 * 
 *         try:
 *             original = target.__dict__[name]             # <<<<<<<<<<<<<<
 *         except (AttributeError, KeyError):
 *             original = getattr(target, name, DEFAULT)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_target, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_original, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cymock.pyx":1382
 *         local = False
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             original = target.__dict__[name]
 *         except (AttributeError, KeyError):
 */
    }

    /* "cymock.pyx":1387
 *             original = getattr(target, name, DEFAULT)
 *         else:
 *             local = True             # <<<<<<<<<<<<<<
 * 
 *         if name in _builtins and isinstance(target, ModuleType):
 */
    /*else:*/ {
      __pyx_v_local = 1;
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":1384
 *         try:
 *             original = target.__dict__[name]
 *         except (AttributeError, KeyError):             # <<<<<<<<<<<<<<
 *             original = getattr(target, name, DEFAULT)
 *         else:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("cymock._patch.get_original", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 1384, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_3);

      /* "cymock.pyx":1385
 *             original = target.__dict__[name]
 *         except (AttributeError, KeyError):
 *             original = getattr(target, name, DEFAULT)             # <<<<<<<<<<<<<<
 *         else:
 *             local = True
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1385, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_GetAttr3(__pyx_v_target, __pyx_v_name, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1385, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF_SET(__pyx_v_original, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cymock.pyx":1382
 *         local = False
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             original = target.__dict__[name]
 *         except (AttributeError, KeyError):
 */
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_L8_try_end:;
  }

  /* "cymock.pyx":1389
 *             local = True
 * 
 *         if name in _builtins and isinstance(target, ModuleType):             # <<<<<<<<<<<<<<
 *             self.create = True
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_builtins_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = (__pyx_t_11 != 0);
  if (__pyx_t_12) {
  } else {
    __pyx_t_10 = __pyx_t_12;
    goto __pyx_L12_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ModuleType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_12 = PyObject_IsInstance(__pyx_v_target, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = (__pyx_t_12 != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_10) {

    /* "cymock.pyx":1390
 * 
 *         if name in _builtins and isinstance(target, ModuleType):
 *             self.create = True             # <<<<<<<<<<<<<<
 * 
 *         if not self.create and original is DEFAULT:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_create, Py_True) < 0) __PYX_ERR(0, 1390, __pyx_L1_error)

    /* "cymock.pyx":1389
 *             local = True
 * 
 *         if name in _builtins and isinstance(target, ModuleType):             # <<<<<<<<<<<<<<
 *             self.create = True
 * 
 */
  }

  /* "cymock.pyx":1392
 *             self.create = True
 * 
 *         if not self.create and original is DEFAULT:             # <<<<<<<<<<<<<<
 *             raise AttributeError(
 *                 "%s does not have the attribute %r" % (target, name)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_create); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = ((!__pyx_t_11) != 0);
  if (__pyx_t_12) {
  } else {
    __pyx_t_10 = __pyx_t_12;
    goto __pyx_L15_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_12 = (__pyx_v_original == __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = (__pyx_t_12 != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L15_bool_binop_done:;
  if (unlikely(__pyx_t_10)) {

    /* "cymock.pyx":1394
 *         if not self.create and original is DEFAULT:
 *             raise AttributeError(
 *                 "%s does not have the attribute %r" % (target, name)             # <<<<<<<<<<<<<<
 *             )
 *         return original, local
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_13 = 0;
    __pyx_t_14 = 127;
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_target), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_14;
    __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_does_not_have_the_attribute);
    __pyx_t_13 += 29;
    __Pyx_GIVEREF(__pyx_kp_u_does_not_have_the_attribute);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_does_not_have_the_attribute);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_14;
    __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":1393
 * 
 *         if not self.create and original is DEFAULT:
 *             raise AttributeError(             # <<<<<<<<<<<<<<
 *                 "%s does not have the attribute %r" % (target, name)
 *             )
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1393, __pyx_L1_error)

    /* "cymock.pyx":1392
 *             self.create = True
 * 
 *         if not self.create and original is DEFAULT:             # <<<<<<<<<<<<<<
 *             raise AttributeError(
 *                 "%s does not have the attribute %r" % (target, name)
 */
  }

  /* "cymock.pyx":1396
 *                 "%s does not have the attribute %r" % (target, name)
 *             )
 *         return original, local             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_local); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_original);
  __Pyx_GIVEREF(__pyx_v_original);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_original);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1375
 * 
 * 
 *     def get_original(self):             # <<<<<<<<<<<<<<
 *         target = self.getter()
 *         name = self.attribute
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cymock._patch.get_original", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_target);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_original);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1399
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Perform the patch."""
 *         new, spec, spec_set = self.new, self.spec, self.spec_set
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_18__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_6_patch_17__enter__[] = "Perform the patch.";
static PyMethodDef __pyx_mdef_6cymock_6_patch_18__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6cymock_6_patch_18__enter__, METH_O, __pyx_doc_6cymock_6_patch_17__enter__};
static PyObject *__pyx_pw_6cymock_6_patch_18__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_6_patch_17__enter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_6_patch_17__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_new = NULL;
  PyObject *__pyx_v_spec = NULL;
  PyObject *__pyx_v_spec_set = NULL;
  PyObject *__pyx_v_autospec = NULL;
  PyObject *__pyx_v_kwargs = NULL;
  PyObject *__pyx_v_new_callable = NULL;
  PyObject *__pyx_v_original = NULL;
  PyObject *__pyx_v_local = NULL;
  int __pyx_v_inherit;
  PyObject *__pyx_v_Klass = NULL;
  PyObject *__pyx_v__kwargs = NULL;
  PyObject *__pyx_v_this_spec = NULL;
  PyObject *__pyx_v_not_callable = NULL;
  PyObject *__pyx_v_new_attr = NULL;
  PyObject *__pyx_v_extra_args = NULL;
  PyObject *__pyx_v_patching = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "cymock.pyx":1401
 *     def __enter__(self):
 *         """Perform the patch."""
 *         new, spec, spec_set = self.new, self.spec, self.spec_set             # <<<<<<<<<<<<<<
 *         autospec, kwargs = self.autospec, self.kwargs
 *         new_callable = self.new_callable
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_new_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_spec_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_new = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_spec = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_spec_set = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":1402
 *         """Perform the patch."""
 *         new, spec, spec_set = self.new, self.spec, self.spec_set
 *         autospec, kwargs = self.autospec, self.kwargs             # <<<<<<<<<<<<<<
 *         new_callable = self.new_callable
 *         self.target = self.getter()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_autospec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_autospec = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kwargs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":1403
 *         new, spec, spec_set = self.new, self.spec, self.spec_set
 *         autospec, kwargs = self.autospec, self.kwargs
 *         new_callable = self.new_callable             # <<<<<<<<<<<<<<
 *         self.target = self.getter()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_new_callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_new_callable = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":1404
 *         autospec, kwargs = self.autospec, self.kwargs
 *         new_callable = self.new_callable
 *         self.target = self.getter()             # <<<<<<<<<<<<<<
 * 
 *         # normalise False to None
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_target, __pyx_t_2) < 0) __PYX_ERR(0, 1404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1407
 * 
 *         # normalise False to None
 *         if spec is False:             # <<<<<<<<<<<<<<
 *             spec = None
 *         if spec_set is False:
 */
  __pyx_t_4 = (__pyx_v_spec == Py_False);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":1408
 *         # normalise False to None
 *         if spec is False:
 *             spec = None             # <<<<<<<<<<<<<<
 *         if spec_set is False:
 *             spec_set = None
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_spec, Py_None);

    /* "cymock.pyx":1407
 * 
 *         # normalise False to None
 *         if spec is False:             # <<<<<<<<<<<<<<
 *             spec = None
 *         if spec_set is False:
 */
  }

  /* "cymock.pyx":1409
 *         if spec is False:
 *             spec = None
 *         if spec_set is False:             # <<<<<<<<<<<<<<
 *             spec_set = None
 *         if autospec is False:
 */
  __pyx_t_5 = (__pyx_v_spec_set == Py_False);
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":1410
 *             spec = None
 *         if spec_set is False:
 *             spec_set = None             # <<<<<<<<<<<<<<
 *         if autospec is False:
 *             autospec = None
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_spec_set, Py_None);

    /* "cymock.pyx":1409
 *         if spec is False:
 *             spec = None
 *         if spec_set is False:             # <<<<<<<<<<<<<<
 *             spec_set = None
 *         if autospec is False:
 */
  }

  /* "cymock.pyx":1411
 *         if spec_set is False:
 *             spec_set = None
 *         if autospec is False:             # <<<<<<<<<<<<<<
 *             autospec = None
 * 
 */
  __pyx_t_4 = (__pyx_v_autospec == Py_False);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":1412
 *             spec_set = None
 *         if autospec is False:
 *             autospec = None             # <<<<<<<<<<<<<<
 * 
 *         if spec is not None and autospec is not None:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_autospec, Py_None);

    /* "cymock.pyx":1411
 *         if spec_set is False:
 *             spec_set = None
 *         if autospec is False:             # <<<<<<<<<<<<<<
 *             autospec = None
 * 
 */
  }

  /* "cymock.pyx":1414
 *             autospec = None
 * 
 *         if spec is not None and autospec is not None:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can't specify spec and autospec")
 *         if ((spec is not None or autospec is not None) and
 */
  __pyx_t_4 = (__pyx_v_spec != Py_None);
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_6 = (__pyx_v_autospec != Py_None);
  __pyx_t_4 = (__pyx_t_6 != 0);
  __pyx_t_5 = __pyx_t_4;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_5)) {

    /* "cymock.pyx":1415
 * 
 *         if spec is not None and autospec is not None:
 *             raise TypeError("Can't specify spec and autospec")             # <<<<<<<<<<<<<<
 *         if ((spec is not None or autospec is not None) and
 *             spec_set not in (True, None)):
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1415, __pyx_L1_error)

    /* "cymock.pyx":1414
 *             autospec = None
 * 
 *         if spec is not None and autospec is not None:             # <<<<<<<<<<<<<<
 *             raise TypeError("Can't specify spec and autospec")
 *         if ((spec is not None or autospec is not None) and
 */
  }

  /* "cymock.pyx":1416
 *         if spec is not None and autospec is not None:
 *             raise TypeError("Can't specify spec and autospec")
 *         if ((spec is not None or autospec is not None) and             # <<<<<<<<<<<<<<
 *             spec_set not in (True, None)):
 *             raise TypeError("Can't provide explicit spec_set *and* spec or autospec")
 */
  __pyx_t_4 = (__pyx_v_spec != Py_None);
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (!__pyx_t_6) {
  } else {
    goto __pyx_L11_next_and;
  }
  __pyx_t_6 = (__pyx_v_autospec != Py_None);
  __pyx_t_4 = (__pyx_t_6 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_L11_next_and:;

  /* "cymock.pyx":1417
 *             raise TypeError("Can't specify spec and autospec")
 *         if ((spec is not None or autospec is not None) and
 *             spec_set not in (True, None)):             # <<<<<<<<<<<<<<
 *             raise TypeError("Can't provide explicit spec_set *and* spec or autospec")
 * 
 */
  __Pyx_INCREF(__pyx_v_spec_set);
  __pyx_t_2 = __pyx_v_spec_set;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, Py_True, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __pyx_t_6;
  __pyx_L13_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (__pyx_t_4 != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L10_bool_binop_done:;

  /* "cymock.pyx":1416
 *         if spec is not None and autospec is not None:
 *             raise TypeError("Can't specify spec and autospec")
 *         if ((spec is not None or autospec is not None) and             # <<<<<<<<<<<<<<
 *             spec_set not in (True, None)):
 *             raise TypeError("Can't provide explicit spec_set *and* spec or autospec")
 */
  if (unlikely(__pyx_t_5)) {

    /* "cymock.pyx":1418
 *         if ((spec is not None or autospec is not None) and
 *             spec_set not in (True, None)):
 *             raise TypeError("Can't provide explicit spec_set *and* spec or autospec")             # <<<<<<<<<<<<<<
 * 
 *         original, local = self.get_original()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1418, __pyx_L1_error)

    /* "cymock.pyx":1416
 *         if spec is not None and autospec is not None:
 *             raise TypeError("Can't specify spec and autospec")
 *         if ((spec is not None or autospec is not None) and             # <<<<<<<<<<<<<<
 *             spec_set not in (True, None)):
 *             raise TypeError("Can't provide explicit spec_set *and* spec or autospec")
 */
  }

  /* "cymock.pyx":1420
 *             raise TypeError("Can't provide explicit spec_set *and* spec or autospec")
 * 
 *         original, local = self.get_original()             # <<<<<<<<<<<<<<
 * 
 *         if new is DEFAULT and autospec is None:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_original); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1420, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1420, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L16_unpacking_done;
    __pyx_L15_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1420, __pyx_L1_error)
    __pyx_L16_unpacking_done:;
  }
  __pyx_v_original = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_local = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1422
 *         original, local = self.get_original()
 * 
 *         if new is DEFAULT and autospec is None:             # <<<<<<<<<<<<<<
 *             inherit = False
 *             if spec is True:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = (__pyx_v_new == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_6 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L18_bool_binop_done;
  }
  __pyx_t_4 = (__pyx_v_autospec == Py_None);
  __pyx_t_6 = (__pyx_t_4 != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L18_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cymock.pyx":1423
 * 
 *         if new is DEFAULT and autospec is None:
 *             inherit = False             # <<<<<<<<<<<<<<
 *             if spec is True:
 *                 # set spec to the object we are replacing
 */
    __pyx_v_inherit = 0;

    /* "cymock.pyx":1424
 *         if new is DEFAULT and autospec is None:
 *             inherit = False
 *             if spec is True:             # <<<<<<<<<<<<<<
 *                 # set spec to the object we are replacing
 *                 spec = original
 */
    __pyx_t_5 = (__pyx_v_spec == Py_True);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "cymock.pyx":1426
 *             if spec is True:
 *                 # set spec to the object we are replacing
 *                 spec = original             # <<<<<<<<<<<<<<
 *                 if spec_set is True:
 *                     spec_set = original
 */
      __Pyx_INCREF(__pyx_v_original);
      __Pyx_DECREF_SET(__pyx_v_spec, __pyx_v_original);

      /* "cymock.pyx":1427
 *                 # set spec to the object we are replacing
 *                 spec = original
 *                 if spec_set is True:             # <<<<<<<<<<<<<<
 *                     spec_set = original
 *                     spec = None
 */
      __pyx_t_6 = (__pyx_v_spec_set == Py_True);
      __pyx_t_5 = (__pyx_t_6 != 0);
      if (__pyx_t_5) {

        /* "cymock.pyx":1428
 *                 spec = original
 *                 if spec_set is True:
 *                     spec_set = original             # <<<<<<<<<<<<<<
 *                     spec = None
 *             elif spec is not None:
 */
        __Pyx_INCREF(__pyx_v_original);
        __Pyx_DECREF_SET(__pyx_v_spec_set, __pyx_v_original);

        /* "cymock.pyx":1429
 *                 if spec_set is True:
 *                     spec_set = original
 *                     spec = None             # <<<<<<<<<<<<<<
 *             elif spec is not None:
 *                 if spec_set is True:
 */
        __Pyx_INCREF(Py_None);
        __Pyx_DECREF_SET(__pyx_v_spec, Py_None);

        /* "cymock.pyx":1427
 *                 # set spec to the object we are replacing
 *                 spec = original
 *                 if spec_set is True:             # <<<<<<<<<<<<<<
 *                     spec_set = original
 *                     spec = None
 */
      }

      /* "cymock.pyx":1424
 *         if new is DEFAULT and autospec is None:
 *             inherit = False
 *             if spec is True:             # <<<<<<<<<<<<<<
 *                 # set spec to the object we are replacing
 *                 spec = original
 */
      goto __pyx_L20;
    }

    /* "cymock.pyx":1430
 *                     spec_set = original
 *                     spec = None
 *             elif spec is not None:             # <<<<<<<<<<<<<<
 *                 if spec_set is True:
 *                     spec_set = spec
 */
    __pyx_t_5 = (__pyx_v_spec != Py_None);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "cymock.pyx":1431
 *                     spec = None
 *             elif spec is not None:
 *                 if spec_set is True:             # <<<<<<<<<<<<<<
 *                     spec_set = spec
 *                     spec = None
 */
      __pyx_t_6 = (__pyx_v_spec_set == Py_True);
      __pyx_t_5 = (__pyx_t_6 != 0);
      if (__pyx_t_5) {

        /* "cymock.pyx":1432
 *             elif spec is not None:
 *                 if spec_set is True:
 *                     spec_set = spec             # <<<<<<<<<<<<<<
 *                     spec = None
 *             elif spec_set is True:
 */
        __Pyx_INCREF(__pyx_v_spec);
        __Pyx_DECREF_SET(__pyx_v_spec_set, __pyx_v_spec);

        /* "cymock.pyx":1433
 *                 if spec_set is True:
 *                     spec_set = spec
 *                     spec = None             # <<<<<<<<<<<<<<
 *             elif spec_set is True:
 *                 spec_set = original
 */
        __Pyx_INCREF(Py_None);
        __Pyx_DECREF_SET(__pyx_v_spec, Py_None);

        /* "cymock.pyx":1431
 *                     spec = None
 *             elif spec is not None:
 *                 if spec_set is True:             # <<<<<<<<<<<<<<
 *                     spec_set = spec
 *                     spec = None
 */
      }

      /* "cymock.pyx":1430
 *                     spec_set = original
 *                     spec = None
 *             elif spec is not None:             # <<<<<<<<<<<<<<
 *                 if spec_set is True:
 *                     spec_set = spec
 */
      goto __pyx_L20;
    }

    /* "cymock.pyx":1434
 *                     spec_set = spec
 *                     spec = None
 *             elif spec_set is True:             # <<<<<<<<<<<<<<
 *                 spec_set = original
 * 
 */
    __pyx_t_5 = (__pyx_v_spec_set == Py_True);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "cymock.pyx":1435
 *                     spec = None
 *             elif spec_set is True:
 *                 spec_set = original             # <<<<<<<<<<<<<<
 * 
 *             if spec is not None or spec_set is not None:
 */
      __Pyx_INCREF(__pyx_v_original);
      __Pyx_DECREF_SET(__pyx_v_spec_set, __pyx_v_original);

      /* "cymock.pyx":1434
 *                     spec_set = spec
 *                     spec = None
 *             elif spec_set is True:             # <<<<<<<<<<<<<<
 *                 spec_set = original
 * 
 */
    }
    __pyx_L20:;

    /* "cymock.pyx":1437
 *                 spec_set = original
 * 
 *             if spec is not None or spec_set is not None:             # <<<<<<<<<<<<<<
 *                 if original is DEFAULT:
 *                     raise TypeError("Can't use 'spec' with create=True")
 */
    __pyx_t_5 = (__pyx_v_spec != Py_None);
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_6 = __pyx_t_4;
      goto __pyx_L24_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_spec_set != Py_None);
    __pyx_t_5 = (__pyx_t_4 != 0);
    __pyx_t_6 = __pyx_t_5;
    __pyx_L24_bool_binop_done:;
    if (__pyx_t_6) {

      /* "cymock.pyx":1438
 * 
 *             if spec is not None or spec_set is not None:
 *                 if original is DEFAULT:             # <<<<<<<<<<<<<<
 *                     raise TypeError("Can't use 'spec' with create=True")
 *                 if isinstance(original, type):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = (__pyx_v_original == __pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = (__pyx_t_6 != 0);
      if (unlikely(__pyx_t_5)) {

        /* "cymock.pyx":1439
 *             if spec is not None or spec_set is not None:
 *                 if original is DEFAULT:
 *                     raise TypeError("Can't use 'spec' with create=True")             # <<<<<<<<<<<<<<
 *                 if isinstance(original, type):
 *                     # If we're patching out a class and there is a spec
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 1439, __pyx_L1_error)

        /* "cymock.pyx":1438
 * 
 *             if spec is not None or spec_set is not None:
 *                 if original is DEFAULT:             # <<<<<<<<<<<<<<
 *                     raise TypeError("Can't use 'spec' with create=True")
 *                 if isinstance(original, type):
 */
      }

      /* "cymock.pyx":1440
 *                 if original is DEFAULT:
 *                     raise TypeError("Can't use 'spec' with create=True")
 *                 if isinstance(original, type):             # <<<<<<<<<<<<<<
 *                     # If we're patching out a class and there is a spec
 *                     inherit = True
 */
      __pyx_t_5 = PyType_Check(__pyx_v_original); 
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (__pyx_t_6) {

        /* "cymock.pyx":1442
 *                 if isinstance(original, type):
 *                     # If we're patching out a class and there is a spec
 *                     inherit = True             # <<<<<<<<<<<<<<
 *             if spec is None and _is_async_obj(original):
 *                 Klass = AsyncMock
 */
        __pyx_v_inherit = 1;

        /* "cymock.pyx":1440
 *                 if original is DEFAULT:
 *                     raise TypeError("Can't use 'spec' with create=True")
 *                 if isinstance(original, type):             # <<<<<<<<<<<<<<
 *                     # If we're patching out a class and there is a spec
 *                     inherit = True
 */
      }

      /* "cymock.pyx":1437
 *                 spec_set = original
 * 
 *             if spec is not None or spec_set is not None:             # <<<<<<<<<<<<<<
 *                 if original is DEFAULT:
 *                     raise TypeError("Can't use 'spec' with create=True")
 */
    }

    /* "cymock.pyx":1443
 *                     # If we're patching out a class and there is a spec
 *                     inherit = True
 *             if spec is None and _is_async_obj(original):             # <<<<<<<<<<<<<<
 *                 Klass = AsyncMock
 *             else:
 */
    __pyx_t_5 = (__pyx_v_spec == Py_None);
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_6 = __pyx_t_4;
      goto __pyx_L29_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_async_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_original) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_original);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1443, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __pyx_t_4;
    __pyx_L29_bool_binop_done:;
    if (__pyx_t_6) {

      /* "cymock.pyx":1444
 *                     inherit = True
 *             if spec is None and _is_async_obj(original):
 *                 Klass = AsyncMock             # <<<<<<<<<<<<<<
 *             else:
 *                 Klass = MagicMock
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_Klass = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "cymock.pyx":1443
 *                     # If we're patching out a class and there is a spec
 *                     inherit = True
 *             if spec is None and _is_async_obj(original):             # <<<<<<<<<<<<<<
 *                 Klass = AsyncMock
 *             else:
 */
      goto __pyx_L28;
    }

    /* "cymock.pyx":1446
 *                 Klass = AsyncMock
 *             else:
 *                 Klass = MagicMock             # <<<<<<<<<<<<<<
 *             _kwargs = {}
 *             if new_callable is not None:
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1446, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_Klass = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L28:;

    /* "cymock.pyx":1447
 *             else:
 *                 Klass = MagicMock
 *             _kwargs = {}             # <<<<<<<<<<<<<<
 *             if new_callable is not None:
 *                 Klass = new_callable
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v__kwargs = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cymock.pyx":1448
 *                 Klass = MagicMock
 *             _kwargs = {}
 *             if new_callable is not None:             # <<<<<<<<<<<<<<
 *                 Klass = new_callable
 *             elif spec is not None or spec_set is not None:
 */
    __pyx_t_6 = (__pyx_v_new_callable != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (__pyx_t_4) {

      /* "cymock.pyx":1449
 *             _kwargs = {}
 *             if new_callable is not None:
 *                 Klass = new_callable             # <<<<<<<<<<<<<<
 *             elif spec is not None or spec_set is not None:
 *                 this_spec = spec
 */
      __Pyx_INCREF(__pyx_v_new_callable);
      __Pyx_DECREF_SET(__pyx_v_Klass, __pyx_v_new_callable);

      /* "cymock.pyx":1448
 *                 Klass = MagicMock
 *             _kwargs = {}
 *             if new_callable is not None:             # <<<<<<<<<<<<<<
 *                 Klass = new_callable
 *             elif spec is not None or spec_set is not None:
 */
      goto __pyx_L31;
    }

    /* "cymock.pyx":1450
 *             if new_callable is not None:
 *                 Klass = new_callable
 *             elif spec is not None or spec_set is not None:             # <<<<<<<<<<<<<<
 *                 this_spec = spec
 *                 if spec_set is not None:
 */
    __pyx_t_6 = (__pyx_v_spec != Py_None);
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (!__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L32_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_spec_set != Py_None);
    __pyx_t_6 = (__pyx_t_5 != 0);
    __pyx_t_4 = __pyx_t_6;
    __pyx_L32_bool_binop_done:;
    if (__pyx_t_4) {

      /* "cymock.pyx":1451
 *                 Klass = new_callable
 *             elif spec is not None or spec_set is not None:
 *                 this_spec = spec             # <<<<<<<<<<<<<<
 *                 if spec_set is not None:
 *                     this_spec = spec_set
 */
      __Pyx_INCREF(__pyx_v_spec);
      __pyx_v_this_spec = __pyx_v_spec;

      /* "cymock.pyx":1452
 *             elif spec is not None or spec_set is not None:
 *                 this_spec = spec
 *                 if spec_set is not None:             # <<<<<<<<<<<<<<
 *                     this_spec = spec_set
 *                 if _is_list(this_spec):
 */
      __pyx_t_4 = (__pyx_v_spec_set != Py_None);
      __pyx_t_6 = (__pyx_t_4 != 0);
      if (__pyx_t_6) {

        /* "cymock.pyx":1453
 *                 this_spec = spec
 *                 if spec_set is not None:
 *                     this_spec = spec_set             # <<<<<<<<<<<<<<
 *                 if _is_list(this_spec):
 *                     not_callable = '__call__' not in this_spec
 */
        __Pyx_INCREF(__pyx_v_spec_set);
        __Pyx_DECREF_SET(__pyx_v_this_spec, __pyx_v_spec_set);

        /* "cymock.pyx":1452
 *             elif spec is not None or spec_set is not None:
 *                 this_spec = spec
 *                 if spec_set is not None:             # <<<<<<<<<<<<<<
 *                     this_spec = spec_set
 *                 if _is_list(this_spec):
 */
      }

      /* "cymock.pyx":1454
 *                 if spec_set is not None:
 *                     this_spec = spec_set
 *                 if _is_list(this_spec):             # <<<<<<<<<<<<<<
 *                     not_callable = '__call__' not in this_spec
 *                 else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_this_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_this_spec);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1454, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "cymock.pyx":1455
 *                     this_spec = spec_set
 *                 if _is_list(this_spec):
 *                     not_callable = '__call__' not in this_spec             # <<<<<<<<<<<<<<
 *                 else:
 *                     not_callable = not callable(this_spec)
 */
        __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_call, __pyx_v_this_spec, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1455, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v_not_callable = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "cymock.pyx":1454
 *                 if spec_set is not None:
 *                     this_spec = spec_set
 *                 if _is_list(this_spec):             # <<<<<<<<<<<<<<
 *                     not_callable = '__call__' not in this_spec
 *                 else:
 */
        goto __pyx_L35;
      }

      /* "cymock.pyx":1457
 *                     not_callable = '__call__' not in this_spec
 *                 else:
 *                     not_callable = not callable(this_spec)             # <<<<<<<<<<<<<<
 *                 if _is_async_obj(this_spec):
 *                     Klass = AsyncMock
 */
      /*else*/ {
        __pyx_t_6 = __Pyx_PyCallable_Check(__pyx_v_this_spec); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1457, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyBool_FromLong((!(__pyx_t_6 != 0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1457, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v_not_callable = __pyx_t_2;
        __pyx_t_2 = 0;
      }
      __pyx_L35:;

      /* "cymock.pyx":1458
 *                 else:
 *                     not_callable = not callable(this_spec)
 *                 if _is_async_obj(this_spec):             # <<<<<<<<<<<<<<
 *                     Klass = AsyncMock
 *                 elif not_callable:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_async_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_this_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_this_spec);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1458, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_6) {

        /* "cymock.pyx":1459
 *                     not_callable = not callable(this_spec)
 *                 if _is_async_obj(this_spec):
 *                     Klass = AsyncMock             # <<<<<<<<<<<<<<
 *                 elif not_callable:
 *                     Klass = NonCallableMagicMock
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_Klass, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cymock.pyx":1458
 *                 else:
 *                     not_callable = not callable(this_spec)
 *                 if _is_async_obj(this_spec):             # <<<<<<<<<<<<<<
 *                     Klass = AsyncMock
 *                 elif not_callable:
 */
        goto __pyx_L36;
      }

      /* "cymock.pyx":1460
 *                 if _is_async_obj(this_spec):
 *                     Klass = AsyncMock
 *                 elif not_callable:             # <<<<<<<<<<<<<<
 *                     Klass = NonCallableMagicMock
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_not_callable); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1460, __pyx_L1_error)
      if (__pyx_t_6) {

        /* "cymock.pyx":1461
 *                     Klass = AsyncMock
 *                 elif not_callable:
 *                     Klass = NonCallableMagicMock             # <<<<<<<<<<<<<<
 * 
 *             if spec is not None:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NonCallableMagicMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_Klass, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cymock.pyx":1460
 *                 if _is_async_obj(this_spec):
 *                     Klass = AsyncMock
 *                 elif not_callable:             # <<<<<<<<<<<<<<
 *                     Klass = NonCallableMagicMock
 * 
 */
      }
      __pyx_L36:;

      /* "cymock.pyx":1450
 *             if new_callable is not None:
 *                 Klass = new_callable
 *             elif spec is not None or spec_set is not None:             # <<<<<<<<<<<<<<
 *                 this_spec = spec
 *                 if spec_set is not None:
 */
    }
    __pyx_L31:;

    /* "cymock.pyx":1463
 *                     Klass = NonCallableMagicMock
 * 
 *             if spec is not None:             # <<<<<<<<<<<<<<
 *                 _kwargs['spec'] = spec
 *             if spec_set is not None:
 */
    __pyx_t_6 = (__pyx_v_spec != Py_None);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (__pyx_t_4) {

      /* "cymock.pyx":1464
 * 
 *             if spec is not None:
 *                 _kwargs['spec'] = spec             # <<<<<<<<<<<<<<
 *             if spec_set is not None:
 *                 _kwargs['spec_set'] = spec_set
 */
      if (unlikely(PyDict_SetItem(__pyx_v__kwargs, __pyx_n_u_spec, __pyx_v_spec) < 0)) __PYX_ERR(0, 1464, __pyx_L1_error)

      /* "cymock.pyx":1463
 *                     Klass = NonCallableMagicMock
 * 
 *             if spec is not None:             # <<<<<<<<<<<<<<
 *                 _kwargs['spec'] = spec
 *             if spec_set is not None:
 */
    }

    /* "cymock.pyx":1465
 *             if spec is not None:
 *                 _kwargs['spec'] = spec
 *             if spec_set is not None:             # <<<<<<<<<<<<<<
 *                 _kwargs['spec_set'] = spec_set
 * 
 */
    __pyx_t_4 = (__pyx_v_spec_set != Py_None);
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (__pyx_t_6) {

      /* "cymock.pyx":1466
 *                 _kwargs['spec'] = spec
 *             if spec_set is not None:
 *                 _kwargs['spec_set'] = spec_set             # <<<<<<<<<<<<<<
 * 
 *             # add a name to mocks
 */
      if (unlikely(PyDict_SetItem(__pyx_v__kwargs, __pyx_n_u_spec_set, __pyx_v_spec_set) < 0)) __PYX_ERR(0, 1466, __pyx_L1_error)

      /* "cymock.pyx":1465
 *             if spec is not None:
 *                 _kwargs['spec'] = spec
 *             if spec_set is not None:             # <<<<<<<<<<<<<<
 *                 _kwargs['spec_set'] = spec_set
 * 
 */
    }

    /* "cymock.pyx":1469
 * 
 *             # add a name to mocks
 *             if (isinstance(Klass, type) and             # <<<<<<<<<<<<<<
 *                 issubclass(Klass, NonCallableMock) and self.attribute):
 *                 _kwargs['name'] = self.attribute
 */
    __pyx_t_4 = PyType_Check(__pyx_v_Klass); 
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_6 = __pyx_t_5;
      goto __pyx_L40_bool_binop_done;
    }

    /* "cymock.pyx":1470
 *             # add a name to mocks
 *             if (isinstance(Klass, type) and
 *                 issubclass(Klass, NonCallableMock) and self.attribute):             # <<<<<<<<<<<<<<
 *                 _kwargs['name'] = self.attribute
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_IsSubclass(__pyx_v_Klass, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1470, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_6 = __pyx_t_4;
      goto __pyx_L40_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1470, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __pyx_t_4;
    __pyx_L40_bool_binop_done:;

    /* "cymock.pyx":1469
 * 
 *             # add a name to mocks
 *             if (isinstance(Klass, type) and             # <<<<<<<<<<<<<<
 *                 issubclass(Klass, NonCallableMock) and self.attribute):
 *                 _kwargs['name'] = self.attribute
 */
    if (__pyx_t_6) {

      /* "cymock.pyx":1471
 *             if (isinstance(Klass, type) and
 *                 issubclass(Klass, NonCallableMock) and self.attribute):
 *                 _kwargs['name'] = self.attribute             # <<<<<<<<<<<<<<
 * 
 *             _kwargs.update(kwargs)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyDict_SetItem(__pyx_v__kwargs, __pyx_n_u_name_2, __pyx_t_2) < 0)) __PYX_ERR(0, 1471, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cymock.pyx":1469
 * 
 *             # add a name to mocks
 *             if (isinstance(Klass, type) and             # <<<<<<<<<<<<<<
 *                 issubclass(Klass, NonCallableMock) and self.attribute):
 *                 _kwargs['name'] = self.attribute
 */
    }

    /* "cymock.pyx":1473
 *                 _kwargs['name'] = self.attribute
 * 
 *             _kwargs.update(kwargs)             # <<<<<<<<<<<<<<
 *             new = Klass(**_kwargs)
 * 
 */
    __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v__kwargs, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cymock.pyx":1474
 * 
 *             _kwargs.update(kwargs)
 *             new = Klass(**_kwargs)             # <<<<<<<<<<<<<<
 * 
 *             if inherit and _is_instance_mock(new):
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_Klass, __pyx_empty_tuple, __pyx_v__kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_new, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cymock.pyx":1476
 *             new = Klass(**_kwargs)
 * 
 *             if inherit and _is_instance_mock(new):             # <<<<<<<<<<<<<<
 *                 # we can only tell if the instance should be callable if the
 *                 # spec is not a list
 */
    __pyx_t_4 = (__pyx_v_inherit != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_6 = __pyx_t_4;
      goto __pyx_L44_bool_binop_done;
    }
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_instance_mock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_new);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1476, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __pyx_t_4;
    __pyx_L44_bool_binop_done:;
    if (__pyx_t_6) {

      /* "cymock.pyx":1479
 *                 # we can only tell if the instance should be callable if the
 *                 # spec is not a list
 *                 this_spec = spec             # <<<<<<<<<<<<<<
 *                 if spec_set is not None:
 *                     this_spec = spec_set
 */
      __Pyx_INCREF(__pyx_v_spec);
      __Pyx_XDECREF_SET(__pyx_v_this_spec, __pyx_v_spec);

      /* "cymock.pyx":1480
 *                 # spec is not a list
 *                 this_spec = spec
 *                 if spec_set is not None:             # <<<<<<<<<<<<<<
 *                     this_spec = spec_set
 *                 if (not _is_list(this_spec) and not
 */
      __pyx_t_6 = (__pyx_v_spec_set != Py_None);
      __pyx_t_4 = (__pyx_t_6 != 0);
      if (__pyx_t_4) {

        /* "cymock.pyx":1481
 *                 this_spec = spec
 *                 if spec_set is not None:
 *                     this_spec = spec_set             # <<<<<<<<<<<<<<
 *                 if (not _is_list(this_spec) and not
 *                     _instance_callable(this_spec)):
 */
        __Pyx_INCREF(__pyx_v_spec_set);
        __Pyx_DECREF_SET(__pyx_v_this_spec, __pyx_v_spec_set);

        /* "cymock.pyx":1480
 *                 # spec is not a list
 *                 this_spec = spec
 *                 if spec_set is not None:             # <<<<<<<<<<<<<<
 *                     this_spec = spec_set
 *                 if (not _is_list(this_spec) and not
 */
      }

      /* "cymock.pyx":1482
 *                 if spec_set is not None:
 *                     this_spec = spec_set
 *                 if (not _is_list(this_spec) and not             # <<<<<<<<<<<<<<
 *                     _instance_callable(this_spec)):
 *                     Klass = NonCallableMagicMock
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_this_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_this_spec);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1482, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = ((!__pyx_t_6) != 0);
      if (__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L48_bool_binop_done;
      }

      /* "cymock.pyx":1483
 *                     this_spec = spec_set
 *                 if (not _is_list(this_spec) and not
 *                     _instance_callable(this_spec)):             # <<<<<<<<<<<<<<
 *                     Klass = NonCallableMagicMock
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_instance_callable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_this_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_this_spec);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1483, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1483, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cymock.pyx":1482
 *                 if spec_set is not None:
 *                     this_spec = spec_set
 *                 if (not _is_list(this_spec) and not             # <<<<<<<<<<<<<<
 *                     _instance_callable(this_spec)):
 *                     Klass = NonCallableMagicMock
 */
      __pyx_t_6 = ((!__pyx_t_5) != 0);
      __pyx_t_4 = __pyx_t_6;
      __pyx_L48_bool_binop_done:;
      if (__pyx_t_4) {

        /* "cymock.pyx":1484
 *                 if (not _is_list(this_spec) and not
 *                     _instance_callable(this_spec)):
 *                     Klass = NonCallableMagicMock             # <<<<<<<<<<<<<<
 * 
 *                 _kwargs.pop('name')
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NonCallableMagicMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_Klass, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "cymock.pyx":1482
 *                 if spec_set is not None:
 *                     this_spec = spec_set
 *                 if (not _is_list(this_spec) and not             # <<<<<<<<<<<<<<
 *                     _instance_callable(this_spec)):
 *                     Klass = NonCallableMagicMock
 */
      }

      /* "cymock.pyx":1486
 *                     Klass = NonCallableMagicMock
 * 
 *                 _kwargs.pop('name')             # <<<<<<<<<<<<<<
 *                 new.return_value = Klass(_new_parent=new, _new_name='()',
 *                                          **_kwargs)
 */
      __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v__kwargs, __pyx_n_u_name_2, ((PyObject *)NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cymock.pyx":1487
 * 
 *                 _kwargs.pop('name')
 *                 new.return_value = Klass(_new_parent=new, _new_name='()',             # <<<<<<<<<<<<<<
 *                                          **_kwargs)
 *         elif autospec is not None:
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_new_parent, __pyx_v_new) < 0) __PYX_ERR(0, 1487, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_new_name_2, __pyx_kp_u__32) < 0) __PYX_ERR(0, 1487, __pyx_L1_error)
      __pyx_t_2 = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cymock.pyx":1488
 *                 _kwargs.pop('name')
 *                 new.return_value = Klass(_new_parent=new, _new_name='()',
 *                                          **_kwargs)             # <<<<<<<<<<<<<<
 *         elif autospec is not None:
 *             # spec is ignored, new *must* be default, spec_set is treated
 */
      if (__Pyx_MergeKeywords(__pyx_t_2, __pyx_v__kwargs) < 0) __PYX_ERR(0, 1488, __pyx_L1_error)

      /* "cymock.pyx":1487
 * 
 *                 _kwargs.pop('name')
 *                 new.return_value = Klass(_new_parent=new, _new_name='()',             # <<<<<<<<<<<<<<
 *                                          **_kwargs)
 *         elif autospec is not None:
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_Klass, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_new, __pyx_n_s_return_value, __pyx_t_1) < 0) __PYX_ERR(0, 1487, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cymock.pyx":1476
 *             new = Klass(**_kwargs)
 * 
 *             if inherit and _is_instance_mock(new):             # <<<<<<<<<<<<<<
 *                 # we can only tell if the instance should be callable if the
 *                 # spec is not a list
 */
    }

    /* "cymock.pyx":1422
 *         original, local = self.get_original()
 * 
 *         if new is DEFAULT and autospec is None:             # <<<<<<<<<<<<<<
 *             inherit = False
 *             if spec is True:
 */
    goto __pyx_L17;
  }

  /* "cymock.pyx":1489
 *                 new.return_value = Klass(_new_parent=new, _new_name='()',
 *                                          **_kwargs)
 *         elif autospec is not None:             # <<<<<<<<<<<<<<
 *             # spec is ignored, new *must* be default, spec_set is treated
 *             # as a boolean. Should we check spec is not None and that spec_set
 */
  __pyx_t_4 = (__pyx_v_autospec != Py_None);
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (__pyx_t_6) {

    /* "cymock.pyx":1493
 *             # as a boolean. Should we check spec is not None and that spec_set
 *             # is a bool?
 *             if new is not DEFAULT:             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     "autospec creates the mock for you. Can't specify "
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = (__pyx_v_new != __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (unlikely(__pyx_t_4)) {

      /* "cymock.pyx":1494
 *             # is a bool?
 *             if new is not DEFAULT:
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     "autospec creates the mock for you. Can't specify "
 *                     "autospec and new."
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 1494, __pyx_L1_error)

      /* "cymock.pyx":1493
 *             # as a boolean. Should we check spec is not None and that spec_set
 *             # is a bool?
 *             if new is not DEFAULT:             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     "autospec creates the mock for you. Can't specify "
 */
    }

    /* "cymock.pyx":1498
 *                     "autospec and new."
 *                 )
 *             if original is DEFAULT:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Can't use 'autospec' with create=True")
 *             spec_set = bool(spec_set)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (__pyx_v_original == __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (unlikely(__pyx_t_6)) {

      /* "cymock.pyx":1499
 *                 )
 *             if original is DEFAULT:
 *                 raise TypeError("Can't use 'autospec' with create=True")             # <<<<<<<<<<<<<<
 *             spec_set = bool(spec_set)
 *             if autospec is True:
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 1499, __pyx_L1_error)

      /* "cymock.pyx":1498
 *                     "autospec and new."
 *                 )
 *             if original is DEFAULT:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Can't use 'autospec' with create=True")
 *             spec_set = bool(spec_set)
 */
    }

    /* "cymock.pyx":1500
 *             if original is DEFAULT:
 *                 raise TypeError("Can't use 'autospec' with create=True")
 *             spec_set = bool(spec_set)             # <<<<<<<<<<<<<<
 *             if autospec is True:
 *                 autospec = original
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_spec_set); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1500, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_spec_set, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":1501
 *                 raise TypeError("Can't use 'autospec' with create=True")
 *             spec_set = bool(spec_set)
 *             if autospec is True:             # <<<<<<<<<<<<<<
 *                 autospec = original
 * 
 */
    __pyx_t_6 = (__pyx_v_autospec == Py_True);
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (__pyx_t_4) {

      /* "cymock.pyx":1502
 *             spec_set = bool(spec_set)
 *             if autospec is True:
 *                 autospec = original             # <<<<<<<<<<<<<<
 * 
 *             new = create_autospec(autospec, spec_set=spec_set,
 */
      __Pyx_INCREF(__pyx_v_original);
      __Pyx_DECREF_SET(__pyx_v_autospec, __pyx_v_original);

      /* "cymock.pyx":1501
 *                 raise TypeError("Can't use 'autospec' with create=True")
 *             spec_set = bool(spec_set)
 *             if autospec is True:             # <<<<<<<<<<<<<<
 *                 autospec = original
 * 
 */
    }

    /* "cymock.pyx":1504
 *                 autospec = original
 * 
 *             new = create_autospec(autospec, spec_set=spec_set,             # <<<<<<<<<<<<<<
 *                                   _name=self.attribute, **kwargs)
 *         elif kwargs:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_create_autospec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_autospec);
    __Pyx_GIVEREF(__pyx_v_autospec);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_autospec);
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_spec_set, __pyx_v_spec_set) < 0) __PYX_ERR(0, 1504, __pyx_L1_error)

    /* "cymock.pyx":1505
 * 
 *             new = create_autospec(autospec, spec_set=spec_set,
 *                                   _name=self.attribute, **kwargs)             # <<<<<<<<<<<<<<
 *         elif kwargs:
 *             # can't set keyword args when we aren't creating the mock
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_name_3, __pyx_t_9) < 0) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(0, 1505, __pyx_L1_error)
    }
    if (__Pyx_MergeKeywords(__pyx_t_3, __pyx_v_kwargs) < 0) __PYX_ERR(0, 1505, __pyx_L1_error)

    /* "cymock.pyx":1504
 *                 autospec = original
 * 
 *             new = create_autospec(autospec, spec_set=spec_set,             # <<<<<<<<<<<<<<
 *                                   _name=self.attribute, **kwargs)
 *         elif kwargs:
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_new, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cymock.pyx":1489
 *                 new.return_value = Klass(_new_parent=new, _new_name='()',
 *                                          **_kwargs)
 *         elif autospec is not None:             # <<<<<<<<<<<<<<
 *             # spec is ignored, new *must* be default, spec_set is treated
 *             # as a boolean. Should we check spec is not None and that spec_set
 */
    goto __pyx_L17;
  }

  /* "cymock.pyx":1506
 *             new = create_autospec(autospec, spec_set=spec_set,
 *                                   _name=self.attribute, **kwargs)
 *         elif kwargs:             # <<<<<<<<<<<<<<
 *             # can't set keyword args when we aren't creating the mock
 *             # XXXX If new is a Mock we could call new.configure_mock(**kwargs)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1506, __pyx_L1_error)
  if (unlikely(__pyx_t_4)) {

    /* "cymock.pyx":1509
 *             # can't set keyword args when we aren't creating the mock
 *             # XXXX If new is a Mock we could call new.configure_mock(**kwargs)
 *             raise TypeError("Can't pass kwargs to a mock we aren't creating")             # <<<<<<<<<<<<<<
 * 
 *         new_attr = new
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 1509, __pyx_L1_error)

    /* "cymock.pyx":1506
 *             new = create_autospec(autospec, spec_set=spec_set,
 *                                   _name=self.attribute, **kwargs)
 *         elif kwargs:             # <<<<<<<<<<<<<<
 *             # can't set keyword args when we aren't creating the mock
 *             # XXXX If new is a Mock we could call new.configure_mock(**kwargs)
 */
  }
  __pyx_L17:;

  /* "cymock.pyx":1511
 *             raise TypeError("Can't pass kwargs to a mock we aren't creating")
 * 
 *         new_attr = new             # <<<<<<<<<<<<<<
 * 
 *         self.temp_original = original
 */
  __Pyx_INCREF(__pyx_v_new);
  __pyx_v_new_attr = __pyx_v_new;

  /* "cymock.pyx":1513
 *         new_attr = new
 * 
 *         self.temp_original = original             # <<<<<<<<<<<<<<
 *         self.is_local = local
 *         setattr(self.target, self.attribute, new_attr)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_temp_original, __pyx_v_original) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)

  /* "cymock.pyx":1514
 * 
 *         self.temp_original = original
 *         self.is_local = local             # <<<<<<<<<<<<<<
 *         setattr(self.target, self.attribute, new_attr)
 *         if self.attribute_name is not None:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_local, __pyx_v_local) < 0) __PYX_ERR(0, 1514, __pyx_L1_error)

  /* "cymock.pyx":1515
 *         self.temp_original = original
 *         self.is_local = local
 *         setattr(self.target, self.attribute, new_attr)             # <<<<<<<<<<<<<<
 *         if self.attribute_name is not None:
 *             extra_args = {}
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = PyObject_SetAttr(__pyx_t_7, __pyx_t_3, __pyx_v_new_attr); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1516
 *         self.is_local = local
 *         setattr(self.target, self.attribute, new_attr)
 *         if self.attribute_name is not None:             # <<<<<<<<<<<<<<
 *             extra_args = {}
 *             if self.new is DEFAULT:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (__pyx_t_6) {

    /* "cymock.pyx":1517
 *         setattr(self.target, self.attribute, new_attr)
 *         if self.attribute_name is not None:
 *             extra_args = {}             # <<<<<<<<<<<<<<
 *             if self.new is DEFAULT:
 *                 extra_args[self.attribute_name] =  new
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_extra_args = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":1518
 *         if self.attribute_name is not None:
 *             extra_args = {}
 *             if self.new is DEFAULT:             # <<<<<<<<<<<<<<
 *                 extra_args[self.attribute_name] =  new
 *             for patching in self.additional_patchers:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_new_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = (__pyx_t_3 == __pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (__pyx_t_4) {

      /* "cymock.pyx":1519
 *             extra_args = {}
 *             if self.new is DEFAULT:
 *                 extra_args[self.attribute_name] =  new             # <<<<<<<<<<<<<<
 *             for patching in self.additional_patchers:
 *                 arg = patching.__enter__()
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(PyDict_SetItem(__pyx_v_extra_args, __pyx_t_7, __pyx_v_new) < 0)) __PYX_ERR(0, 1519, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cymock.pyx":1518
 *         if self.attribute_name is not None:
 *             extra_args = {}
 *             if self.new is DEFAULT:             # <<<<<<<<<<<<<<
 *                 extra_args[self.attribute_name] =  new
 *             for patching in self.additional_patchers:
 */
    }

    /* "cymock.pyx":1520
 *             if self.new is DEFAULT:
 *                 extra_args[self.attribute_name] =  new
 *             for patching in self.additional_patchers:             # <<<<<<<<<<<<<<
 *                 arg = patching.__enter__()
 *                 if patching.new is DEFAULT:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_additional_patchers); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1520, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1520, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1520, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1520, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1520, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_12(__pyx_t_3);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1520, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_patching, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cymock.pyx":1521
 *                 extra_args[self.attribute_name] =  new
 *             for patching in self.additional_patchers:
 *                 arg = patching.__enter__()             # <<<<<<<<<<<<<<
 *                 if patching.new is DEFAULT:
 *                     extra_args.update(arg)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_patching, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cymock.pyx":1522
 *             for patching in self.additional_patchers:
 *                 arg = patching.__enter__()
 *                 if patching.new is DEFAULT:             # <<<<<<<<<<<<<<
 *                     extra_args.update(arg)
 *             return extra_args
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_patching, __pyx_n_s_new_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (__pyx_t_7 == __pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = (__pyx_t_4 != 0);
      if (__pyx_t_6) {

        /* "cymock.pyx":1523
 *                 arg = patching.__enter__()
 *                 if patching.new is DEFAULT:
 *                     extra_args.update(arg)             # <<<<<<<<<<<<<<
 *             return extra_args
 * 
 */
        __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_extra_args, __pyx_v_arg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "cymock.pyx":1522
 *             for patching in self.additional_patchers:
 *                 arg = patching.__enter__()
 *                 if patching.new is DEFAULT:             # <<<<<<<<<<<<<<
 *                     extra_args.update(arg)
 *             return extra_args
 */
      }

      /* "cymock.pyx":1520
 *             if self.new is DEFAULT:
 *                 extra_args[self.attribute_name] =  new
 *             for patching in self.additional_patchers:             # <<<<<<<<<<<<<<
 *                 arg = patching.__enter__()
 *                 if patching.new is DEFAULT:
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":1524
 *                 if patching.new is DEFAULT:
 *                     extra_args.update(arg)
 *             return extra_args             # <<<<<<<<<<<<<<
 * 
 *         return new
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_extra_args);
    __pyx_r = __pyx_v_extra_args;
    goto __pyx_L0;

    /* "cymock.pyx":1516
 *         self.is_local = local
 *         setattr(self.target, self.attribute, new_attr)
 *         if self.attribute_name is not None:             # <<<<<<<<<<<<<<
 *             extra_args = {}
 *             if self.new is DEFAULT:
 */
  }

  /* "cymock.pyx":1526
 *             return extra_args
 * 
 *         return new             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_new);
  __pyx_r = __pyx_v_new;
  goto __pyx_L0;

  /* "cymock.pyx":1399
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Perform the patch."""
 *         new, spec, spec_set = self.new, self.spec, self.spec_set
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cymock._patch.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_XDECREF(__pyx_v_spec_set);
  __Pyx_XDECREF(__pyx_v_autospec);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_new_callable);
  __Pyx_XDECREF(__pyx_v_original);
  __Pyx_XDECREF(__pyx_v_local);
  __Pyx_XDECREF(__pyx_v_Klass);
  __Pyx_XDECREF(__pyx_v__kwargs);
  __Pyx_XDECREF(__pyx_v_this_spec);
  __Pyx_XDECREF(__pyx_v_not_callable);
  __Pyx_XDECREF(__pyx_v_new_attr);
  __Pyx_XDECREF(__pyx_v_extra_args);
  __Pyx_XDECREF(__pyx_v_patching);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1529
 * 
 * 
 *     def __exit__(self, *exc_info):             # <<<<<<<<<<<<<<
 *         """Undo the patch."""
 *         if not _is_started(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_20__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_6_patch_19__exit__[] = "Undo the patch.";
static PyMethodDef __pyx_mdef_6cymock_6_patch_20__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_6_patch_20__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_6_patch_19__exit__};
static PyObject *__pyx_pw_6cymock_6_patch_20__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_exc_info = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_exc_info = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_exc_info)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_exc_info);
  } else {
    __pyx_v_exc_info = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__exit__") < 0)) __PYX_ERR(0, 1529, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1529, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_exc_info); __pyx_v_exc_info = 0;
  __Pyx_AddTraceback("cymock._patch.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_6_patch_19__exit__(__pyx_self, __pyx_v_self, __pyx_v_exc_info);

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

static PyObject *__pyx_pf_6cymock_6_patch_19__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exc_info) {
  PyObject *__pyx_v_patcher = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "cymock.pyx":1531
 *     def __exit__(self, *exc_info):
 *         """Undo the patch."""
 *         if not _is_started(self):             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_started); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":1532
 *         """Undo the patch."""
 *         if not _is_started(self):
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if self.is_local and self.temp_original is not DEFAULT:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cymock.pyx":1531
 *     def __exit__(self, *exc_info):
 *         """Undo the patch."""
 *         if not _is_started(self):             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "cymock.pyx":1534
 *             return
 * 
 *         if self.is_local and self.temp_original is not DEFAULT:             # <<<<<<<<<<<<<<
 *             setattr(self.target, self.attribute, self.temp_original)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_local); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_temp_original); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __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_6 = (__pyx_t_4 != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cymock.pyx":1535
 * 
 *         if self.is_local and self.temp_original is not DEFAULT:
 *             setattr(self.target, self.attribute, self.temp_original)             # <<<<<<<<<<<<<<
 *         else:
 *             delattr(self.target, self.attribute)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_temp_original); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyObject_SetAttr(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":1534
 *             return
 * 
 *         if self.is_local and self.temp_original is not DEFAULT:             # <<<<<<<<<<<<<<
 *             setattr(self.target, self.attribute, self.temp_original)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "cymock.pyx":1537
 *             setattr(self.target, self.attribute, self.temp_original)
 *         else:
 *             delattr(self.target, self.attribute)             # <<<<<<<<<<<<<<
 *             if not self.create and (not hasattr(self.target, self.attribute) or
 *                         self.attribute in ('__doc__', '__module__',
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyObject_DelAttr(__pyx_t_3, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1537, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":1538
 *         else:
 *             delattr(self.target, self.attribute)
 *             if not self.create and (not hasattr(self.target, self.attribute) or             # <<<<<<<<<<<<<<
 *                         self.attribute in ('__doc__', '__module__',
 *                                            '__defaults__', '__annotations__',
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = ((!__pyx_t_6) != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_5 = __pyx_t_4;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_HasAttr(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((!(__pyx_t_4 != 0)) != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L8_bool_binop_done;
    }

    /* "cymock.pyx":1539
 *             delattr(self.target, self.attribute)
 *             if not self.create and (not hasattr(self.target, self.attribute) or
 *                         self.attribute in ('__doc__', '__module__',             # <<<<<<<<<<<<<<
 *                                            '__defaults__', '__annotations__',
 *                                            '__kwdefaults__')):
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_doc, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1539, __pyx_L1_error)
    if (!__pyx_t_4) {
    } else {
      __pyx_t_6 = __pyx_t_4;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_module, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1539, __pyx_L1_error)
    if (!__pyx_t_4) {
    } else {
      __pyx_t_6 = __pyx_t_4;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_defaults, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1539, __pyx_L1_error)
    if (!__pyx_t_4) {
    } else {
      __pyx_t_6 = __pyx_t_4;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_annotations, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1539, __pyx_L1_error)
    if (!__pyx_t_4) {
    } else {
      __pyx_t_6 = __pyx_t_4;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_kwdefaults, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1539, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_4;
    __pyx_L11_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (__pyx_t_6 != 0);
    __pyx_t_5 = __pyx_t_4;
    __pyx_L8_bool_binop_done:;

    /* "cymock.pyx":1538
 *         else:
 *             delattr(self.target, self.attribute)
 *             if not self.create and (not hasattr(self.target, self.attribute) or             # <<<<<<<<<<<<<<
 *                         self.attribute in ('__doc__', '__module__',
 *                                            '__defaults__', '__annotations__',
 */
    if (__pyx_t_5) {

      /* "cymock.pyx":1543
 *                                            '__kwdefaults__')):
 *                 # needed for proxy objects like django settings
 *                 setattr(self.target, self.attribute, self.temp_original)             # <<<<<<<<<<<<<<
 * 
 *         del self.temp_original
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_target); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_attribute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_temp_original); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyObject_SetAttr(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1543, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cymock.pyx":1538
 *         else:
 *             delattr(self.target, self.attribute)
 *             if not self.create and (not hasattr(self.target, self.attribute) or             # <<<<<<<<<<<<<<
 *                         self.attribute in ('__doc__', '__module__',
 *                                            '__defaults__', '__annotations__',
 */
    }
  }
  __pyx_L4:;

  /* "cymock.pyx":1545
 *                 setattr(self.target, self.attribute, self.temp_original)
 * 
 *         del self.temp_original             # <<<<<<<<<<<<<<
 *         del self.is_local
 *         del self.target
 */
  if (__Pyx_PyObject_DelAttrStr(__pyx_v_self, __pyx_n_s_temp_original) < 0) __PYX_ERR(0, 1545, __pyx_L1_error)

  /* "cymock.pyx":1546
 * 
 *         del self.temp_original
 *         del self.is_local             # <<<<<<<<<<<<<<
 *         del self.target
 *         for patcher in reversed(self.additional_patchers):
 */
  if (__Pyx_PyObject_DelAttrStr(__pyx_v_self, __pyx_n_s_is_local) < 0) __PYX_ERR(0, 1546, __pyx_L1_error)

  /* "cymock.pyx":1547
 *         del self.temp_original
 *         del self.is_local
 *         del self.target             # <<<<<<<<<<<<<<
 *         for patcher in reversed(self.additional_patchers):
 *             if _is_started(patcher):
 */
  if (__Pyx_PyObject_DelAttrStr(__pyx_v_self, __pyx_n_s_target) < 0) __PYX_ERR(0, 1547, __pyx_L1_error)

  /* "cymock.pyx":1548
 *         del self.is_local
 *         del self.target
 *         for patcher in reversed(self.additional_patchers):             # <<<<<<<<<<<<<<
 *             if _is_started(patcher):
 *                 patcher.__exit__(*exc_info)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_additional_patchers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1548, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1548, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1548, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_9(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1548, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_patcher, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":1549
 *         del self.target
 *         for patcher in reversed(self.additional_patchers):
 *             if _is_started(patcher):             # <<<<<<<<<<<<<<
 *                 patcher.__exit__(*exc_info)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_is_started); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_v_patcher) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_patcher);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1549, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_5) {

      /* "cymock.pyx":1550
 *         for patcher in reversed(self.additional_patchers):
 *             if _is_started(patcher):
 *                 patcher.__exit__(*exc_info)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_patcher, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_exc_info, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cymock.pyx":1549
 *         del self.target
 *         for patcher in reversed(self.additional_patchers):
 *             if _is_started(patcher):             # <<<<<<<<<<<<<<
 *                 patcher.__exit__(*exc_info)
 * 
 */
    }

    /* "cymock.pyx":1548
 *         del self.is_local
 *         del self.target
 *         for patcher in reversed(self.additional_patchers):             # <<<<<<<<<<<<<<
 *             if _is_started(patcher):
 *                 patcher.__exit__(*exc_info)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1529
 * 
 * 
 *     def __exit__(self, *exc_info):             # <<<<<<<<<<<<<<
 *         """Undo the patch."""
 *         if not _is_started(self):
 */

  /* 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_10);
  __Pyx_AddTraceback("cymock._patch.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_patcher);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1553
 * 
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         """Activate a patch, returning any created mock."""
 *         result = self.__enter__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_22start(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_6_patch_21start[] = "Activate a patch, returning any created mock.";
static PyMethodDef __pyx_mdef_6cymock_6_patch_22start = {"start", (PyCFunction)__pyx_pw_6cymock_6_patch_22start, METH_O, __pyx_doc_6cymock_6_patch_21start};
static PyObject *__pyx_pw_6cymock_6_patch_22start(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_6_patch_21start(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_6_patch_21start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("start", 0);

  /* "cymock.pyx":1555
 *     def start(self):
 *         """Activate a patch, returning any created mock."""
 *         result = self.__enter__()             # <<<<<<<<<<<<<<
 *         self._active_patches.append(self)
 *         return result
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1556
 *         """Activate a patch, returning any created mock."""
 *         result = self.__enter__()
 *         self._active_patches.append(self)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_active_patches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_self); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1557
 *         result = self.__enter__()
 *         self._active_patches.append(self)
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cymock.pyx":1553
 * 
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         """Activate a patch, returning any created mock."""
 *         result = self.__enter__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._patch.start", __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;
}

/* "cymock.pyx":1560
 * 
 * 
 *     def stop(self):             # <<<<<<<<<<<<<<
 *         """Stop an active patch."""
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_6_patch_24stop(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_6_patch_23stop[] = "Stop an active patch.";
static PyMethodDef __pyx_mdef_6cymock_6_patch_24stop = {"stop", (PyCFunction)__pyx_pw_6cymock_6_patch_24stop, METH_O, __pyx_doc_6cymock_6_patch_23stop};
static PyObject *__pyx_pw_6cymock_6_patch_24stop(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_6_patch_23stop(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_6_patch_23stop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("stop", 0);

  /* "cymock.pyx":1562
 *     def stop(self):
 *         """Stop an active patch."""
 *         try:             # <<<<<<<<<<<<<<
 *             self._active_patches.remove(self)
 *         except ValueError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "cymock.pyx":1563
 *         """Stop an active patch."""
 *         try:
 *             self._active_patches.remove(self)             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             # If the patch hasn't been started this will fail
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_active_patches); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1563, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_remove); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1563, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_self) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_self);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1563, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cymock.pyx":1562
 *     def stop(self):
 *         """Stop an active patch."""
 *         try:             # <<<<<<<<<<<<<<
 *             self._active_patches.remove(self)
 *         except ValueError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cymock.pyx":1564
 *         try:
 *             self._active_patches.remove(self)
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             # If the patch hasn't been started this will fail
 *             pass
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_7) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cymock.pyx":1562
 *     def stop(self):
 *         """Stop an active patch."""
 *         try:             # <<<<<<<<<<<<<<
 *             self._active_patches.remove(self)
 *         except ValueError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "cymock.pyx":1568
 *             pass
 * 
 *         return self.__exit__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1560
 * 
 * 
 *     def stop(self):             # <<<<<<<<<<<<<<
 *         """Stop an active patch."""
 *         try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock._patch.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1572
 * 
 * 
 * def _get_target(target):             # <<<<<<<<<<<<<<
 *     try:
 *         target, attribute = target.rsplit('.', 1)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_43_get_target(PyObject *__pyx_self, PyObject *__pyx_v_target); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_43_get_target = {"_get_target", (PyCFunction)__pyx_pw_6cymock_43_get_target, METH_O, 0};
static PyObject *__pyx_pw_6cymock_43_get_target(PyObject *__pyx_self, PyObject *__pyx_v_target) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_target (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_42_get_target(__pyx_self, ((PyObject *)__pyx_v_target));

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

/* "cymock.pyx":1578
 *         raise TypeError("Need a valid target to patch. You supplied: %r" %
 *                         (target,))
 *     getter = lambda: _importer(target)             # <<<<<<<<<<<<<<
 *     return getter, attribute
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_get_target_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_get_target_lambda4 = {"lambda4", (PyCFunction)__pyx_pw_6cymock_11_get_target_lambda4, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_11_get_target_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda4", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_importer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_target)) { __Pyx_RaiseClosureNameError("target"); __PYX_ERR(0, 1578, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_target) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_target);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1578, __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._get_target.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1572
 * 
 * 
 * def _get_target(target):             # <<<<<<<<<<<<<<
 *     try:
 *         target, attribute = target.rsplit('.', 1)
 */

static PyObject *__pyx_pf_6cymock_42_get_target(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target) {
  struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *__pyx_cur_scope;
  PyObject *__pyx_v_attribute = NULL;
  PyObject *__pyx_v_getter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("_get_target", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *)__pyx_tp_new_6cymock___pyx_scope_struct_13__get_target(__pyx_ptype_6cymock___pyx_scope_struct_13__get_target, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1572, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_target = __pyx_v_target;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_target);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_target);

  /* "cymock.pyx":1573
 * 
 * def _get_target(target):
 *     try:             # <<<<<<<<<<<<<<
 *         target, attribute = target.rsplit('.', 1)
 *     except (TypeError, ValueError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "cymock.pyx":1574
 * def _get_target(target):
 *     try:
 *         target, attribute = target.rsplit('.', 1)             # <<<<<<<<<<<<<<
 *     except (TypeError, ValueError):
 *         raise TypeError("Need a valid target to patch. You supplied: %r" %
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_target, __pyx_n_s_rsplit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1574, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1574, __pyx_L3_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1574, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1574, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1574, __pyx_L3_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L10_unpacking_done;
        __pyx_L9_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1574, __pyx_L3_error)
        __pyx_L10_unpacking_done:;
      }
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_target);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_target, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_v_attribute = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "cymock.pyx":1573
 * 
 * def _get_target(target):
 *     try:             # <<<<<<<<<<<<<<
 *         target, attribute = target.rsplit('.', 1)
 *     except (TypeError, ValueError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cymock.pyx":1575
 *     try:
 *         target, attribute = target.rsplit('.', 1)
 *     except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *         raise TypeError("Need a valid target to patch. You supplied: %r" %
 *                         (target,))
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cymock._get_target", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 1575, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_4);

      /* "cymock.pyx":1577
 *     except (TypeError, ValueError):
 *         raise TypeError("Need a valid target to patch. You supplied: %r" %
 *                         (target,))             # <<<<<<<<<<<<<<
 *     getter = lambda: _importer(target)
 *     return getter, attribute
 */
      __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_cur_scope->__pyx_v_target), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1577, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "cymock.pyx":1576
 *         target, attribute = target.rsplit('.', 1)
 *     except (TypeError, ValueError):
 *         raise TypeError("Need a valid target to patch. You supplied: %r" %             # <<<<<<<<<<<<<<
 *                         (target,))
 *     getter = lambda: _importer(target)
 */
      __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Need_a_valid_target_to_patch_You, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1576, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1576, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(0, 1576, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cymock.pyx":1573
 * 
 * def _get_target(target):
 *     try:             # <<<<<<<<<<<<<<
 *         target, attribute = target.rsplit('.', 1)
 *     except (TypeError, ValueError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "cymock.pyx":1578
 *         raise TypeError("Need a valid target to patch. You supplied: %r" %
 *                         (target,))
 *     getter = lambda: _importer(target)             # <<<<<<<<<<<<<<
 *     return getter, attribute
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_get_target_lambda4, 0, __pyx_n_s_get_target_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_getter = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":1579
 *                         (target,))
 *     getter = lambda: _importer(target)
 *     return getter, attribute             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_getter);
  __Pyx_GIVEREF(__pyx_v_getter);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_getter);
  __Pyx_INCREF(__pyx_v_attribute);
  __Pyx_GIVEREF(__pyx_v_attribute);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_attribute);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1572
 * 
 * 
 * def _get_target(target):             # <<<<<<<<<<<<<<
 *     try:
 *         target, attribute = target.rsplit('.', 1)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cymock._get_target", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attribute);
  __Pyx_XDECREF(__pyx_v_getter);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1582
 * 
 * 
 * def _patch_object(             # <<<<<<<<<<<<<<
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_45_patch_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_44_patch_object[] = "\n    patch the named member (`attribute`) on an object (`target`) with a mock\n    object.\n\n    `patch.object` can be used as a decorator, class decorator or a context\n    manager. Arguments `new`, `spec`, `create`, `spec_set`,\n    `autospec` and `new_callable` have the same meaning as for `patch`. Like\n    `patch`, `patch.object` takes arbitrary keyword arguments for configuring\n    the mock object it creates.\n\n    When used as a class decorator `patch.object` honours `patch.TEST_PREFIX`\n    for choosing which methods to wrap.\n    ";
static PyMethodDef __pyx_mdef_6cymock_45_patch_object = {"_patch_object", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_45_patch_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_44_patch_object};
static PyObject *__pyx_pw_6cymock_45_patch_object(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_target = 0;
  PyObject *__pyx_v_attribute = 0;
  PyObject *__pyx_v_new = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_create = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v_autospec = 0;
  PyObject *__pyx_v_new_callable = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_patch_object (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target,&__pyx_n_s_attribute,&__pyx_n_s_new_2,&__pyx_n_s_spec,&__pyx_n_s_create,&__pyx_n_s_spec_set,&__pyx_n_s_autospec,&__pyx_n_s_new_callable,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[2] = __pyx_k__60;

    /* "cymock.pyx":1583
 * 
 * def _patch_object(
 *         target, attribute, new=DEFAULT, spec=None,             # <<<<<<<<<<<<<<
 *         create=False, spec_set=None, autospec=None,
 *         new_callable=None, **kwargs
 */
    values[3] = ((PyObject *)Py_None);

    /* "cymock.pyx":1584
 * def _patch_object(
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,             # <<<<<<<<<<<<<<
 *         new_callable=None, **kwargs
 *     ):
 */
    values[4] = ((PyObject *)Py_False);
    values[5] = ((PyObject *)Py_None);
    values[6] = ((PyObject *)Py_None);

    /* "cymock.pyx":1585
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,
 *         new_callable=None, **kwargs             # <<<<<<<<<<<<<<
 *     ):
 *     """
 */
    values[7] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attribute)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_patch_object", 0, 2, 8, 1); __PYX_ERR(0, 1582, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_autospec);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_callable);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_patch_object") < 0)) __PYX_ERR(0, 1582, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target = values[0];
    __pyx_v_attribute = values[1];
    __pyx_v_new = values[2];
    __pyx_v_spec = values[3];
    __pyx_v_create = values[4];
    __pyx_v_spec_set = values[5];
    __pyx_v_autospec = values[6];
    __pyx_v_new_callable = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_patch_object", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1582, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock._patch_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_44_patch_object(__pyx_self, __pyx_v_target, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_v_kwargs);

  /* "cymock.pyx":1582
 * 
 * 
 * def _patch_object(             # <<<<<<<<<<<<<<
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,
 */

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

/* "cymock.pyx":1604
 *             f"{target!r} must be the actual object to be patched, not a str"
 *         )
 *     getter = lambda: target             # <<<<<<<<<<<<<<
 *     return _patch(
 *         getter, attribute, new, spec, create,
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_13_patch_object_lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_13_patch_object_lambda5 = {"lambda5", (PyCFunction)__pyx_pw_6cymock_13_patch_object_lambda5, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_13_patch_object_lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda5", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_target)) { __Pyx_RaiseClosureNameError("target"); __PYX_ERR(0, 1604, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_target);
  __pyx_r = __pyx_cur_scope->__pyx_v_target;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock._patch_object.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1582
 * 
 * 
 * def _patch_object(             # <<<<<<<<<<<<<<
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,
 */

static PyObject *__pyx_pf_6cymock_44_patch_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target, PyObject *__pyx_v_attribute, PyObject *__pyx_v_new, PyObject *__pyx_v_spec, PyObject *__pyx_v_create, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_autospec, PyObject *__pyx_v_new_callable, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *__pyx_cur_scope;
  PyObject *__pyx_v_getter = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_patch_object", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *)__pyx_tp_new_6cymock___pyx_scope_struct_14__patch_object(__pyx_ptype_6cymock___pyx_scope_struct_14__patch_object, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1582, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_target = __pyx_v_target;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_target);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_target);

  /* "cymock.pyx":1600
 *     for choosing which methods to wrap.
 *     """
 *     if type(target) is str:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f"{target!r} must be the actual object to be patched, not a str"
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_target)) == ((PyObject *)(&PyUnicode_Type)));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "cymock.pyx":1602
 *     if type(target) is str:
 *         raise TypeError(
 *             f"{target!r} must be the actual object to be patched, not a str"             # <<<<<<<<<<<<<<
 *         )
 *     getter = lambda: target
 */
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_cur_scope->__pyx_v_target), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_3, __pyx_kp_u_must_be_the_actual_object_to_be); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":1601
 *     """
 *     if type(target) is str:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f"{target!r} must be the actual object to be patched, not a str"
 *         )
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1601, __pyx_L1_error)

    /* "cymock.pyx":1600
 *     for choosing which methods to wrap.
 *     """
 *     if type(target) is str:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f"{target!r} must be the actual object to be patched, not a str"
 */
  }

  /* "cymock.pyx":1604
 *             f"{target!r} must be the actual object to be patched, not a str"
 *         )
 *     getter = lambda: target             # <<<<<<<<<<<<<<
 *     return _patch(
 *         getter, attribute, new, spec, create,
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_13_patch_object_lambda5, 0, __pyx_n_s_patch_object_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_getter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":1605
 *         )
 *     getter = lambda: target
 *     return _patch(             # <<<<<<<<<<<<<<
 *         getter, attribute, new, spec, create,
 *         spec_set, autospec, new_callable, kwargs
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_patch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "cymock.pyx":1607
 *     return _patch(
 *         getter, attribute, new, spec, create,
 *         spec_set, autospec, new_callable, kwargs             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[10] = {__pyx_t_5, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_v_kwargs};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 9+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[10] = {__pyx_t_5, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_v_kwargs};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 9+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(9+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_getter);
    __Pyx_GIVEREF(__pyx_v_getter);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_getter);
    __Pyx_INCREF(__pyx_v_attribute);
    __Pyx_GIVEREF(__pyx_v_attribute);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_attribute);
    __Pyx_INCREF(__pyx_v_new);
    __Pyx_GIVEREF(__pyx_v_new);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_new);
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_create);
    __Pyx_GIVEREF(__pyx_v_create);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_create);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_7, 5+__pyx_t_6, __pyx_v_spec_set);
    __Pyx_INCREF(__pyx_v_autospec);
    __Pyx_GIVEREF(__pyx_v_autospec);
    PyTuple_SET_ITEM(__pyx_t_7, 6+__pyx_t_6, __pyx_v_autospec);
    __Pyx_INCREF(__pyx_v_new_callable);
    __Pyx_GIVEREF(__pyx_v_new_callable);
    PyTuple_SET_ITEM(__pyx_t_7, 7+__pyx_t_6, __pyx_v_new_callable);
    __Pyx_INCREF(__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_7, 8+__pyx_t_6, __pyx_v_kwargs);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1582
 * 
 * 
 * def _patch_object(             # <<<<<<<<<<<<<<
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._patch_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_getter);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1611
 * 
 * 
 * def _patch_multiple(target, spec=None, create=False, spec_set=None,             # <<<<<<<<<<<<<<
 *                     autospec=None, new_callable=None, **kwargs):
 *     """Perform multiple patches in a single call. It takes the object to be
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_47_patch_multiple(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_46_patch_multiple[] = "Perform multiple patches in a single call. It takes the object to be\n    patched (either as an object or a string to fetch the object by importing)\n    and keyword arguments for the patches::\n\n        with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):\n            ...\n\n    Use `DEFAULT` as the value if you want `patch.multiple` to create\n    mocks for you. In this case the created mocks are passed into a decorated\n    function by keyword, and a dictionary is returned when `patch.multiple` is\n    used as a context manager.\n\n    `patch.multiple` can be used as a decorator, class decorator or a context\n    manager. The arguments `spec`, `spec_set`, `create`,\n    `autospec` and `new_callable` have the same meaning as for `patch`. These\n    arguments will be applied to *all* patches done by `patch.multiple`.\n\n    When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX`\n    for choosing which methods to wrap.\n    ";
static PyMethodDef __pyx_mdef_6cymock_47_patch_multiple = {"_patch_multiple", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_47_patch_multiple, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_46_patch_multiple};
static PyObject *__pyx_pw_6cymock_47_patch_multiple(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_target = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_create = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v_autospec = 0;
  PyObject *__pyx_v_new_callable = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_patch_multiple (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target,&__pyx_n_s_spec,&__pyx_n_s_create,&__pyx_n_s_spec_set,&__pyx_n_s_autospec,&__pyx_n_s_new_callable,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);
    values[3] = ((PyObject *)Py_None);

    /* "cymock.pyx":1612
 * 
 * def _patch_multiple(target, spec=None, create=False, spec_set=None,
 *                     autospec=None, new_callable=None, **kwargs):             # <<<<<<<<<<<<<<
 *     """Perform multiple patches in a single call. It takes the object to be
 *     patched (either as an object or a string to fetch the object by importing)
 */
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_autospec);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_callable);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_patch_multiple") < 0)) __PYX_ERR(0, 1611, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_target = values[0];
    __pyx_v_spec = values[1];
    __pyx_v_create = values[2];
    __pyx_v_spec_set = values[3];
    __pyx_v_autospec = values[4];
    __pyx_v_new_callable = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_patch_multiple", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1611, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock._patch_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_46_patch_multiple(__pyx_self, __pyx_v_target, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_v_kwargs);

  /* "cymock.pyx":1611
 * 
 * 
 * def _patch_multiple(target, spec=None, create=False, spec_set=None,             # <<<<<<<<<<<<<<
 *                     autospec=None, new_callable=None, **kwargs):
 *     """Perform multiple patches in a single call. It takes the object to be
 */

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

/* "cymock.pyx":1634
 *     """
 *     if type(target) is str:
 *         getter = lambda: _importer(target)             # <<<<<<<<<<<<<<
 *     else:
 *         getter = lambda: target
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15_patch_multiple_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15_patch_multiple_lambda6 = {"lambda6", (PyCFunction)__pyx_pw_6cymock_15_patch_multiple_lambda6, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_15_patch_multiple_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda6", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_importer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_target)) { __Pyx_RaiseClosureNameError("target"); __PYX_ERR(0, 1634, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_target) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_target);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1634, __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;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._patch_multiple.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1636
 *         getter = lambda: _importer(target)
 *     else:
 *         getter = lambda: target             # <<<<<<<<<<<<<<
 * 
 *     if not kwargs:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15_patch_multiple_1lambda7(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15_patch_multiple_1lambda7 = {"lambda7", (PyCFunction)__pyx_pw_6cymock_15_patch_multiple_1lambda7, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_15_patch_multiple_1lambda7(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self);

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

static PyObject *__pyx_lambda_funcdef_lambda7(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda7", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_target)) { __Pyx_RaiseClosureNameError("target"); __PYX_ERR(0, 1636, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_target);
  __pyx_r = __pyx_cur_scope->__pyx_v_target;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock._patch_multiple.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1611
 * 
 * 
 * def _patch_multiple(target, spec=None, create=False, spec_set=None,             # <<<<<<<<<<<<<<
 *                     autospec=None, new_callable=None, **kwargs):
 *     """Perform multiple patches in a single call. It takes the object to be
 */

static PyObject *__pyx_pf_6cymock_46_patch_multiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_target, PyObject *__pyx_v_spec, PyObject *__pyx_v_create, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_autospec, PyObject *__pyx_v_new_callable, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *__pyx_cur_scope;
  PyObject *__pyx_v_getter = NULL;
  PyObject *__pyx_v_items = NULL;
  PyObject *__pyx_v_attribute = NULL;
  PyObject *__pyx_v_new = NULL;
  PyObject *__pyx_v_patcher = NULL;
  PyObject *__pyx_v_this_patcher = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("_patch_multiple", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *)__pyx_tp_new_6cymock___pyx_scope_struct_15__patch_multiple(__pyx_ptype_6cymock___pyx_scope_struct_15__patch_multiple, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1611, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_target = __pyx_v_target;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_target);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_target);

  /* "cymock.pyx":1633
 *     for choosing which methods to wrap.
 *     """
 *     if type(target) is str:             # <<<<<<<<<<<<<<
 *         getter = lambda: _importer(target)
 *     else:
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_target)) == ((PyObject *)(&PyUnicode_Type)));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":1634
 *     """
 *     if type(target) is str:
 *         getter = lambda: _importer(target)             # <<<<<<<<<<<<<<
 *     else:
 *         getter = lambda: target
 */
    __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15_patch_multiple_lambda6, 0, __pyx_n_s_patch_multiple_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_getter = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cymock.pyx":1633
 *     for choosing which methods to wrap.
 *     """
 *     if type(target) is str:             # <<<<<<<<<<<<<<
 *         getter = lambda: _importer(target)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":1636
 *         getter = lambda: _importer(target)
 *     else:
 *         getter = lambda: target             # <<<<<<<<<<<<<<
 * 
 *     if not kwargs:
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15_patch_multiple_1lambda7, 0, __pyx_n_s_patch_multiple_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_getter = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cymock.pyx":1638
 *         getter = lambda: target
 * 
 *     if not kwargs:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'Must supply at least one keyword argument with patch.multiple'
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __pyx_t_1 = ((!__pyx_t_2) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "cymock.pyx":1639
 * 
 *     if not kwargs:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             'Must supply at least one keyword argument with patch.multiple'
 *         )
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1639, __pyx_L1_error)

    /* "cymock.pyx":1638
 *         getter = lambda: target
 * 
 *     if not kwargs:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'Must supply at least one keyword argument with patch.multiple'
 */
  }

  /* "cymock.pyx":1643
 *         )
 *     # need to wrap in a list for python 3, where items is a view
 *     items = list(kwargs.items())             # <<<<<<<<<<<<<<
 *     attribute, new = items[0]
 *     patcher = _patch(
 */
  __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_items = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cymock.pyx":1644
 *     # need to wrap in a list for python 3, where items is a view
 *     items = list(kwargs.items())
 *     attribute, new = items[0]             # <<<<<<<<<<<<<<
 *     patcher = _patch(
 *         getter, attribute, new, spec, create, spec_set,
 */
  __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_items, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1644, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1644, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1644, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_attribute = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_new = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cymock.pyx":1645
 *     items = list(kwargs.items())
 *     attribute, new = items[0]
 *     patcher = _patch(             # <<<<<<<<<<<<<<
 *         getter, attribute, new, spec, create, spec_set,
 *         autospec, new_callable, {}
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_patch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "cymock.pyx":1647
 *     patcher = _patch(
 *         getter, attribute, new, spec, create, spec_set,
 *         autospec, new_callable, {}             # <<<<<<<<<<<<<<
 *     )
 *     patcher.attribute_name = attribute
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[10] = {__pyx_t_6, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_t_3};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 9+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[10] = {__pyx_t_6, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_t_3};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 9+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(9+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_getter);
    __Pyx_GIVEREF(__pyx_v_getter);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_getter);
    __Pyx_INCREF(__pyx_v_attribute);
    __Pyx_GIVEREF(__pyx_v_attribute);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_attribute);
    __Pyx_INCREF(__pyx_v_new);
    __Pyx_GIVEREF(__pyx_v_new);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_v_new);
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_create);
    __Pyx_GIVEREF(__pyx_v_create);
    PyTuple_SET_ITEM(__pyx_t_9, 4+__pyx_t_8, __pyx_v_create);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_9, 5+__pyx_t_8, __pyx_v_spec_set);
    __Pyx_INCREF(__pyx_v_autospec);
    __Pyx_GIVEREF(__pyx_v_autospec);
    PyTuple_SET_ITEM(__pyx_t_9, 6+__pyx_t_8, __pyx_v_autospec);
    __Pyx_INCREF(__pyx_v_new_callable);
    __Pyx_GIVEREF(__pyx_v_new_callable);
    PyTuple_SET_ITEM(__pyx_t_9, 7+__pyx_t_8, __pyx_v_new_callable);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_9, 8+__pyx_t_8, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_patcher = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":1649
 *         autospec, new_callable, {}
 *     )
 *     patcher.attribute_name = attribute             # <<<<<<<<<<<<<<
 *     for attribute, new in items[1:]:
 *         this_patcher = _patch(
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_patcher, __pyx_n_s_attribute_name, __pyx_v_attribute) < 0) __PYX_ERR(0, 1649, __pyx_L1_error)

  /* "cymock.pyx":1650
 *     )
 *     patcher.attribute_name = attribute
 *     for attribute, new in items[1:]:             # <<<<<<<<<<<<<<
 *         this_patcher = _patch(
 *             getter, attribute, new, spec, create, spec_set,
 */
  __pyx_t_4 = __Pyx_PyList_GetSlice(__pyx_v_items, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1650, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1650, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_9 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1650, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1650, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_attribute, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_DECREF_SET(__pyx_v_new, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":1651
 *     patcher.attribute_name = attribute
 *     for attribute, new in items[1:]:
 *         this_patcher = _patch(             # <<<<<<<<<<<<<<
 *             getter, attribute, new, spec, create, spec_set,
 *             autospec, new_callable, {}
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_patch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cymock.pyx":1653
 *         this_patcher = _patch(
 *             getter, attribute, new, spec, create, spec_set,
 *             autospec, new_callable, {}             # <<<<<<<<<<<<<<
 *         )
 *         this_patcher.attribute_name = attribute
 */
    __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[10] = {__pyx_t_6, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 9+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[10] = {__pyx_t_6, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 9+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(9+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_getter);
      __Pyx_GIVEREF(__pyx_v_getter);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_v_getter);
      __Pyx_INCREF(__pyx_v_attribute);
      __Pyx_GIVEREF(__pyx_v_attribute);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_v_attribute);
      __Pyx_INCREF(__pyx_v_new);
      __Pyx_GIVEREF(__pyx_v_new);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_8, __pyx_v_new);
      __Pyx_INCREF(__pyx_v_spec);
      __Pyx_GIVEREF(__pyx_v_spec);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_8, __pyx_v_spec);
      __Pyx_INCREF(__pyx_v_create);
      __Pyx_GIVEREF(__pyx_v_create);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_8, __pyx_v_create);
      __Pyx_INCREF(__pyx_v_spec_set);
      __Pyx_GIVEREF(__pyx_v_spec_set);
      PyTuple_SET_ITEM(__pyx_t_11, 5+__pyx_t_8, __pyx_v_spec_set);
      __Pyx_INCREF(__pyx_v_autospec);
      __Pyx_GIVEREF(__pyx_v_autospec);
      PyTuple_SET_ITEM(__pyx_t_11, 6+__pyx_t_8, __pyx_v_autospec);
      __Pyx_INCREF(__pyx_v_new_callable);
      __Pyx_GIVEREF(__pyx_v_new_callable);
      PyTuple_SET_ITEM(__pyx_t_11, 7+__pyx_t_8, __pyx_v_new_callable);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_11, 8+__pyx_t_8, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_this_patcher, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":1655
 *             autospec, new_callable, {}
 *         )
 *         this_patcher.attribute_name = attribute             # <<<<<<<<<<<<<<
 *         patcher.additional_patchers.append(this_patcher)
 *     return patcher
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_this_patcher, __pyx_n_s_attribute_name, __pyx_v_attribute) < 0) __PYX_ERR(0, 1655, __pyx_L1_error)

    /* "cymock.pyx":1656
 *         )
 *         this_patcher.attribute_name = attribute
 *         patcher.additional_patchers.append(this_patcher)             # <<<<<<<<<<<<<<
 *     return patcher
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_patcher, __pyx_n_s_additional_patchers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_this_patcher); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1656, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cymock.pyx":1650
 *     )
 *     patcher.attribute_name = attribute
 *     for attribute, new in items[1:]:             # <<<<<<<<<<<<<<
 *         this_patcher = _patch(
 *             getter, attribute, new, spec, create, spec_set,
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cymock.pyx":1657
 *         this_patcher.attribute_name = attribute
 *         patcher.additional_patchers.append(this_patcher)
 *     return patcher             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_patcher);
  __pyx_r = __pyx_v_patcher;
  goto __pyx_L0;

  /* "cymock.pyx":1611
 * 
 * 
 * def _patch_multiple(target, spec=None, create=False, spec_set=None,             # <<<<<<<<<<<<<<
 *                     autospec=None, new_callable=None, **kwargs):
 *     """Perform multiple patches in a single call. It takes the object to be
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cymock._patch_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_getter);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XDECREF(__pyx_v_attribute);
  __Pyx_XDECREF(__pyx_v_new);
  __Pyx_XDECREF(__pyx_v_patcher);
  __Pyx_XDECREF(__pyx_v_this_patcher);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1662
 * class patch:
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         target,
 */

static PyObject *__pyx_pf_6cymock_88__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);

  /* "cymock.pyx":1670
 *         spec_set=None,
 *         autospec=None,
 *         new_callable=None,             # <<<<<<<<<<<<<<
 *         **kwargs,
 *     ):
 */
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_new);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_new);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_new);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_None));

  /* "cymock.pyx":1662
 * class patch:
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         target,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5patch_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_5patch___new__[] = "\n        `patch` acts as a function decorator, class decorator or a context\n        manager. Inside the body of the function or with statement, the `target`\n        is patched with a `new` object. When the function/with statement exits\n        the patch is undone.\n\n        If `new` is omitted, then the target is replaced with an\n        `AsyncMock if the patched object is an async function or a\n        `MagicMock` otherwise. If `patch` is used as a decorator and `new` is\n        omitted, the created mock is passed in as an extra argument to the\n        decorated function. If `patch` is used as a context manager the created\n        mock is returned by the context manager.\n\n        `target` should be a string in the form `'package.module.ClassName'`. The\n        `target` is imported and the specified object replaced with the `new`\n        object, so the `target` must be importable from the environment you are\n        calling `patch` from. The target is imported when the decorated function\n        is executed, not at decoration time.\n\n        The `spec` and `spec_set` keyword arguments are passed to the `MagicMock`\n        if patch is creating one for you.\n\n        In addition you can pass `spec=True` or `spec_set=True`, which causes\n        patch to pass in the object being mocked as the spec/spec_set object.\n\n        `new_callable` allows you to specify a different class, or callable object,\n        that will be called to create the `new` object. By default `AsyncMock` is\n        used for async functions and `MagicMock` for the rest.\n\n        A more powerful form of `spec` is `autospec`. If you set `autospec=True`\n        then the mock will be created with a spec from the object being replaced.\n        All attributes of the mock will also have the spec of the corresponding\n        attribute of the object being replaced. Methods and functions being\n        mocked will have their arguments checked and will raise a `TypeError` if\n      ""  they are called with the wrong signature. For mocks replacing a class,\n        their return value (the 'instance') will have the same spec as the class.\n\n        Instead of `autospec=True` you can pass `autospec=some_object` to use an\n        arbitrary object as the spec instead of the one being replaced.\n\n        By default `patch` will fail to replace attributes that don't exist. If\n        you pass in `create=True`, and the attribute doesn't exist, patch will\n        create the attribute for you when the patched function is called, and\n        delete it again afterwards. This is useful for writing tests against\n        attributes that your production code creates at runtime. It is off by\n        default because it can be dangerous. With it switched on you can write\n        passing tests against APIs that don't actually exist!\n\n        Patch can be used as a `TestCase` class decorator. It works by\n        decorating each test method in the class. This reduces the boilerplate\n        code when your test methods share a common patchings set. `patch` finds\n        tests by looking for method names that start with `patch.TEST_PREFIX`.\n        By default this is `test`, which matches the way `unittest` finds tests.\n        You can specify an alternative prefix by setting `patch.TEST_PREFIX`.\n\n        Patch can be used as a context manager, with the with statement. Here the\n        patching applies to the indented block after the with statement. If you\n        use \"as\" then the patched object will be bound to the name after the\n        \"as\"; very useful if `patch` is creating a mock object for you.\n\n        `patch` takes arbitrary keyword arguments. These will be passed to\n        the `Mock` (or `new_callable`) on construction.\n\n        `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are\n        available for alternate use-cases.\n        ";
static PyMethodDef __pyx_mdef_6cymock_5patch_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5patch_1__new__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_5patch___new__};
static PyObject *__pyx_pw_6cymock_5patch_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_target = 0;
  PyObject *__pyx_v_new = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_create = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v_autospec = 0;
  PyObject *__pyx_v_new_callable = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_target,&__pyx_n_s_new_2,&__pyx_n_s_spec,&__pyx_n_s_create,&__pyx_n_s_spec_set,&__pyx_n_s_autospec,&__pyx_n_s_new_callable,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_new;
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_None));
    values[7] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 8, 1); __PYX_ERR(0, 1662, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_autospec);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_callable);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 1662, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_target = values[1];
    __pyx_v_new = values[2];
    __pyx_v_spec = values[3];
    __pyx_v_create = values[4];
    __pyx_v_spec_set = values[5];
    __pyx_v_autospec = values[6];
    __pyx_v_new_callable = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1662, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.patch.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5patch___new__(__pyx_self, __pyx_v_cls, __pyx_v_target, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_5patch___new__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, PyObject *__pyx_v_target, PyObject *__pyx_v_new, PyObject *__pyx_v_spec, PyObject *__pyx_v_create, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_autospec, PyObject *__pyx_v_new_callable, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_getter = NULL;
  PyObject *__pyx_v_attribute = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__new__", 0);

  /* "cymock.pyx":1739
 *         available for alternate use-cases.
 *         """
 *         getter, attribute = _get_target(target)             # <<<<<<<<<<<<<<
 *         return _patch(
 *             getter, attribute, new, spec, create,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_target); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_target) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_target);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1739, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1739, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1739, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_getter = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_attribute = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":1740
 *         """
 *         getter, attribute = _get_target(target)
 *         return _patch(             # <<<<<<<<<<<<<<
 *             getter, attribute, new, spec, create,
 *             spec_set, autospec, new_callable, kwargs
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_patch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":1742
 *         return _patch(
 *             getter, attribute, new, spec, create,
 *             spec_set, autospec, new_callable, kwargs             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[10] = {__pyx_t_2, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 9+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1740, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[10] = {__pyx_t_2, __pyx_v_getter, __pyx_v_attribute, __pyx_v_new, __pyx_v_spec, __pyx_v_create, __pyx_v_spec_set, __pyx_v_autospec, __pyx_v_new_callable, __pyx_v_kwargs};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 9+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1740, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(9+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_getter);
    __Pyx_GIVEREF(__pyx_v_getter);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_getter);
    __Pyx_INCREF(__pyx_v_attribute);
    __Pyx_GIVEREF(__pyx_v_attribute);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_attribute);
    __Pyx_INCREF(__pyx_v_new);
    __Pyx_GIVEREF(__pyx_v_new);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, __pyx_v_new);
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_6, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_create);
    __Pyx_GIVEREF(__pyx_v_create);
    PyTuple_SET_ITEM(__pyx_t_4, 4+__pyx_t_6, __pyx_v_create);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_4, 5+__pyx_t_6, __pyx_v_spec_set);
    __Pyx_INCREF(__pyx_v_autospec);
    __Pyx_GIVEREF(__pyx_v_autospec);
    PyTuple_SET_ITEM(__pyx_t_4, 6+__pyx_t_6, __pyx_v_autospec);
    __Pyx_INCREF(__pyx_v_new_callable);
    __Pyx_GIVEREF(__pyx_v_new_callable);
    PyTuple_SET_ITEM(__pyx_t_4, 7+__pyx_t_6, __pyx_v_new_callable);
    __Pyx_INCREF(__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_4, 8+__pyx_t_6, __pyx_v_kwargs);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1662
 * class patch:
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         target,
 */

  /* 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("cymock.patch.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_getter);
  __Pyx_XDECREF(__pyx_v_attribute);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1775
 *     """
 * 
 *     def __init__(self, in_dict, values=(), clear=False, **kwargs):             # <<<<<<<<<<<<<<
 *         self.in_dict = in_dict
 *         # support any argument supported by dict(...) constructor
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_patch_dict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_patch_dict_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_patch_dict_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_patch_dict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_in_dict = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_clear = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_in_dict,&__pyx_n_s_values,&__pyx_n_s_clear,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_in_dict)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1775, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clear);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1775, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_in_dict = values[1];
    __pyx_v_values = values[2];
    __pyx_v_clear = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1775, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock._patch_dict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_11_patch_dict___init__(__pyx_self, __pyx_v_self, __pyx_v_in_dict, __pyx_v_values, __pyx_v_clear, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_11_patch_dict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_in_dict, PyObject *__pyx_v_values, PyObject *__pyx_v_clear, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":1776
 * 
 *     def __init__(self, in_dict, values=(), clear=False, **kwargs):
 *         self.in_dict = in_dict             # <<<<<<<<<<<<<<
 *         # support any argument supported by dict(...) constructor
 *         self.values = dict(values)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_in_dict, __pyx_v_in_dict) < 0) __PYX_ERR(0, 1776, __pyx_L1_error)

  /* "cymock.pyx":1778
 *         self.in_dict = in_dict
 *         # support any argument supported by dict(...) constructor
 *         self.values = dict(values)             # <<<<<<<<<<<<<<
 *         self.values.update(kwargs)
 *         self.clear = clear
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_values, __pyx_t_1) < 0) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1779
 *         # support any argument supported by dict(...) constructor
 *         self.values = dict(values)
 *         self.values.update(kwargs)             # <<<<<<<<<<<<<<
 *         self.clear = clear
 *         self._original = None
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_kwargs) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1780
 *         self.values = dict(values)
 *         self.values.update(kwargs)
 *         self.clear = clear             # <<<<<<<<<<<<<<
 *         self._original = None
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_clear, __pyx_v_clear) < 0) __PYX_ERR(0, 1780, __pyx_L1_error)

  /* "cymock.pyx":1781
 *         self.values.update(kwargs)
 *         self.clear = clear
 *         self._original = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_original_2, Py_None) < 0) __PYX_ERR(0, 1781, __pyx_L1_error)

  /* "cymock.pyx":1775
 *     """
 * 
 *     def __init__(self, in_dict, values=(), clear=False, **kwargs):             # <<<<<<<<<<<<<<
 *         self.in_dict = in_dict
 *         # support any argument supported by dict(...) constructor
 */

  /* 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_AddTraceback("cymock._patch_dict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1784
 * 
 * 
 *     def __call__(self, f):             # <<<<<<<<<<<<<<
 *         if isinstance(f, type):
 *             return self.decorate_class(f)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_patch_dict_3__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_patch_dict_3__call__ = {"__call__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_patch_dict_3__call__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_patch_dict_3__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_f,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 1784, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1784, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_f = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1784, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._patch_dict.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_11_patch_dict_2__call__(__pyx_self, __pyx_v_self, __pyx_v_f);

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

/* "cymock.pyx":1788
 *             return self.decorate_class(f)
 *         @wraps(f)
 *         def _inner(*args, **kw):             # <<<<<<<<<<<<<<
 *             self._patch_dict()
 *             try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_patch_dict_8__call___1_inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_patch_dict_8__call___1_inner = {"_inner", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_patch_dict_8__call___1_inner, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_patch_dict_8__call___1_inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_inner (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_inner", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kw = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kw)) return NULL;
    __Pyx_GOTREF(__pyx_v_kw);
  } else {
    __pyx_v_kw = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_11_patch_dict_8__call____inner(__pyx_self, __pyx_v_args, __pyx_v_kw);

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

static PyObject *__pyx_pf_6cymock_11_patch_dict_8__call____inner(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
  struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("_inner", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":1789
 *         @wraps(f)
 *         def _inner(*args, **kw):
 *             self._patch_dict()             # <<<<<<<<<<<<<<
 *             try:
 *                 return f(*args, **kw)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1789, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_patch_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __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;

  /* "cymock.pyx":1790
 *         def _inner(*args, **kw):
 *             self._patch_dict()
 *             try:             # <<<<<<<<<<<<<<
 *                 return f(*args, **kw)
 *             finally:
 */
  /*try:*/ {

    /* "cymock.pyx":1791
 *             self._patch_dict()
 *             try:
 *                 return f(*args, **kw)             # <<<<<<<<<<<<<<
 *             finally:
 *                 self._unpatch_dict()
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); __PYX_ERR(0, 1791, __pyx_L4_error) }
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_f, __pyx_v_args, __pyx_v_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3_return;
  }

  /* "cymock.pyx":1793
 *                 return f(*args, **kw)
 *             finally:
 *                 self._unpatch_dict()             # <<<<<<<<<<<<<<
 * 
 *         return _inner
 */
  /*finally:*/ {
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
      {
        if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1793, __pyx_L7_error) }
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_unpatch_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1793, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L3_return: {
      __pyx_t_12 = __pyx_r;
      __pyx_r = 0;
      if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1793, __pyx_L1_error) }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_unpatch_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1793, __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_r = __pyx_t_12;
      __pyx_t_12 = 0;
      goto __pyx_L0;
    }
  }

  /* "cymock.pyx":1788
 *             return self.decorate_class(f)
 *         @wraps(f)
 *         def _inner(*args, **kw):             # <<<<<<<<<<<<<<
 *             self._patch_dict()
 *             try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._patch_dict.__call__._inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1784
 * 
 * 
 *     def __call__(self, f):             # <<<<<<<<<<<<<<
 *         if isinstance(f, type):
 *             return self.decorate_class(f)
 */

static PyObject *__pyx_pf_6cymock_11_patch_dict_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_f) {
  struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *__pyx_cur_scope;
  PyObject *__pyx_v__inner = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__call__", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *)__pyx_tp_new_6cymock___pyx_scope_struct_16___call__(__pyx_ptype_6cymock___pyx_scope_struct_16___call__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1784, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);

  /* "cymock.pyx":1785
 * 
 *     def __call__(self, f):
 *         if isinstance(f, type):             # <<<<<<<<<<<<<<
 *             return self.decorate_class(f)
 *         @wraps(f)
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_f;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyType_Check(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1786
 *     def __call__(self, f):
 *         if isinstance(f, type):
 *             return self.decorate_class(f)             # <<<<<<<<<<<<<<
 *         @wraps(f)
 *         def _inner(*args, **kw):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_decorate_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_cur_scope->__pyx_v_f) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_f);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":1785
 * 
 *     def __call__(self, f):
 *         if isinstance(f, type):             # <<<<<<<<<<<<<<
 *             return self.decorate_class(f)
 *         @wraps(f)
 */
  }

  /* "cymock.pyx":1787
 *         if isinstance(f, type):
 *             return self.decorate_class(f)
 *         @wraps(f)             # <<<<<<<<<<<<<<
 *         def _inner(*args, **kw):
 *             self._patch_dict()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_wraps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_f) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_f);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cymock.pyx":1788
 *             return self.decorate_class(f)
 *         @wraps(f)
 *         def _inner(*args, **kw):             # <<<<<<<<<<<<<<
 *             self._patch_dict()
 *             try:
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_patch_dict_8__call___1_inner, 0, __pyx_n_s_patch_dict___call___locals__inn, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v__inner = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1795
 *                 self._unpatch_dict()
 * 
 *         return _inner             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v__inner);
  __pyx_r = __pyx_v__inner;
  goto __pyx_L0;

  /* "cymock.pyx":1784
 * 
 * 
 *     def __call__(self, f):             # <<<<<<<<<<<<<<
 *         if isinstance(f, type):
 *             return self.decorate_class(f)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock._patch_dict.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__inner);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1798
 * 
 * 
 *     def decorate_class(self, klass):             # <<<<<<<<<<<<<<
 *         for attr in dir(klass):
 *             attr_value = getattr(klass, attr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_patch_dict_5decorate_class(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_patch_dict_5decorate_class = {"decorate_class", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_patch_dict_5decorate_class, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_patch_dict_5decorate_class(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_klass = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorate_class (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_klass,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_klass)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("decorate_class", 1, 2, 2, 1); __PYX_ERR(0, 1798, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decorate_class") < 0)) __PYX_ERR(0, 1798, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_klass = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decorate_class", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1798, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._patch_dict.decorate_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_11_patch_dict_4decorate_class(__pyx_self, __pyx_v_self, __pyx_v_klass);

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

static PyObject *__pyx_pf_6cymock_11_patch_dict_4decorate_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_klass) {
  PyObject *__pyx_v_attr = NULL;
  PyObject *__pyx_v_attr_value = NULL;
  PyObject *__pyx_v_decorator = NULL;
  PyObject *__pyx_v_decorated = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("decorate_class", 0);

  /* "cymock.pyx":1799
 * 
 *     def decorate_class(self, klass):
 *         for attr in dir(klass):             # <<<<<<<<<<<<<<
 *             attr_value = getattr(klass, attr)
 *             if (attr.startswith(patch.TEST_PREFIX) and
 */
  __pyx_t_1 = PyObject_Dir(__pyx_v_klass); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1799, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1799, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1799, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1799, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":1800
 *     def decorate_class(self, klass):
 *         for attr in dir(klass):
 *             attr_value = getattr(klass, attr)             # <<<<<<<<<<<<<<
 *             if (attr.startswith(patch.TEST_PREFIX) and
 *                  hasattr(attr_value, "__call__")):
 */
    __pyx_t_1 = __Pyx_GetAttr(__pyx_v_klass, __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_attr_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":1801
 *         for attr in dir(klass):
 *             attr_value = getattr(klass, attr)
 *             if (attr.startswith(patch.TEST_PREFIX) and             # <<<<<<<<<<<<<<
 *                  hasattr(attr_value, "__call__")):
 *                 decorator = _patch_dict(self.in_dict, self.values, self.clear)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_attr, __pyx_n_s_startswith); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_patch_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_TEST_PREFIX); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1801, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_9) {
    } else {
      __pyx_t_5 = __pyx_t_9;
      goto __pyx_L6_bool_binop_done;
    }

    /* "cymock.pyx":1802
 *             attr_value = getattr(klass, attr)
 *             if (attr.startswith(patch.TEST_PREFIX) and
 *                  hasattr(attr_value, "__call__")):             # <<<<<<<<<<<<<<
 *                 decorator = _patch_dict(self.in_dict, self.values, self.clear)
 *                 decorated = decorator(attr_value)
 */
    __pyx_t_9 = __Pyx_HasAttr(__pyx_v_attr_value, __pyx_n_u_call); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1802, __pyx_L1_error)
    __pyx_t_10 = (__pyx_t_9 != 0);
    __pyx_t_5 = __pyx_t_10;
    __pyx_L6_bool_binop_done:;

    /* "cymock.pyx":1801
 *         for attr in dir(klass):
 *             attr_value = getattr(klass, attr)
 *             if (attr.startswith(patch.TEST_PREFIX) and             # <<<<<<<<<<<<<<
 *                  hasattr(attr_value, "__call__")):
 *                 decorator = _patch_dict(self.in_dict, self.values, self.clear)
 */
    if (__pyx_t_5) {

      /* "cymock.pyx":1803
 *             if (attr.startswith(patch.TEST_PREFIX) and
 *                  hasattr(attr_value, "__call__")):
 *                 decorator = _patch_dict(self.in_dict, self.values, self.clear)             # <<<<<<<<<<<<<<
 *                 decorated = decorator(attr_value)
 *                 setattr(klass, attr, decorated)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_patch_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_in_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clear); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = NULL;
      __pyx_t_13 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_13 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_8, __pyx_t_7, __pyx_t_11};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1803, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_t_8, __pyx_t_7, __pyx_t_11};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 3+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1803, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      } else
      #endif
      {
        __pyx_t_14 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1803, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (__pyx_t_12) {
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_13, __pyx_t_11);
        __pyx_t_8 = 0;
        __pyx_t_7 = 0;
        __pyx_t_11 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1803, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_decorator, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cymock.pyx":1804
 *                  hasattr(attr_value, "__call__")):
 *                 decorator = _patch_dict(self.in_dict, self.values, self.clear)
 *                 decorated = decorator(attr_value)             # <<<<<<<<<<<<<<
 *                 setattr(klass, attr, decorated)
 *         return klass
 */
      __Pyx_INCREF(__pyx_v_decorator);
      __pyx_t_6 = __pyx_v_decorator; __pyx_t_14 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_1 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_v_attr_value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_attr_value);
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_decorated, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cymock.pyx":1805
 *                 decorator = _patch_dict(self.in_dict, self.values, self.clear)
 *                 decorated = decorator(attr_value)
 *                 setattr(klass, attr, decorated)             # <<<<<<<<<<<<<<
 *         return klass
 * 
 */
      __pyx_t_15 = PyObject_SetAttr(__pyx_v_klass, __pyx_v_attr, __pyx_v_decorated); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1805, __pyx_L1_error)

      /* "cymock.pyx":1801
 *         for attr in dir(klass):
 *             attr_value = getattr(klass, attr)
 *             if (attr.startswith(patch.TEST_PREFIX) and             # <<<<<<<<<<<<<<
 *                  hasattr(attr_value, "__call__")):
 *                 decorator = _patch_dict(self.in_dict, self.values, self.clear)
 */
    }

    /* "cymock.pyx":1799
 * 
 *     def decorate_class(self, klass):
 *         for attr in dir(klass):             # <<<<<<<<<<<<<<
 *             attr_value = getattr(klass, attr)
 *             if (attr.startswith(patch.TEST_PREFIX) and
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1806
 *                 decorated = decorator(attr_value)
 *                 setattr(klass, attr, decorated)
 *         return klass             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_klass);
  __pyx_r = __pyx_v_klass;
  goto __pyx_L0;

  /* "cymock.pyx":1798
 * 
 * 
 *     def decorate_class(self, klass):             # <<<<<<<<<<<<<<
 *         for attr in dir(klass):
 *             attr_value = getattr(klass, attr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cymock._patch_dict.decorate_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attr);
  __Pyx_XDECREF(__pyx_v_attr_value);
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_XDECREF(__pyx_v_decorated);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1809
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Patch the dict."""
 *         self._patch_dict()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_patch_dict_7__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_11_patch_dict_6__enter__[] = "Patch the dict.";
static PyMethodDef __pyx_mdef_6cymock_11_patch_dict_7__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6cymock_11_patch_dict_7__enter__, METH_O, __pyx_doc_6cymock_11_patch_dict_6__enter__};
static PyObject *__pyx_pw_6cymock_11_patch_dict_7__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_11_patch_dict_6__enter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_11_patch_dict_6__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "cymock.pyx":1811
 *     def __enter__(self):
 *         """Patch the dict."""
 *         self._patch_dict()             # <<<<<<<<<<<<<<
 *         return self.in_dict
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_patch_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1811, __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;

  /* "cymock.pyx":1812
 *         """Patch the dict."""
 *         self._patch_dict()
 *         return self.in_dict             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_in_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1809
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Patch the dict."""
 *         self._patch_dict()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._patch_dict.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1815
 * 
 * 
 *     def _patch_dict(self):             # <<<<<<<<<<<<<<
 *         values = self.values
 *         if isinstance(self.in_dict, str):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_patch_dict_9_patch_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_patch_dict_9_patch_dict = {"_patch_dict", (PyCFunction)__pyx_pw_6cymock_11_patch_dict_9_patch_dict, METH_O, 0};
static PyObject *__pyx_pw_6cymock_11_patch_dict_9_patch_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_patch_dict (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_11_patch_dict_8_patch_dict(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_11_patch_dict_8_patch_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_in_dict = NULL;
  PyObject *__pyx_v_clear = NULL;
  PyObject *__pyx_v_original = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("_patch_dict", 0);

  /* "cymock.pyx":1816
 * 
 *     def _patch_dict(self):
 *         values = self.values             # <<<<<<<<<<<<<<
 *         if isinstance(self.in_dict, str):
 *             self.in_dict = _importer(self.in_dict)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_values = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1817
 *     def _patch_dict(self):
 *         values = self.values
 *         if isinstance(self.in_dict, str):             # <<<<<<<<<<<<<<
 *             self.in_dict = _importer(self.in_dict)
 *         in_dict = self.in_dict
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_in_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyUnicode_Check(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1818
 *         values = self.values
 *         if isinstance(self.in_dict, str):
 *             self.in_dict = _importer(self.in_dict)             # <<<<<<<<<<<<<<
 *         in_dict = self.in_dict
 *         clear = self.clear
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_importer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_in_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_in_dict, __pyx_t_1) < 0) __PYX_ERR(0, 1818, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":1817
 *     def _patch_dict(self):
 *         values = self.values
 *         if isinstance(self.in_dict, str):             # <<<<<<<<<<<<<<
 *             self.in_dict = _importer(self.in_dict)
 *         in_dict = self.in_dict
 */
  }

  /* "cymock.pyx":1819
 *         if isinstance(self.in_dict, str):
 *             self.in_dict = _importer(self.in_dict)
 *         in_dict = self.in_dict             # <<<<<<<<<<<<<<
 *         clear = self.clear
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_in_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_in_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1820
 *             self.in_dict = _importer(self.in_dict)
 *         in_dict = self.in_dict
 *         clear = self.clear             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_clear = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1822
 *         clear = self.clear
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             original = in_dict.copy()
 *         except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "cymock.pyx":1823
 * 
 *         try:
 *             original = in_dict.copy()             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             # dict like object with no copy method
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_dict, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1823, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1823, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_original = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cymock.pyx":1822
 *         clear = self.clear
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             original = in_dict.copy()
 *         except AttributeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cymock.pyx":1824
 *         try:
 *             original = in_dict.copy()
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             # dict like object with no copy method
 *             # must support iteration over keys
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("cymock._patch_dict._patch_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 1824, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);

      /* "cymock.pyx":1827
 *             # dict like object with no copy method
 *             # must support iteration over keys
 *             original = {}             # <<<<<<<<<<<<<<
 *             for key in in_dict:
 *                 original[key] = in_dict[key]
 */
      __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1827, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_original, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cymock.pyx":1828
 *             # must support iteration over keys
 *             original = {}
 *             for key in in_dict:             # <<<<<<<<<<<<<<
 *                 original[key] = in_dict[key]
 *         self._original = original
 */
      if (likely(PyList_CheckExact(__pyx_v_in_dict)) || PyTuple_CheckExact(__pyx_v_in_dict)) {
        __pyx_t_6 = __pyx_v_in_dict; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_in_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1828, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1828, __pyx_L6_except_error)
      }
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_13 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_13); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1828, __pyx_L6_except_error)
            #else
            __pyx_t_13 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1828, __pyx_L6_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
          } else {
            if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_13); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1828, __pyx_L6_except_error)
            #else
            __pyx_t_13 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1828, __pyx_L6_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
          }
        } else {
          __pyx_t_13 = __pyx_t_12(__pyx_t_6);
          if (unlikely(!__pyx_t_13)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1828, __pyx_L6_except_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "cymock.pyx":1829
 *             original = {}
 *             for key in in_dict:
 *                 original[key] = in_dict[key]             # <<<<<<<<<<<<<<
 *         self._original = original
 * 
 */
        __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_in_dict, __pyx_v_key); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1829, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (unlikely(PyObject_SetItem(__pyx_v_original, __pyx_v_key, __pyx_t_13) < 0)) __PYX_ERR(0, 1829, __pyx_L6_except_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "cymock.pyx":1828
 *             # must support iteration over keys
 *             original = {}
 *             for key in in_dict:             # <<<<<<<<<<<<<<
 *                 original[key] = in_dict[key]
 *         self._original = original
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "cymock.pyx":1822
 *         clear = self.clear
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             original = in_dict.copy()
 *         except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    __pyx_L9_try_end:;
  }

  /* "cymock.pyx":1830
 *             for key in in_dict:
 *                 original[key] = in_dict[key]
 *         self._original = original             # <<<<<<<<<<<<<<
 * 
 *         if clear:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_original_2, __pyx_v_original) < 0) __PYX_ERR(0, 1830, __pyx_L1_error)

  /* "cymock.pyx":1832
 *         self._original = original
 * 
 *         if clear:             # <<<<<<<<<<<<<<
 *             _clear_dict(in_dict)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_clear); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1832, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "cymock.pyx":1833
 * 
 *         if clear:
 *             _clear_dict(in_dict)             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_clear_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_in_dict) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_in_dict);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cymock.pyx":1832
 *         self._original = original
 * 
 *         if clear:             # <<<<<<<<<<<<<<
 *             _clear_dict(in_dict)
 * 
 */
  }

  /* "cymock.pyx":1835
 *             _clear_dict(in_dict)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             in_dict.update(values)
 *         except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cymock.pyx":1836
 * 
 *         try:
 *             in_dict.update(values)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             # dict like object with no update method
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_dict, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1836, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_values) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_values);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1836, __pyx_L15_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cymock.pyx":1835
 *             _clear_dict(in_dict)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             in_dict.update(values)
 *         except AttributeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L20_try_end;
    __pyx_L15_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cymock.pyx":1837
 *         try:
 *             in_dict.update(values)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             # dict like object with no update method
 *             for key in values:
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("cymock._patch_dict._patch_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 1837, __pyx_L17_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_1);

      /* "cymock.pyx":1839
 *         except AttributeError:
 *             # dict like object with no update method
 *             for key in values:             # <<<<<<<<<<<<<<
 *                 in_dict[key] = values[key]
 * 
 */
      if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
        __pyx_t_6 = __pyx_v_values; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1839, __pyx_L17_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1839, __pyx_L17_except_error)
      }
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_13 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_13); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1839, __pyx_L17_except_error)
            #else
            __pyx_t_13 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1839, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
          } else {
            if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_13); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1839, __pyx_L17_except_error)
            #else
            __pyx_t_13 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1839, __pyx_L17_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
          }
        } else {
          __pyx_t_13 = __pyx_t_12(__pyx_t_6);
          if (unlikely(!__pyx_t_13)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1839, __pyx_L17_except_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "cymock.pyx":1840
 *             # dict like object with no update method
 *             for key in values:
 *                 in_dict[key] = values[key]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_values, __pyx_v_key); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1840, __pyx_L17_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        if (unlikely(PyObject_SetItem(__pyx_v_in_dict, __pyx_v_key, __pyx_t_13) < 0)) __PYX_ERR(0, 1840, __pyx_L17_except_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "cymock.pyx":1839
 *         except AttributeError:
 *             # dict like object with no update method
 *             for key in values:             # <<<<<<<<<<<<<<
 *                 in_dict[key] = values[key]
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L16_exception_handled;
    }
    goto __pyx_L17_except_error;
    __pyx_L17_except_error:;

    /* "cymock.pyx":1835
 *             _clear_dict(in_dict)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             in_dict.update(values)
 *         except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L16_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_8, __pyx_t_7);
    __pyx_L20_try_end:;
  }

  /* "cymock.pyx":1815
 * 
 * 
 *     def _patch_dict(self):             # <<<<<<<<<<<<<<
 *         values = self.values
 *         if isinstance(self.in_dict, str):
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cymock._patch_dict._patch_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_in_dict);
  __Pyx_XDECREF(__pyx_v_clear);
  __Pyx_XDECREF(__pyx_v_original);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1843
 * 
 * 
 *     def _unpatch_dict(self):             # <<<<<<<<<<<<<<
 *         in_dict = self.in_dict
 *         original = self._original
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_patch_dict_11_unpatch_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_patch_dict_11_unpatch_dict = {"_unpatch_dict", (PyCFunction)__pyx_pw_6cymock_11_patch_dict_11_unpatch_dict, METH_O, 0};
static PyObject *__pyx_pw_6cymock_11_patch_dict_11_unpatch_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_unpatch_dict (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_11_patch_dict_10_unpatch_dict(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_11_patch_dict_10_unpatch_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_in_dict = NULL;
  PyObject *__pyx_v_original = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_unpatch_dict", 0);

  /* "cymock.pyx":1844
 * 
 *     def _unpatch_dict(self):
 *         in_dict = self.in_dict             # <<<<<<<<<<<<<<
 *         original = self._original
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_in_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_in_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1845
 *     def _unpatch_dict(self):
 *         in_dict = self.in_dict
 *         original = self._original             # <<<<<<<<<<<<<<
 * 
 *         _clear_dict(in_dict)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_original_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_original = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1847
 *         original = self._original
 * 
 *         _clear_dict(in_dict)             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_clear_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_in_dict) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_in_dict);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1847, __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;

  /* "cymock.pyx":1849
 *         _clear_dict(in_dict)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             in_dict.update(original)
 *         except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "cymock.pyx":1850
 * 
 *         try:
 *             in_dict.update(original)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             for key in original:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_dict, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1850, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_original) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_original);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1850, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cymock.pyx":1849
 *         _clear_dict(in_dict)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             in_dict.update(original)
 *         except AttributeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":1851
 *         try:
 *             in_dict.update(original)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             for key in original:
 *                 in_dict[key] = original[key]
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("cymock._patch_dict._unpatch_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 1851, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "cymock.pyx":1852
 *             in_dict.update(original)
 *         except AttributeError:
 *             for key in original:             # <<<<<<<<<<<<<<
 *                 in_dict[key] = original[key]
 * 
 */
      if (likely(PyList_CheckExact(__pyx_v_original)) || PyTuple_CheckExact(__pyx_v_original)) {
        __pyx_t_8 = __pyx_v_original; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_original); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1852, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1852, __pyx_L5_except_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1852, __pyx_L5_except_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1852, __pyx_L5_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_11); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1852, __pyx_L5_except_error)
            #else
            __pyx_t_11 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1852, __pyx_L5_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
          }
        } else {
          __pyx_t_11 = __pyx_t_10(__pyx_t_8);
          if (unlikely(!__pyx_t_11)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1852, __pyx_L5_except_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "cymock.pyx":1853
 *         except AttributeError:
 *             for key in original:
 *                 in_dict[key] = original[key]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_original, __pyx_v_key); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1853, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (unlikely(PyObject_SetItem(__pyx_v_in_dict, __pyx_v_key, __pyx_t_11) < 0)) __PYX_ERR(0, 1853, __pyx_L5_except_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "cymock.pyx":1852
 *             in_dict.update(original)
 *         except AttributeError:
 *             for key in original:             # <<<<<<<<<<<<<<
 *                 in_dict[key] = original[key]
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cymock.pyx":1849
 *         _clear_dict(in_dict)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             in_dict.update(original)
 *         except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_L8_try_end:;
  }

  /* "cymock.pyx":1843
 * 
 * 
 *     def _unpatch_dict(self):             # <<<<<<<<<<<<<<
 *         in_dict = self.in_dict
 *         original = self._original
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cymock._patch_dict._unpatch_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_in_dict);
  __Pyx_XDECREF(__pyx_v_original);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1856
 * 
 * 
 *     def __exit__(self, *args):             # <<<<<<<<<<<<<<
 *         """Unpatch the dict."""
 *         self._unpatch_dict()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_patch_dict_13__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_11_patch_dict_12__exit__[] = "Unpatch the dict.";
static PyMethodDef __pyx_mdef_6cymock_11_patch_dict_13__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_patch_dict_13__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_11_patch_dict_12__exit__};
static PyObject *__pyx_pw_6cymock_11_patch_dict_13__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__exit__") < 0)) __PYX_ERR(0, 1856, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1856, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("cymock._patch_dict.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_11_patch_dict_12__exit__(__pyx_self, __pyx_v_self, __pyx_v_args);

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

static PyObject *__pyx_pf_6cymock_11_patch_dict_12__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "cymock.pyx":1858
 *     def __exit__(self, *args):
 *         """Unpatch the dict."""
 *         self._unpatch_dict()             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unpatch_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __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;

  /* "cymock.pyx":1859
 *         """Unpatch the dict."""
 *         self._unpatch_dict()
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     start = __enter__
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "cymock.pyx":1856
 * 
 * 
 *     def __exit__(self, *args):             # <<<<<<<<<<<<<<
 *         """Unpatch the dict."""
 *         self._unpatch_dict()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._patch_dict.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1865
 * 
 * 
 * def _clear_dict(in_dict):             # <<<<<<<<<<<<<<
 *     try:
 *         in_dict.clear()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_49_clear_dict(PyObject *__pyx_self, PyObject *__pyx_v_in_dict); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_49_clear_dict = {"_clear_dict", (PyCFunction)__pyx_pw_6cymock_49_clear_dict, METH_O, 0};
static PyObject *__pyx_pw_6cymock_49_clear_dict(PyObject *__pyx_self, PyObject *__pyx_v_in_dict) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_clear_dict (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_48_clear_dict(__pyx_self, ((PyObject *)__pyx_v_in_dict));

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

static PyObject *__pyx_pf_6cymock_48_clear_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_in_dict) {
  PyObject *__pyx_v_keys = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("_clear_dict", 0);

  /* "cymock.pyx":1866
 * 
 * def _clear_dict(in_dict):
 *     try:             # <<<<<<<<<<<<<<
 *         in_dict.clear()
 *     except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "cymock.pyx":1867
 * def _clear_dict(in_dict):
 *     try:
 *         in_dict.clear()             # <<<<<<<<<<<<<<
 *     except AttributeError:
 *         keys = list(in_dict)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_in_dict, __pyx_n_s_clear); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1867, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1867, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cymock.pyx":1866
 * 
 * def _clear_dict(in_dict):
 *     try:             # <<<<<<<<<<<<<<
 *         in_dict.clear()
 *     except AttributeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cymock.pyx":1868
 *     try:
 *         in_dict.clear()
 *     except AttributeError:             # <<<<<<<<<<<<<<
 *         keys = list(in_dict)
 *         for key in keys:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("cymock._clear_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 1868, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "cymock.pyx":1869
 *         in_dict.clear()
 *     except AttributeError:
 *         keys = list(in_dict)             # <<<<<<<<<<<<<<
 *         for key in keys:
 *             del in_dict[key]
 */
      __pyx_t_8 = PySequence_List(__pyx_v_in_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1869, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_keys = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "cymock.pyx":1870
 *     except AttributeError:
 *         keys = list(in_dict)
 *         for key in keys:             # <<<<<<<<<<<<<<
 *             del in_dict[key]
 * 
 */
      __pyx_t_8 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
      for (;;) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1870, __pyx_L5_except_error)
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1870, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "cymock.pyx":1871
 *         keys = list(in_dict)
 *         for key in keys:
 *             del in_dict[key]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        if (unlikely(PyObject_DelItem(__pyx_v_in_dict, __pyx_v_key) < 0)) __PYX_ERR(0, 1871, __pyx_L5_except_error)

        /* "cymock.pyx":1870
 *     except AttributeError:
 *         keys = list(in_dict)
 *         for key in keys:             # <<<<<<<<<<<<<<
 *             del in_dict[key]
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cymock.pyx":1866
 * 
 * def _clear_dict(in_dict):
 *     try:             # <<<<<<<<<<<<<<
 *         in_dict.clear()
 *     except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "cymock.pyx":1865
 * 
 * 
 * def _clear_dict(in_dict):             # <<<<<<<<<<<<<<
 *     try:
 *         in_dict.clear()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cymock._clear_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keys);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1874
 * 
 * 
 * def _patch_stopall():             # <<<<<<<<<<<<<<
 *     """Stop all active patches. LIFO to unroll nested patches."""
 *     for patch in reversed(_patch._active_patches):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_51_patch_stopall(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6cymock_50_patch_stopall[] = "Stop all active patches. LIFO to unroll nested patches.";
static PyMethodDef __pyx_mdef_6cymock_51_patch_stopall = {"_patch_stopall", (PyCFunction)__pyx_pw_6cymock_51_patch_stopall, METH_NOARGS, __pyx_doc_6cymock_50_patch_stopall};
static PyObject *__pyx_pw_6cymock_51_patch_stopall(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_patch_stopall (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_50_patch_stopall(__pyx_self);

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

static PyObject *__pyx_pf_6cymock_50_patch_stopall(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_patch = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_patch_stopall", 0);

  /* "cymock.pyx":1876
 * def _patch_stopall():
 *     """Stop all active patches. LIFO to unroll nested patches."""
 *     for patch in reversed(_patch._active_patches):             # <<<<<<<<<<<<<<
 *         patch.stop()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_patch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_active_patches); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1876, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1876, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1876, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1876, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_patch, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":1877
 *     """Stop all active patches. LIFO to unroll nested patches."""
 *     for patch in reversed(_patch._active_patches):
 *         patch.stop()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_patch, __pyx_n_s_stop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":1876
 * def _patch_stopall():
 *     """Stop all active patches. LIFO to unroll nested patches."""
 *     for patch in reversed(_patch._active_patches):             # <<<<<<<<<<<<<<
 *         patch.stop()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1874
 * 
 * 
 * def _patch_stopall():             # <<<<<<<<<<<<<<
 *     """Stop all active patches. LIFO to unroll nested patches."""
 *     for patch in reversed(_patch._active_patches):
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock._patch_stopall", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_patch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1921
 * 
 * 
 * def _get_method(name, func):             # <<<<<<<<<<<<<<
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_53_get_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_52_get_method[] = "Turns a callable object (like a mock) into a real function";
static PyMethodDef __pyx_mdef_6cymock_53_get_method = {"_get_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_53_get_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_52_get_method};
static PyObject *__pyx_pw_6cymock_53_get_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_method (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,&__pyx_n_s_func_2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_method", 1, 2, 2, 1); __PYX_ERR(0, 1921, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get_method") < 0)) __PYX_ERR(0, 1921, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_name = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_method", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1921, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._get_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_52_get_method(__pyx_self, __pyx_v_name, __pyx_v_func);

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

/* "cymock.pyx":1923
 * def _get_method(name, func):
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         return func(self, *args, **kw)
 *     method.__name__ = name
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_11_get_method_1method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_11_get_method_1method = {"method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_11_get_method_1method, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_11_get_method_1method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("method (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "method") < 0)) __PYX_ERR(0, 1923, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("method", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1923, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("cymock._get_method.method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_11_get_method_method(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kw);

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

static PyObject *__pyx_pf_6cymock_11_get_method_method(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
  struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("method", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":1924
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):
 *         return func(self, *args, **kw)             # <<<<<<<<<<<<<<
 *     method.__name__ = name
 *     return method
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(0, 1924, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_v_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1924, __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;

  /* "cymock.pyx":1923
 * def _get_method(name, func):
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         return func(self, *args, **kw)
 *     method.__name__ = name
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._get_method.method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1921
 * 
 * 
 * def _get_method(name, func):             # <<<<<<<<<<<<<<
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):
 */

static PyObject *__pyx_pf_6cymock_52_get_method(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_func) {
  struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *__pyx_cur_scope;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_get_method", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *)__pyx_tp_new_6cymock___pyx_scope_struct_19__get_method(__pyx_ptype_6cymock___pyx_scope_struct_19__get_method, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1921, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);

  /* "cymock.pyx":1923
 * def _get_method(name, func):
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         return func(self, *args, **kw)
 *     method.__name__ = name
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_get_method_1method, 0, __pyx_n_s_get_method_locals_method, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_method = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1925
 *     def method(self, *args, **kw):
 *         return func(self, *args, **kw)
 *     method.__name__ = name             # <<<<<<<<<<<<<<
 *     return method
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_method, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 1925, __pyx_L1_error)

  /* "cymock.pyx":1926
 *         return func(self, *args, **kw)
 *     method.__name__ = name
 *     return method             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_method);
  __pyx_r = __pyx_v_method;
  goto __pyx_L0;

  /* "cymock.pyx":1921
 * 
 * 
 * def _get_method(name, func):             # <<<<<<<<<<<<<<
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._get_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1974
 * 
 * 
 * def _get_eq(self):             # <<<<<<<<<<<<<<
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_55_get_eq(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_55_get_eq = {"_get_eq", (PyCFunction)__pyx_pw_6cymock_55_get_eq, METH_O, 0};
static PyObject *__pyx_pw_6cymock_55_get_eq(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_eq (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_54_get_eq(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "cymock.pyx":1975
 * 
 * def _get_eq(self):
 *     def __eq__(other):             # <<<<<<<<<<<<<<
 *         ret_val = self.__eq__._mock_return_value
 *         if ret_val is not DEFAULT:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_7_get_eq_1__eq__(PyObject *__pyx_self, PyObject *__pyx_v_other); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_7_get_eq_1__eq__ = {"__eq__", (PyCFunction)__pyx_pw_6cymock_7_get_eq_1__eq__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_7_get_eq_1__eq__(PyObject *__pyx_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_7_get_eq___eq__(__pyx_self, ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_6cymock_7_get_eq___eq__(PyObject *__pyx_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *__pyx_outer_scope;
  PyObject *__pyx_v_ret_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__eq__", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":1976
 * def _get_eq(self):
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value             # <<<<<<<<<<<<<<
 *         if ret_val is not DEFAULT:
 *             return ret_val
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1976, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_eq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mock_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ret_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":1977
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value
 *         if ret_val is not DEFAULT:             # <<<<<<<<<<<<<<
 *             return ret_val
 *         if self is other:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__pyx_v_ret_val != __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":1978
 *         ret_val = self.__eq__._mock_return_value
 *         if ret_val is not DEFAULT:
 *             return ret_val             # <<<<<<<<<<<<<<
 *         if self is other:
 *             return True
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_ret_val);
    __pyx_r = __pyx_v_ret_val;
    goto __pyx_L0;

    /* "cymock.pyx":1977
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value
 *         if ret_val is not DEFAULT:             # <<<<<<<<<<<<<<
 *             return ret_val
 *         if self is other:
 */
  }

  /* "cymock.pyx":1979
 *         if ret_val is not DEFAULT:
 *             return ret_val
 *         if self is other:             # <<<<<<<<<<<<<<
 *             return True
 *         return NotImplemented
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1979, __pyx_L1_error) }
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_self == __pyx_v_other);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1980
 *             return ret_val
 *         if self is other:
 *             return True             # <<<<<<<<<<<<<<
 *         return NotImplemented
 *     return __eq__
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "cymock.pyx":1979
 *         if ret_val is not DEFAULT:
 *             return ret_val
 *         if self is other:             # <<<<<<<<<<<<<<
 *             return True
 *         return NotImplemented
 */
  }

  /* "cymock.pyx":1981
 *         if self is other:
 *             return True
 *         return NotImplemented             # <<<<<<<<<<<<<<
 *     return __eq__
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplemented);
  __pyx_r = __pyx_builtin_NotImplemented;
  goto __pyx_L0;

  /* "cymock.pyx":1975
 * 
 * def _get_eq(self):
 *     def __eq__(other):             # <<<<<<<<<<<<<<
 *         ret_val = self.__eq__._mock_return_value
 *         if ret_val is not DEFAULT:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._get_eq.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1974
 * 
 * 
 * def _get_eq(self):             # <<<<<<<<<<<<<<
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value
 */

static PyObject *__pyx_pf_6cymock_54_get_eq(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *__pyx_cur_scope;
  PyObject *__pyx_v___eq__ = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_get_eq", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *)__pyx_tp_new_6cymock___pyx_scope_struct_20__get_eq(__pyx_ptype_6cymock___pyx_scope_struct_20__get_eq, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1974, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "cymock.pyx":1975
 * 
 * def _get_eq(self):
 *     def __eq__(other):             # <<<<<<<<<<<<<<
 *         ret_val = self.__eq__._mock_return_value
 *         if ret_val is not DEFAULT:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_7_get_eq_1__eq__, 0, __pyx_n_s_get_eq_locals___eq, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v___eq__ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1982
 *             return True
 *         return NotImplemented
 *     return __eq__             # <<<<<<<<<<<<<<
 * 
 * def _get_ne(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___eq__);
  __pyx_r = __pyx_v___eq__;
  goto __pyx_L0;

  /* "cymock.pyx":1974
 * 
 * 
 * def _get_eq(self):             # <<<<<<<<<<<<<<
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._get_eq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___eq__);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1984
 *     return __eq__
 * 
 * def _get_ne(self):             # <<<<<<<<<<<<<<
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_57_get_ne(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_57_get_ne = {"_get_ne", (PyCFunction)__pyx_pw_6cymock_57_get_ne, METH_O, 0};
static PyObject *__pyx_pw_6cymock_57_get_ne(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_ne (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_56_get_ne(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "cymock.pyx":1985
 * 
 * def _get_ne(self):
 *     def __ne__(other):             # <<<<<<<<<<<<<<
 *         if self.__ne__._mock_return_value is not DEFAULT:
 *             return DEFAULT
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_7_get_ne_1__ne__(PyObject *__pyx_self, PyObject *__pyx_v_other); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_7_get_ne_1__ne__ = {"__ne__", (PyCFunction)__pyx_pw_6cymock_7_get_ne_1__ne__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_7_get_ne_1__ne__(PyObject *__pyx_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_7_get_ne___ne__(__pyx_self, ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_6cymock_7_get_ne___ne__(PyObject *__pyx_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__ne__", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":1986
 * def _get_ne(self):
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:             # <<<<<<<<<<<<<<
 *             return DEFAULT
 *         if self is other:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1986, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_ne); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mock_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1986, __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;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":1987
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:
 *             return DEFAULT             # <<<<<<<<<<<<<<
 *         if self is other:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":1986
 * def _get_ne(self):
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:             # <<<<<<<<<<<<<<
 *             return DEFAULT
 *         if self is other:
 */
  }

  /* "cymock.pyx":1988
 *         if self.__ne__._mock_return_value is not DEFAULT:
 *             return DEFAULT
 *         if self is other:             # <<<<<<<<<<<<<<
 *             return False
 *         return NotImplemented
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1988, __pyx_L1_error) }
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_self == __pyx_v_other);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":1989
 *             return DEFAULT
 *         if self is other:
 *             return False             # <<<<<<<<<<<<<<
 *         return NotImplemented
 *     return __ne__
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cymock.pyx":1988
 *         if self.__ne__._mock_return_value is not DEFAULT:
 *             return DEFAULT
 *         if self is other:             # <<<<<<<<<<<<<<
 *             return False
 *         return NotImplemented
 */
  }

  /* "cymock.pyx":1990
 *         if self is other:
 *             return False
 *         return NotImplemented             # <<<<<<<<<<<<<<
 *     return __ne__
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_builtin_NotImplemented);
  __pyx_r = __pyx_builtin_NotImplemented;
  goto __pyx_L0;

  /* "cymock.pyx":1985
 * 
 * def _get_ne(self):
 *     def __ne__(other):             # <<<<<<<<<<<<<<
 *         if self.__ne__._mock_return_value is not DEFAULT:
 *             return DEFAULT
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._get_ne.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1984
 *     return __eq__
 * 
 * def _get_ne(self):             # <<<<<<<<<<<<<<
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:
 */

static PyObject *__pyx_pf_6cymock_56_get_ne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *__pyx_cur_scope;
  PyObject *__pyx_v___ne__ = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_get_ne", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *)__pyx_tp_new_6cymock___pyx_scope_struct_21__get_ne(__pyx_ptype_6cymock___pyx_scope_struct_21__get_ne, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1984, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "cymock.pyx":1985
 * 
 * def _get_ne(self):
 *     def __ne__(other):             # <<<<<<<<<<<<<<
 *         if self.__ne__._mock_return_value is not DEFAULT:
 *             return DEFAULT
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_7_get_ne_1__ne__, 0, __pyx_n_s_get_ne_locals___ne, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v___ne__ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":1991
 *             return False
 *         return NotImplemented
 *     return __ne__             # <<<<<<<<<<<<<<
 * 
 * def _get_iter(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___ne__);
  __pyx_r = __pyx_v___ne__;
  goto __pyx_L0;

  /* "cymock.pyx":1984
 *     return __eq__
 * 
 * def _get_ne(self):             # <<<<<<<<<<<<<<
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._get_ne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___ne__);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1993
 *     return __ne__
 * 
 * def _get_iter(self):             # <<<<<<<<<<<<<<
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_59_get_iter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_59_get_iter = {"_get_iter", (PyCFunction)__pyx_pw_6cymock_59_get_iter, METH_O, 0};
static PyObject *__pyx_pw_6cymock_59_get_iter(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_iter (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_58_get_iter(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "cymock.pyx":1994
 * 
 * def _get_iter(self):
 *     def __iter__():             # <<<<<<<<<<<<<<
 *         ret_val = self.__iter__._mock_return_value
 *         if ret_val is DEFAULT:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9_get_iter_1__iter__(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9_get_iter_1__iter__ = {"__iter__", (PyCFunction)__pyx_pw_6cymock_9_get_iter_1__iter__, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_9_get_iter_1__iter__(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_9_get_iter___iter__(__pyx_self);

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

static PyObject *__pyx_pf_6cymock_9_get_iter___iter__(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *__pyx_outer_scope;
  PyObject *__pyx_v_ret_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":1995
 * def _get_iter(self):
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value             # <<<<<<<<<<<<<<
 *         if ret_val is DEFAULT:
 *             return iter([])
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1995, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mock_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ret_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":1996
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value
 *         if ret_val is DEFAULT:             # <<<<<<<<<<<<<<
 *             return iter([])
 *         # if ret_val was already an iterator, then calling iter on it should
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__pyx_v_ret_val == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":1997
 *         ret_val = self.__iter__._mock_return_value
 *         if ret_val is DEFAULT:
 *             return iter([])             # <<<<<<<<<<<<<<
 *         # if ret_val was already an iterator, then calling iter on it should
 *         # return the iterator unchanged
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __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;

    /* "cymock.pyx":1996
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value
 *         if ret_val is DEFAULT:             # <<<<<<<<<<<<<<
 *             return iter([])
 *         # if ret_val was already an iterator, then calling iter on it should
 */
  }

  /* "cymock.pyx":2000
 *         # if ret_val was already an iterator, then calling iter on it should
 *         # return the iterator unchanged
 *         return iter(ret_val)             # <<<<<<<<<<<<<<
 *     return __iter__
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(__pyx_v_ret_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":1994
 * 
 * def _get_iter(self):
 *     def __iter__():             # <<<<<<<<<<<<<<
 *         ret_val = self.__iter__._mock_return_value
 *         if ret_val is DEFAULT:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock._get_iter.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":1993
 *     return __ne__
 * 
 * def _get_iter(self):             # <<<<<<<<<<<<<<
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value
 */

static PyObject *__pyx_pf_6cymock_58_get_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *__pyx_cur_scope;
  PyObject *__pyx_v___iter__ = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_get_iter", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *)__pyx_tp_new_6cymock___pyx_scope_struct_22__get_iter(__pyx_ptype_6cymock___pyx_scope_struct_22__get_iter, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1993, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "cymock.pyx":1994
 * 
 * def _get_iter(self):
 *     def __iter__():             # <<<<<<<<<<<<<<
 *         ret_val = self.__iter__._mock_return_value
 *         if ret_val is DEFAULT:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9_get_iter_1__iter__, 0, __pyx_n_s_get_iter_locals___iter, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v___iter__ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2001
 *         # return the iterator unchanged
 *         return iter(ret_val)
 *     return __iter__             # <<<<<<<<<<<<<<
 * 
 * def _get_async_iter(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___iter__);
  __pyx_r = __pyx_v___iter__;
  goto __pyx_L0;

  /* "cymock.pyx":1993
 *     return __ne__
 * 
 * def _get_iter(self):             # <<<<<<<<<<<<<<
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._get_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___iter__);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2003
 *     return __iter__
 * 
 * def _get_async_iter(self):             # <<<<<<<<<<<<<<
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_61_get_async_iter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_61_get_async_iter = {"_get_async_iter", (PyCFunction)__pyx_pw_6cymock_61_get_async_iter, METH_O, 0};
static PyObject *__pyx_pw_6cymock_61_get_async_iter(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_async_iter (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_60_get_async_iter(__pyx_self, ((PyObject *)__pyx_v_self));

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

/* "cymock.pyx":2004
 * 
 * def _get_async_iter(self):
 *     def __aiter__():             # <<<<<<<<<<<<<<
 *         ret_val = self.__aiter__._mock_return_value
 *         if ret_val is DEFAULT:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15_get_async_iter_1__aiter__(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15_get_async_iter_1__aiter__ = {"__aiter__", (PyCFunction)__pyx_pw_6cymock_15_get_async_iter_1__aiter__, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_15_get_async_iter_1__aiter__(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__aiter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_15_get_async_iter___aiter__(__pyx_self);

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

static PyObject *__pyx_pf_6cymock_15_get_async_iter___aiter__(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *__pyx_outer_scope;
  PyObject *__pyx_v_ret_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__aiter__", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":2005
 * def _get_async_iter(self):
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value             # <<<<<<<<<<<<<<
 *         if ret_val is DEFAULT:
 *             return _AsyncIterator(iter([]))
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2005, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_aiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mock_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ret_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":2006
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value
 *         if ret_val is DEFAULT:             # <<<<<<<<<<<<<<
 *             return _AsyncIterator(iter([]))
 *         return _AsyncIterator(iter(ret_val))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__pyx_v_ret_val == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2007
 *         ret_val = self.__aiter__._mock_return_value
 *         if ret_val is DEFAULT:
 *             return _AsyncIterator(iter([]))             # <<<<<<<<<<<<<<
 *         return _AsyncIterator(iter(ret_val))
 *     return __aiter__
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AsyncIterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2007, __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;

    /* "cymock.pyx":2006
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value
 *         if ret_val is DEFAULT:             # <<<<<<<<<<<<<<
 *             return _AsyncIterator(iter([]))
 *         return _AsyncIterator(iter(ret_val))
 */
  }

  /* "cymock.pyx":2008
 *         if ret_val is DEFAULT:
 *             return _AsyncIterator(iter([]))
 *         return _AsyncIterator(iter(ret_val))             # <<<<<<<<<<<<<<
 *     return __aiter__
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AsyncIterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_GetIter(__pyx_v_ret_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __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;

  /* "cymock.pyx":2004
 * 
 * def _get_async_iter(self):
 *     def __aiter__():             # <<<<<<<<<<<<<<
 *         ret_val = self.__aiter__._mock_return_value
 *         if ret_val is DEFAULT:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock._get_async_iter.__aiter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2003
 *     return __iter__
 * 
 * def _get_async_iter(self):             # <<<<<<<<<<<<<<
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value
 */

static PyObject *__pyx_pf_6cymock_60_get_async_iter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *__pyx_cur_scope;
  PyObject *__pyx_v___aiter__ = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_get_async_iter", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *)__pyx_tp_new_6cymock___pyx_scope_struct_23__get_async_iter(__pyx_ptype_6cymock___pyx_scope_struct_23__get_async_iter, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2003, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "cymock.pyx":2004
 * 
 * def _get_async_iter(self):
 *     def __aiter__():             # <<<<<<<<<<<<<<
 *         ret_val = self.__aiter__._mock_return_value
 *         if ret_val is DEFAULT:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15_get_async_iter_1__aiter__, 0, __pyx_n_s_get_async_iter_locals___aiter, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v___aiter__ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2009
 *             return _AsyncIterator(iter([]))
 *         return _AsyncIterator(iter(ret_val))
 *     return __aiter__             # <<<<<<<<<<<<<<
 * 
 * _side_effect_methods = {
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___aiter__);
  __pyx_r = __pyx_v___aiter__;
  goto __pyx_L0;

  /* "cymock.pyx":2003
 *     return __iter__
 * 
 * def _get_async_iter(self):             # <<<<<<<<<<<<<<
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cymock._get_async_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___aiter__);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2020
 * 
 * 
 * def _set_return_value(mock, method, name):             # <<<<<<<<<<<<<<
 *     fixed = _return_values.get(name, DEFAULT)
 *     if fixed is not DEFAULT:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_63_set_return_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_63_set_return_value = {"_set_return_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_63_set_return_value, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_63_set_return_value(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mock = 0;
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_return_value (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mock,&__pyx_n_s_method,&__pyx_n_s_name_2,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mock)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set_return_value", 1, 3, 3, 1); __PYX_ERR(0, 2020, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set_return_value", 1, 3, 3, 2); __PYX_ERR(0, 2020, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_return_value") < 0)) __PYX_ERR(0, 2020, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_mock = values[0];
    __pyx_v_method = values[1];
    __pyx_v_name = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_return_value", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2020, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._set_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_62_set_return_value(__pyx_self, __pyx_v_mock, __pyx_v_method, __pyx_v_name);

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

static PyObject *__pyx_pf_6cymock_62_set_return_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock, PyObject *__pyx_v_method, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_fixed = NULL;
  PyObject *__pyx_v_return_calculator = NULL;
  PyObject *__pyx_v_return_value = NULL;
  PyObject *__pyx_v_side_effector = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_set_return_value", 0);

  /* "cymock.pyx":2021
 * 
 * def _set_return_value(mock, method, name):
 *     fixed = _return_values.get(name, DEFAULT)             # <<<<<<<<<<<<<<
 *     if fixed is not DEFAULT:
 *         method.return_value = fixed
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_return_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && 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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_fixed = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2022
 * def _set_return_value(mock, method, name):
 *     fixed = _return_values.get(name, DEFAULT)
 *     if fixed is not DEFAULT:             # <<<<<<<<<<<<<<
 *         method.return_value = fixed
 *         return
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__pyx_v_fixed != __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "cymock.pyx":2023
 *     fixed = _return_values.get(name, DEFAULT)
 *     if fixed is not DEFAULT:
 *         method.return_value = fixed             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_method, __pyx_n_s_return_value, __pyx_v_fixed) < 0) __PYX_ERR(0, 2023, __pyx_L1_error)

    /* "cymock.pyx":2024
 *     if fixed is not DEFAULT:
 *         method.return_value = fixed
 *         return             # <<<<<<<<<<<<<<
 * 
 *     return_calculator = _calculate_return_value.get(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cymock.pyx":2022
 * def _set_return_value(mock, method, name):
 *     fixed = _return_values.get(name, DEFAULT)
 *     if fixed is not DEFAULT:             # <<<<<<<<<<<<<<
 *         method.return_value = fixed
 *         return
 */
  }

  /* "cymock.pyx":2026
 *         return
 * 
 *     return_calculator = _calculate_return_value.get(name)             # <<<<<<<<<<<<<<
 *     if return_calculator is not None:
 *         return_value = return_calculator(mock)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_calculate_return_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_return_calculator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2027
 * 
 *     return_calculator = _calculate_return_value.get(name)
 *     if return_calculator is not None:             # <<<<<<<<<<<<<<
 *         return_value = return_calculator(mock)
 *         method.return_value = return_value
 */
  __pyx_t_8 = (__pyx_v_return_calculator != Py_None);
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "cymock.pyx":2028
 *     return_calculator = _calculate_return_value.get(name)
 *     if return_calculator is not None:
 *         return_value = return_calculator(mock)             # <<<<<<<<<<<<<<
 *         method.return_value = return_value
 *         return
 */
    __Pyx_INCREF(__pyx_v_return_calculator);
    __pyx_t_6 = __pyx_v_return_calculator; __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_mock) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_mock);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_return_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2029
 *     if return_calculator is not None:
 *         return_value = return_calculator(mock)
 *         method.return_value = return_value             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_method, __pyx_n_s_return_value, __pyx_v_return_value) < 0) __PYX_ERR(0, 2029, __pyx_L1_error)

    /* "cymock.pyx":2030
 *         return_value = return_calculator(mock)
 *         method.return_value = return_value
 *         return             # <<<<<<<<<<<<<<
 * 
 *     side_effector = _side_effect_methods.get(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cymock.pyx":2027
 * 
 *     return_calculator = _calculate_return_value.get(name)
 *     if return_calculator is not None:             # <<<<<<<<<<<<<<
 *         return_value = return_calculator(mock)
 *         method.return_value = return_value
 */
  }

  /* "cymock.pyx":2032
 *         return
 * 
 *     side_effector = _side_effect_methods.get(name)             # <<<<<<<<<<<<<<
 *     if side_effector is not None:
 *         method.side_effect = side_effector(mock)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_side_effect_methods); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_side_effector = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2033
 * 
 *     side_effector = _side_effect_methods.get(name)
 *     if side_effector is not None:             # <<<<<<<<<<<<<<
 *         method.side_effect = side_effector(mock)
 * 
 */
  __pyx_t_7 = (__pyx_v_side_effector != Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "cymock.pyx":2034
 *     side_effector = _side_effect_methods.get(name)
 *     if side_effector is not None:
 *         method.side_effect = side_effector(mock)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_INCREF(__pyx_v_side_effector);
    __pyx_t_3 = __pyx_v_side_effector; __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_mock) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mock);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2034, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_method, __pyx_n_s_side_effect, __pyx_t_1) < 0) __PYX_ERR(0, 2034, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":2033
 * 
 *     side_effector = _side_effect_methods.get(name)
 *     if side_effector is not None:             # <<<<<<<<<<<<<<
 *         method.side_effect = side_effector(mock)
 * 
 */
  }

  /* "cymock.pyx":2020
 * 
 * 
 * def _set_return_value(mock, method, name):             # <<<<<<<<<<<<<<
 *     fixed = _return_values.get(name, DEFAULT)
 *     if fixed is not DEFAULT:
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock._set_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fixed);
  __Pyx_XDECREF(__pyx_v_return_calculator);
  __Pyx_XDECREF(__pyx_v_return_value);
  __Pyx_XDECREF(__pyx_v_side_effector);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2039
 * 
 * class MagicMixin(Base):
 *     def __init__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(MagicMixin, self).__init__(*args, **kw)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_10MagicMixin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_10MagicMixin_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_10MagicMixin_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_10MagicMixin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2039, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2039, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("cymock.MagicMixin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_10MagicMixin___init__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kw);

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

static PyObject *__pyx_pf_6cymock_10MagicMixin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":2040
 * class MagicMixin(Base):
 *     def __init__(self, *args, **kw):
 *         self._mock_set_magics()  # make magic work for kwargs in init             # <<<<<<<<<<<<<<
 *         _safe_super(MagicMixin, self).__init__(*args, **kw)
 *         self._mock_set_magics()  # fix magic broken by upper level init
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_set_magics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2040, __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;

  /* "cymock.pyx":2041
 *     def __init__(self, *args, **kw):
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(MagicMixin, self).__init__(*args, **kw)             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # fix magic broken by upper level init
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_super); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MagicMixin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2041, __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;

  /* "cymock.pyx":2042
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(MagicMixin, self).__init__(*args, **kw)
 *         self._mock_set_magics()  # fix magic broken by upper level init             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_set_magics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2042, __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;

  /* "cymock.pyx":2039
 * 
 * class MagicMixin(Base):
 *     def __init__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(MagicMixin, self).__init__(*args, **kw)
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock.MagicMixin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2045
 * 
 * 
 *     def _mock_set_magics(self):             # <<<<<<<<<<<<<<
 *         orig_magics = _magics | _async_method_magics
 *         these_magics = orig_magics
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_10MagicMixin_3_mock_set_magics(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_10MagicMixin_3_mock_set_magics = {"_mock_set_magics", (PyCFunction)__pyx_pw_6cymock_10MagicMixin_3_mock_set_magics, METH_O, 0};
static PyObject *__pyx_pw_6cymock_10MagicMixin_3_mock_set_magics(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_mock_set_magics (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_10MagicMixin_2_mock_set_magics(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_10MagicMixin_2_mock_set_magics(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_orig_magics = NULL;
  PyObject *__pyx_v_these_magics = NULL;
  PyObject *__pyx_v_remove_magics = NULL;
  PyObject *__pyx_v_entry = NULL;
  PyTypeObject *__pyx_v__type = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_mock_set_magics", 0);

  /* "cymock.pyx":2046
 * 
 *     def _mock_set_magics(self):
 *         orig_magics = _magics | _async_method_magics             # <<<<<<<<<<<<<<
 *         these_magics = orig_magics
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_magics); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_async_method_magics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2046, __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_v_orig_magics = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":2047
 *     def _mock_set_magics(self):
 *         orig_magics = _magics | _async_method_magics
 *         these_magics = orig_magics             # <<<<<<<<<<<<<<
 * 
 *         if getattr(self, "_mock_methods", None) is not None:
 */
  __Pyx_INCREF(__pyx_v_orig_magics);
  __pyx_v_these_magics = __pyx_v_orig_magics;

  /* "cymock.pyx":2049
 *         these_magics = orig_magics
 * 
 *         if getattr(self, "_mock_methods", None) is not None:             # <<<<<<<<<<<<<<
 *             these_magics = orig_magics.intersection(self._mock_methods)
 * 
 */
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_u_mock_methods, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__pyx_t_3 != Py_None);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":2050
 * 
 *         if getattr(self, "_mock_methods", None) is not None:
 *             these_magics = orig_magics.intersection(self._mock_methods)             # <<<<<<<<<<<<<<
 * 
 *             remove_magics = set()
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_orig_magics, __pyx_n_s_intersection); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_these_magics, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":2052
 *             these_magics = orig_magics.intersection(self._mock_methods)
 * 
 *             remove_magics = set()             # <<<<<<<<<<<<<<
 *             remove_magics = orig_magics - these_magics
 * 
 */
    __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_remove_magics = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cymock.pyx":2053
 * 
 *             remove_magics = set()
 *             remove_magics = orig_magics - these_magics             # <<<<<<<<<<<<<<
 * 
 *             for entry in remove_magics:
 */
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_orig_magics, __pyx_v_these_magics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_remove_magics, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":2055
 *             remove_magics = orig_magics - these_magics
 * 
 *             for entry in remove_magics:             # <<<<<<<<<<<<<<
 *                 if entry in type(self).__dict__:
 *                     # remove unneeded magic methods
 */
    if (likely(PyList_CheckExact(__pyx_v_remove_magics)) || PyTuple_CheckExact(__pyx_v_remove_magics)) {
      __pyx_t_3 = __pyx_v_remove_magics; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_remove_magics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2055, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2055, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2055, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2055, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2055, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2055, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2055, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cymock.pyx":2056
 * 
 *             for entry in remove_magics:
 *                 if entry in type(self).__dict__:             # <<<<<<<<<<<<<<
 *                     # remove unneeded magic methods
 *                     delattr(self, entry)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2056, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_entry, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2056, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = (__pyx_t_5 != 0);
      if (__pyx_t_4) {

        /* "cymock.pyx":2058
 *                 if entry in type(self).__dict__:
 *                     # remove unneeded magic methods
 *                     delattr(self, entry)             # <<<<<<<<<<<<<<
 * 
 *         # don't overwrite existing attributes if called a second time
 */
        __pyx_t_9 = PyObject_DelAttr(__pyx_v_self, __pyx_v_entry); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2058, __pyx_L1_error)

        /* "cymock.pyx":2056
 * 
 *             for entry in remove_magics:
 *                 if entry in type(self).__dict__:             # <<<<<<<<<<<<<<
 *                     # remove unneeded magic methods
 *                     delattr(self, entry)
 */
      }

      /* "cymock.pyx":2055
 *             remove_magics = orig_magics - these_magics
 * 
 *             for entry in remove_magics:             # <<<<<<<<<<<<<<
 *                 if entry in type(self).__dict__:
 *                     # remove unneeded magic methods
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":2049
 *         these_magics = orig_magics
 * 
 *         if getattr(self, "_mock_methods", None) is not None:             # <<<<<<<<<<<<<<
 *             these_magics = orig_magics.intersection(self._mock_methods)
 * 
 */
  }

  /* "cymock.pyx":2061
 * 
 *         # don't overwrite existing attributes if called a second time
 *         these_magics = these_magics - set(type(self).__dict__)             # <<<<<<<<<<<<<<
 * 
 *         _type = type(self)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_these_magics, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_these_magics, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "cymock.pyx":2063
 *         these_magics = these_magics - set(type(self).__dict__)
 * 
 *         _type = type(self)             # <<<<<<<<<<<<<<
 *         for entry in these_magics:
 *             setattr(_type, entry, MagicProxy(entry, self))
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self)));
  __pyx_v__type = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_self)));

  /* "cymock.pyx":2064
 * 
 *         _type = type(self)
 *         for entry in these_magics:             # <<<<<<<<<<<<<<
 *             setattr(_type, entry, MagicProxy(entry, self))
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_these_magics)) || PyTuple_CheckExact(__pyx_v_these_magics)) {
    __pyx_t_3 = __pyx_v_these_magics; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_these_magics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2064, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2064, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2064, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2064, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2064, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2064, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cymock.pyx":2065
 *         _type = type(self)
 *         for entry in these_magics:
 *             setattr(_type, entry, MagicProxy(entry, self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MagicProxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_entry, __pyx_v_self};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_entry, __pyx_v_self};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_entry);
      __Pyx_GIVEREF(__pyx_v_entry);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_entry);
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_self);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = PyObject_SetAttr(((PyObject *)__pyx_v__type), __pyx_v_entry, __pyx_t_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2065, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cymock.pyx":2064
 * 
 *         _type = type(self)
 *         for entry in these_magics:             # <<<<<<<<<<<<<<
 *             setattr(_type, entry, MagicProxy(entry, self))
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2045
 * 
 * 
 *     def _mock_set_magics(self):             # <<<<<<<<<<<<<<
 *         orig_magics = _magics | _async_method_magics
 *         these_magics = orig_magics
 */

  /* 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_11);
  __Pyx_AddTraceback("cymock.MagicMixin._mock_set_magics", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_orig_magics);
  __Pyx_XDECREF(__pyx_v_these_magics);
  __Pyx_XDECREF(__pyx_v_remove_magics);
  __Pyx_XDECREF(__pyx_v_entry);
  __Pyx_XDECREF(__pyx_v__type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2071
 * class NonCallableMagicMock(MagicMixin, NonCallableMock):
 *     """A version of `MagicMock` that isn't callable."""
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_20NonCallableMagicMock_1mock_add_spec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_20NonCallableMagicMock_mock_add_spec[] = "Add a spec to a mock. `spec` can either be an object or a\n        list of strings. Only attributes on the `spec` can be fetched as\n        attributes from the mock.\n\n        If `spec_set` is True then only attributes on the spec can be set.";
static PyMethodDef __pyx_mdef_6cymock_20NonCallableMagicMock_1mock_add_spec = {"mock_add_spec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_20NonCallableMagicMock_1mock_add_spec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_20NonCallableMagicMock_mock_add_spec};
static PyObject *__pyx_pw_6cymock_20NonCallableMagicMock_1mock_add_spec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mock_add_spec (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_spec,&__pyx_n_s_spec_set,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mock_add_spec", 0, 2, 3, 1); __PYX_ERR(0, 2071, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mock_add_spec") < 0)) __PYX_ERR(0, 2071, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_spec = values[1];
    __pyx_v_spec_set = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mock_add_spec", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2071, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.NonCallableMagicMock.mock_add_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_20NonCallableMagicMock_mock_add_spec(__pyx_self, __pyx_v_self, __pyx_v_spec, __pyx_v_spec_set);

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

static PyObject *__pyx_pf_6cymock_20NonCallableMagicMock_mock_add_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mock_add_spec", 0);

  /* "cymock.pyx":2077
 * 
 *         If `spec_set` is True then only attributes on the spec can be set."""
 *         self._mock_add_spec(spec, spec_set)             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_add_spec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_spec, __pyx_v_spec_set};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2077, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_spec, __pyx_v_spec_set};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2077, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_spec_set);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2078
 *         If `spec_set` is True then only attributes on the spec can be set."""
 *         self._mock_add_spec(spec, spec_set)
 *         self._mock_set_magics()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_set_magics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2078, __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;

  /* "cymock.pyx":2071
 * class NonCallableMagicMock(MagicMixin, NonCallableMock):
 *     """A version of `MagicMock` that isn't callable."""
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */

  /* 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_5);
  __Pyx_AddTraceback("cymock.NonCallableMagicMock.mock_add_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2082
 * 
 * class AsyncMagicMixin(MagicMixin):
 *     def __init__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(AsyncMagicMixin, self).__init__(*args, **kw)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_15AsyncMagicMixin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_15AsyncMagicMixin_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_15AsyncMagicMixin_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_15AsyncMagicMixin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2082, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2082, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("cymock.AsyncMagicMixin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_15AsyncMagicMixin___init__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kw);

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

static PyObject *__pyx_pf_6cymock_15AsyncMagicMixin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":2083
 * class AsyncMagicMixin(MagicMixin):
 *     def __init__(self, *args, **kw):
 *         self._mock_set_magics()  # make magic work for kwargs in init             # <<<<<<<<<<<<<<
 *         _safe_super(AsyncMagicMixin, self).__init__(*args, **kw)
 *         self._mock_set_magics()  # fix magic broken by upper level init
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_set_magics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __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;

  /* "cymock.pyx":2084
 *     def __init__(self, *args, **kw):
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(AsyncMagicMixin, self).__init__(*args, **kw)             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # fix magic broken by upper level init
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_safe_super); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AsyncMagicMixin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2084, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_self};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2084, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2084, __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;

  /* "cymock.pyx":2085
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(AsyncMagicMixin, self).__init__(*args, **kw)
 *         self._mock_set_magics()  # fix magic broken by upper level init             # <<<<<<<<<<<<<<
 * 
 * class MagicMock(MagicMixin, Mock):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_set_magics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2085, __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;

  /* "cymock.pyx":2082
 * 
 * class AsyncMagicMixin(MagicMixin):
 *     def __init__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(AsyncMagicMixin, self).__init__(*args, **kw)
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock.AsyncMagicMixin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2098
 *     Attributes and the return value of a `MagicMock` will also be `MagicMocks`.
 *     """
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9MagicMock_1mock_add_spec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_9MagicMock_mock_add_spec[] = "Add a spec to a mock. `spec` can either be an object or a\n        list of strings. Only attributes on the `spec` can be fetched as\n        attributes from the mock.\n\n        If `spec_set` is True then only attributes on the spec can be set.";
static PyMethodDef __pyx_mdef_6cymock_9MagicMock_1mock_add_spec = {"mock_add_spec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_9MagicMock_1mock_add_spec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_9MagicMock_mock_add_spec};
static PyObject *__pyx_pw_6cymock_9MagicMock_1mock_add_spec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mock_add_spec (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_spec,&__pyx_n_s_spec_set,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mock_add_spec", 0, 2, 3, 1); __PYX_ERR(0, 2098, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mock_add_spec") < 0)) __PYX_ERR(0, 2098, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_spec = values[1];
    __pyx_v_spec_set = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mock_add_spec", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2098, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.MagicMock.mock_add_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_9MagicMock_mock_add_spec(__pyx_self, __pyx_v_self, __pyx_v_spec, __pyx_v_spec_set);

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

static PyObject *__pyx_pf_6cymock_9MagicMock_mock_add_spec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mock_add_spec", 0);

  /* "cymock.pyx":2104
 * 
 *         If `spec_set` is True then only attributes on the spec can be set."""
 *         self._mock_add_spec(spec, spec_set)             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_add_spec); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && 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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_spec, __pyx_v_spec_set};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_spec, __pyx_v_spec_set};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_spec_set);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2105
 *         If `spec_set` is True then only attributes on the spec can be set."""
 *         self._mock_add_spec(spec, spec_set)
 *         self._mock_set_magics()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_set_magics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2105, __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;

  /* "cymock.pyx":2098
 *     Attributes and the return value of a `MagicMock` will also be `MagicMocks`.
 *     """
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */

  /* 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_5);
  __Pyx_AddTraceback("cymock.MagicMock.mock_add_spec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2110
 * 
 * class MagicProxy(Base):
 *     def __init__(self, name, parent):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.parent = parent
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_10MagicProxy_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_10MagicProxy_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_10MagicProxy_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_10MagicProxy_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name_2,&__pyx_n_s_parent,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 2110, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 2110, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2110, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_parent = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2110, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.MagicProxy.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_10MagicProxy___init__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_parent);

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

static PyObject *__pyx_pf_6cymock_10MagicProxy___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":2111
 * class MagicProxy(Base):
 *     def __init__(self, name, parent):
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.parent = parent
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 2111, __pyx_L1_error)

  /* "cymock.pyx":2112
 *     def __init__(self, name, parent):
 *         self.name = name
 *         self.parent = parent             # <<<<<<<<<<<<<<
 * 
 *     def create_mock(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 2112, __pyx_L1_error)

  /* "cymock.pyx":2110
 * 
 * class MagicProxy(Base):
 *     def __init__(self, name, parent):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.parent = parent
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.MagicProxy.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2114
 *         self.parent = parent
 * 
 *     def create_mock(self):             # <<<<<<<<<<<<<<
 *         entry = self.name
 *         parent = self.parent
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_10MagicProxy_3create_mock(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_10MagicProxy_3create_mock = {"create_mock", (PyCFunction)__pyx_pw_6cymock_10MagicProxy_3create_mock, METH_O, 0};
static PyObject *__pyx_pw_6cymock_10MagicProxy_3create_mock(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_mock (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_10MagicProxy_2create_mock(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_10MagicProxy_2create_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_entry = NULL;
  PyObject *__pyx_v_parent = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("create_mock", 0);

  /* "cymock.pyx":2115
 * 
 *     def create_mock(self):
 *         entry = self.name             # <<<<<<<<<<<<<<
 *         parent = self.parent
 *         m = parent._get_child_mock(name=entry, _new_name=entry,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entry = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2116
 *     def create_mock(self):
 *         entry = self.name
 *         parent = self.parent             # <<<<<<<<<<<<<<
 *         m = parent._get_child_mock(name=entry, _new_name=entry,
 *                                    _new_parent=parent)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_parent = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2117
 *         entry = self.name
 *         parent = self.parent
 *         m = parent._get_child_mock(name=entry, _new_name=entry,             # <<<<<<<<<<<<<<
 *                                    _new_parent=parent)
 *         setattr(parent, entry, m)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_get_child_mock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name_2, __pyx_v_entry) < 0) __PYX_ERR(0, 2117, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_new_name_2, __pyx_v_entry) < 0) __PYX_ERR(0, 2117, __pyx_L1_error)

  /* "cymock.pyx":2118
 *         parent = self.parent
 *         m = parent._get_child_mock(name=entry, _new_name=entry,
 *                                    _new_parent=parent)             # <<<<<<<<<<<<<<
 *         setattr(parent, entry, m)
 *         _set_return_value(parent, m, entry)
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_new_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 2117, __pyx_L1_error)

  /* "cymock.pyx":2117
 *         entry = self.name
 *         parent = self.parent
 *         m = parent._get_child_mock(name=entry, _new_name=entry,             # <<<<<<<<<<<<<<
 *                                    _new_parent=parent)
 *         setattr(parent, entry, m)
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2117, __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_v_m = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":2119
 *         m = parent._get_child_mock(name=entry, _new_name=entry,
 *                                    _new_parent=parent)
 *         setattr(parent, entry, m)             # <<<<<<<<<<<<<<
 *         _set_return_value(parent, m, entry)
 *         return m
 */
  __pyx_t_4 = PyObject_SetAttr(__pyx_v_parent, __pyx_v_entry, __pyx_v_m); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2119, __pyx_L1_error)

  /* "cymock.pyx":2120
 *                                    _new_parent=parent)
 *         setattr(parent, entry, m)
 *         _set_return_value(parent, m, entry)             # <<<<<<<<<<<<<<
 *         return m
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_parent, __pyx_v_m, __pyx_v_entry};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2120, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_parent, __pyx_v_m, __pyx_v_entry};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2120, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_parent);
    __Pyx_GIVEREF(__pyx_v_parent);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_parent);
    __Pyx_INCREF(__pyx_v_m);
    __Pyx_GIVEREF(__pyx_v_m);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_m);
    __Pyx_INCREF(__pyx_v_entry);
    __Pyx_GIVEREF(__pyx_v_entry);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_entry);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2121
 *         setattr(parent, entry, m)
 *         _set_return_value(parent, m, entry)
 *         return m             # <<<<<<<<<<<<<<
 * 
 *     def __get__(self, obj, _type=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_m);
  __pyx_r = __pyx_v_m;
  goto __pyx_L0;

  /* "cymock.pyx":2114
 *         self.parent = parent
 * 
 *     def create_mock(self):             # <<<<<<<<<<<<<<
 *         entry = self.name
 *         parent = self.parent
 */

  /* 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_6);
  __Pyx_AddTraceback("cymock.MagicProxy.create_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_entry);
  __Pyx_XDECREF(__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2123
 *         return m
 * 
 *     def __get__(self, obj, _type=None):             # <<<<<<<<<<<<<<
 *         return self.create_mock()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_10MagicProxy_5__get__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_10MagicProxy_5__get__ = {"__get__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_10MagicProxy_5__get__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_10MagicProxy_5__get__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_obj = 0;
  CYTHON_UNUSED PyObject *__pyx_v__type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_obj,&__pyx_n_s_type,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__get__", 0, 2, 3, 1); __PYX_ERR(0, 2123, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__get__") < 0)) __PYX_ERR(0, 2123, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_obj = values[1];
    __pyx_v__type = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__get__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2123, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.MagicProxy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_10MagicProxy_4__get__(__pyx_self, __pyx_v_self, __pyx_v_obj, __pyx_v__type);

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

static PyObject *__pyx_pf_6cymock_10MagicProxy_4__get__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v__type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "cymock.pyx":2124
 * 
 *     def __get__(self, obj, _type=None):
 *         return self.create_mock()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_create_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2124, __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;

  /* "cymock.pyx":2123
 *         return m
 * 
 *     def __get__(self, obj, _type=None):             # <<<<<<<<<<<<<<
 *         return self.create_mock()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock.MagicProxy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2132
 *     await_args_list = _delegating_property('await_args_list')
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super().__init__(*args, **kwargs)
 *         # asyncio.iscoroutinefunction() checks _is_coroutine property to say if an
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14AsyncMockMixin_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2132, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2132, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.AsyncMockMixin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin___init__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_code_mock = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":2133
 * 
 *     def __init__(self, *args, **kwargs):
 *         super().__init__(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         # asyncio.iscoroutinefunction() checks _is_coroutine property to say if an
 *         # object is a coroutine. Without this check it looks to see if it is a
 */
  __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2133, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __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;

  /* "cymock.pyx":2140
 *         # It is set through __dict__ because when spec_set is True, this
 *         # attribute is likely undefined.
 *         self.__dict__['_is_coroutine'] = asyncio.coroutines._is_coroutine             # <<<<<<<<<<<<<<
 *         self.__dict__['_mock_await_count'] = 0
 *         self.__dict__['_mock_await_args'] = None
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_coroutines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_coroutine); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_u_is_coroutine, __pyx_t_1) < 0)) __PYX_ERR(0, 2140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2141
 *         # attribute is likely undefined.
 *         self.__dict__['_is_coroutine'] = asyncio.coroutines._is_coroutine
 *         self.__dict__['_mock_await_count'] = 0             # <<<<<<<<<<<<<<
 *         self.__dict__['_mock_await_args'] = None
 *         self.__dict__['_mock_await_args_list'] = _CallList()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_mock_await_count, __pyx_int_0) < 0)) __PYX_ERR(0, 2141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2142
 *         self.__dict__['_is_coroutine'] = asyncio.coroutines._is_coroutine
 *         self.__dict__['_mock_await_count'] = 0
 *         self.__dict__['_mock_await_args'] = None             # <<<<<<<<<<<<<<
 *         self.__dict__['_mock_await_args_list'] = _CallList()
 *         code_mock = NonCallableMock(spec_set=CodeType)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_mock_await_args, Py_None) < 0)) __PYX_ERR(0, 2142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2143
 *         self.__dict__['_mock_await_count'] = 0
 *         self.__dict__['_mock_await_args'] = None
 *         self.__dict__['_mock_await_args_list'] = _CallList()             # <<<<<<<<<<<<<<
 *         code_mock = NonCallableMock(spec_set=CodeType)
 *         code_mock.co_flags = inspect.CO_COROUTINE
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_u_mock_await_args_list, __pyx_t_1) < 0)) __PYX_ERR(0, 2143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2144
 *         self.__dict__['_mock_await_args'] = None
 *         self.__dict__['_mock_await_args_list'] = _CallList()
 *         code_mock = NonCallableMock(spec_set=CodeType)             # <<<<<<<<<<<<<<
 *         code_mock.co_flags = inspect.CO_COROUTINE
 *         self.__dict__['__code__'] = code_mock
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CodeType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_spec_set, __pyx_t_3) < 0) __PYX_ERR(0, 2144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2144, __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_v_code_mock = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":2145
 *         self.__dict__['_mock_await_args_list'] = _CallList()
 *         code_mock = NonCallableMock(spec_set=CodeType)
 *         code_mock.co_flags = inspect.CO_COROUTINE             # <<<<<<<<<<<<<<
 *         self.__dict__['__code__'] = code_mock
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_inspect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CO_COROUTINE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_code_mock, __pyx_n_s_co_flags, __pyx_t_2) < 0) __PYX_ERR(0, 2145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2146
 *         code_mock = NonCallableMock(spec_set=CodeType)
 *         code_mock.co_flags = inspect.CO_COROUTINE
 *         self.__dict__['__code__'] = code_mock             # <<<<<<<<<<<<<<
 * 
 *     async def _execute_mock_call(self, *args, **kwargs):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_u_code, __pyx_v_code_mock) < 0)) __PYX_ERR(0, 2146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2132
 *     await_args_list = _delegating_property('await_args_list')
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super().__init__(*args, **kwargs)
 *         # asyncio.iscoroutinefunction() checks _is_coroutine property to say if an
 */

  /* 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_AddTraceback("cymock.AsyncMockMixin.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_code_mock);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_14AsyncMockMixin_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":2148
 *         self.__dict__['__code__'] = code_mock
 * 
 *     async def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # This is nearly just like super(), except for sepcial handling
 *         # of coroutines
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_3_execute_mock_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_3_execute_mock_call = {"_execute_mock_call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14AsyncMockMixin_3_execute_mock_call, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_3_execute_mock_call(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_execute_mock_call (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "_execute_mock_call") < 0)) __PYX_ERR(0, 2148, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_execute_mock_call", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2148, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_CLEAR(__pyx_v_args);
  __Pyx_CLEAR(__pyx_v_kwargs);
  __Pyx_AddTraceback("cymock.AsyncMockMixin._execute_mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_2_execute_mock_call(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_2_execute_mock_call(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_execute_mock_call", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *)__pyx_tp_new_6cymock___pyx_scope_struct_24__execute_mock_call(__pyx_ptype_6cymock___pyx_scope_struct_24__execute_mock_call, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2148, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_14AsyncMockMixin_4generator1, __pyx_codeobj__74, (PyObject *) __pyx_cur_scope, __pyx_n_s_execute_mock_call, __pyx_n_s_AsyncMockMixin__execute_mock_cal, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 2148, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.AsyncMockMixin._execute_mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_14AsyncMockMixin_4generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_execute_mock_call", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L15_resume_from_await;
    case 2: goto __pyx_L20_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2148, __pyx_L1_error)

  /* "cymock.pyx":2152
 *         # of coroutines
 * 
 *         _call = self.call_args             # <<<<<<<<<<<<<<
 *         self.await_count += 1
 *         self.await_args = _call
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v__call = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2153
 * 
 *         _call = self.call_args
 *         self.await_count += 1             # <<<<<<<<<<<<<<
 *         self.await_args = _call
 *         self.await_args_list.append(_call)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_await_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_await_count, __pyx_t_2) < 0) __PYX_ERR(0, 2153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2154
 *         _call = self.call_args
 *         self.await_count += 1
 *         self.await_args = _call             # <<<<<<<<<<<<<<
 *         self.await_args_list.append(_call)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_await_args, __pyx_cur_scope->__pyx_v__call) < 0) __PYX_ERR(0, 2154, __pyx_L1_error)

  /* "cymock.pyx":2155
 *         self.await_count += 1
 *         self.await_args = _call
 *         self.await_args_list.append(_call)             # <<<<<<<<<<<<<<
 * 
 *         effect = self.side_effect
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_await_args_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_cur_scope->__pyx_v__call); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 2155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2157
 *         self.await_args_list.append(_call)
 * 
 *         effect = self.side_effect             # <<<<<<<<<<<<<<
 *         if effect is not None:
 *             if _is_exception(effect):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_side_effect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_effect = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":2158
 * 
 *         effect = self.side_effect
 *         if effect is not None:             # <<<<<<<<<<<<<<
 *             if _is_exception(effect):
 *                 raise effect
 */
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_effect != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":2159
 *         effect = self.side_effect
 *         if effect is not None:
 *             if _is_exception(effect):             # <<<<<<<<<<<<<<
 *                 raise effect
 *             elif not _callable(effect):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_cur_scope->__pyx_v_effect) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_effect);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2159, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_5)) {

      /* "cymock.pyx":2160
 *         if effect is not None:
 *             if _is_exception(effect):
 *                 raise effect             # <<<<<<<<<<<<<<
 *             elif not _callable(effect):
 *                 try:
 */
      __Pyx_Raise(__pyx_cur_scope->__pyx_v_effect, 0, 0, 0);
      __PYX_ERR(0, 2160, __pyx_L1_error)

      /* "cymock.pyx":2159
 *         effect = self.side_effect
 *         if effect is not None:
 *             if _is_exception(effect):             # <<<<<<<<<<<<<<
 *                 raise effect
 *             elif not _callable(effect):
 */
    }

    /* "cymock.pyx":2161
 *             if _is_exception(effect):
 *                 raise effect
 *             elif not _callable(effect):             # <<<<<<<<<<<<<<
 *                 try:
 *                     result = next(effect)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_callable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_cur_scope->__pyx_v_effect) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_effect);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = ((!__pyx_t_5) != 0);
    if (__pyx_t_4) {

      /* "cymock.pyx":2162
 *                 raise effect
 *             elif not _callable(effect):
 *                 try:             # <<<<<<<<<<<<<<
 *                     result = next(effect)
 *                 except StopIteration:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "cymock.pyx":2163
 *             elif not _callable(effect):
 *                 try:
 *                     result = next(effect)             # <<<<<<<<<<<<<<
 *                 except StopIteration:
 *                     # It is impossible to propogate a StopIteration
 */
          __pyx_t_2 = __Pyx_PyIter_Next(__pyx_cur_scope->__pyx_v_effect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_cur_scope->__pyx_v_result = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "cymock.pyx":2162
 *                 raise effect
 *             elif not _callable(effect):
 *                 try:             # <<<<<<<<<<<<<<
 *                     result = next(effect)
 *                 except StopIteration:
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L11_try_end;
        __pyx_L6_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cymock.pyx":2164
 *                 try:
 *                     result = next(effect)
 *                 except StopIteration:             # <<<<<<<<<<<<<<
 *                     # It is impossible to propogate a StopIteration
 *                     # through coroutines because of PEP 479
 */
        __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
        if (__pyx_t_10) {
          __Pyx_AddTraceback("cymock.AsyncMockMixin._execute_mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 2164, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_6);

          /* "cymock.pyx":2167
 *                     # It is impossible to propogate a StopIteration
 *                     # through coroutines because of PEP 479
 *                     raise StopAsyncIteration             # <<<<<<<<<<<<<<
 *                 if _is_exception(result):
 *                     raise result
 */
          __Pyx_Raise(((PyObject *)(&((PyTypeObject*)__Pyx_PyExc_StopAsyncIteration)[0])), 0, 0, 0);
          __PYX_ERR(0, 2167, __pyx_L8_except_error)
        }
        goto __pyx_L8_except_error;
        __pyx_L8_except_error:;

        /* "cymock.pyx":2162
 *                 raise effect
 *             elif not _callable(effect):
 *                 try:             # <<<<<<<<<<<<<<
 *                     result = next(effect)
 *                 except StopIteration:
 */
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L11_try_end:;
      }

      /* "cymock.pyx":2168
 *                     # through coroutines because of PEP 479
 *                     raise StopAsyncIteration
 *                 if _is_exception(result):             # <<<<<<<<<<<<<<
 *                     raise result
 *             elif asyncio.iscoroutinefunction(effect):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_result) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_result);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2168, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__pyx_t_4)) {

        /* "cymock.pyx":2169
 *                     raise StopAsyncIteration
 *                 if _is_exception(result):
 *                     raise result             # <<<<<<<<<<<<<<
 *             elif asyncio.iscoroutinefunction(effect):
 *                 result = await effect(*args, **kwargs)
 */
        __Pyx_Raise(__pyx_cur_scope->__pyx_v_result, 0, 0, 0);
        __PYX_ERR(0, 2169, __pyx_L1_error)

        /* "cymock.pyx":2168
 *                     # through coroutines because of PEP 479
 *                     raise StopAsyncIteration
 *                 if _is_exception(result):             # <<<<<<<<<<<<<<
 *                     raise result
 *             elif asyncio.iscoroutinefunction(effect):
 */
      }

      /* "cymock.pyx":2161
 *             if _is_exception(effect):
 *                 raise effect
 *             elif not _callable(effect):             # <<<<<<<<<<<<<<
 *                 try:
 *                     result = next(effect)
 */
      goto __pyx_L5;
    }

    /* "cymock.pyx":2170
 *                 if _is_exception(result):
 *                     raise result
 *             elif asyncio.iscoroutinefunction(effect):             # <<<<<<<<<<<<<<
 *                 result = await effect(*args, **kwargs)
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_cur_scope->__pyx_v_effect) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_effect);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2170, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "cymock.pyx":2171
 *                     raise result
 *             elif asyncio.iscoroutinefunction(effect):
 *                 result = await effect(*args, **kwargs)             # <<<<<<<<<<<<<<
 *             else:
 *                 result = effect(*args, **kwargs)
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_effect, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L15_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2171, __pyx_L1_error)
        __pyx_t_6 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_6 = NULL;
        if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_6) < 0) __PYX_ERR(0, 2171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_cur_scope->__pyx_v_result = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "cymock.pyx":2170
 *                 if _is_exception(result):
 *                     raise result
 *             elif asyncio.iscoroutinefunction(effect):             # <<<<<<<<<<<<<<
 *                 result = await effect(*args, **kwargs)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "cymock.pyx":2173
 *                 result = await effect(*args, **kwargs)
 *             else:
 *                 result = effect(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *             if result is not DEFAULT:
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_effect, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_cur_scope->__pyx_v_result = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    __pyx_L5:;

    /* "cymock.pyx":2175
 *                 result = effect(*args, **kwargs)
 * 
 *             if result is not DEFAULT:             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = (__pyx_cur_scope->__pyx_v_result != __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "cymock.pyx":2176
 * 
 *             if result is not DEFAULT:
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if self._mock_return_value is not DEFAULT:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_result);
      goto __pyx_L0;

      /* "cymock.pyx":2175
 *                 result = effect(*args, **kwargs)
 * 
 *             if result is not DEFAULT:             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "cymock.pyx":2158
 * 
 *         effect = self.side_effect
 *         if effect is not None:             # <<<<<<<<<<<<<<
 *             if _is_exception(effect):
 *                 raise effect
 */
  }

  /* "cymock.pyx":2178
 *                 return result
 * 
 *         if self._mock_return_value is not DEFAULT:             # <<<<<<<<<<<<<<
 *             return self.return_value
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_return_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = (__pyx_t_6 != __pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2179
 * 
 *         if self._mock_return_value is not DEFAULT:
 *             return self.return_value             # <<<<<<<<<<<<<<
 * 
 *         if self._mock_wraps is not None:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":2178
 *                 return result
 * 
 *         if self._mock_return_value is not DEFAULT:             # <<<<<<<<<<<<<<
 *             return self.return_value
 * 
 */
  }

  /* "cymock.pyx":2181
 *             return self.return_value
 * 
 *         if self._mock_wraps is not None:             # <<<<<<<<<<<<<<
 *             if asyncio.iscoroutinefunction(self._mock_wraps):
 *                 return await self._mock_wraps(*args, **kwargs)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_wraps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2181, __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;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":2182
 * 
 *         if self._mock_wraps is not None:
 *             if asyncio.iscoroutinefunction(self._mock_wraps):             # <<<<<<<<<<<<<<
 *                 return await self._mock_wraps(*args, **kwargs)
 *             return self._mock_wraps(*args, **kwargs)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_wraps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "cymock.pyx":2183
 *         if self._mock_wraps is not None:
 *             if asyncio.iscoroutinefunction(self._mock_wraps):
 *                 return await self._mock_wraps(*args, **kwargs)             # <<<<<<<<<<<<<<
 *             return self._mock_wraps(*args, **kwargs)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_wraps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 2;
        return __pyx_r;
        __pyx_L20_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2183, __pyx_L1_error)
        __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1);
      } else {
        __pyx_t_1 = NULL;
        if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(0, 2183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "cymock.pyx":2182
 * 
 *         if self._mock_wraps is not None:
 *             if asyncio.iscoroutinefunction(self._mock_wraps):             # <<<<<<<<<<<<<<
 *                 return await self._mock_wraps(*args, **kwargs)
 *             return self._mock_wraps(*args, **kwargs)
 */
    }

    /* "cymock.pyx":2184
 *             if asyncio.iscoroutinefunction(self._mock_wraps):
 *                 return await self._mock_wraps(*args, **kwargs)
 *             return self._mock_wraps(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *         return self.return_value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_mock_wraps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":2181
 *             return self.return_value
 * 
 *         if self._mock_wraps is not None:             # <<<<<<<<<<<<<<
 *             if asyncio.iscoroutinefunction(self._mock_wraps):
 *                 return await self._mock_wraps(*args, **kwargs)
 */
  }

  /* "cymock.pyx":2186
 *             return self._mock_wraps(*args, **kwargs)
 * 
 *         return self.return_value             # <<<<<<<<<<<<<<
 * 
 *     def assert_awaited(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "cymock.pyx":2148
 *         self.__dict__['__code__'] = code_mock
 * 
 *     async def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # This is nearly just like super(), except for sepcial handling
 *         # of coroutines
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_execute_mock_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2188
 *         return self.return_value
 * 
 *     def assert_awaited(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited at least once.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_6assert_awaited(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_14AsyncMockMixin_5assert_awaited[] = "\n        Assert that the mock was awaited at least once.\n        ";
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_6assert_awaited = {"assert_awaited", (PyCFunction)__pyx_pw_6cymock_14AsyncMockMixin_6assert_awaited, METH_O, __pyx_doc_6cymock_14AsyncMockMixin_5assert_awaited};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_6assert_awaited(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_awaited (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_5assert_awaited(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_5assert_awaited(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("assert_awaited", 0);

  /* "cymock.pyx":2192
 *         Assert that the mock was awaited at least once.
 *         """
 *         if self.await_count == 0:             # <<<<<<<<<<<<<<
 *             msg = f"Expected {self._mock_name or 'mock'} to have been awaited."
 *             raise AssertionError(msg)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_await_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":2193
 *         """
 *         if self.await_count == 0:
 *             msg = f"Expected {self._mock_name or 'mock'} to have been awaited."             # <<<<<<<<<<<<<<
 *             raise AssertionError(msg)
 * 
 */
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expected_3);
    __pyx_t_4 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_Expected_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expected_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2193, __pyx_L1_error)
    if (!__pyx_t_3) {
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_1 = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_1 = __pyx_n_u_mock;
    __pyx_L4_bool_binop_done:;
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_to_have_been_awaited);
    __pyx_t_4 += 22;
    __Pyx_GIVEREF(__pyx_kp_u_to_have_been_awaited);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_to_have_been_awaited);
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_msg = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "cymock.pyx":2194
 *         if self.await_count == 0:
 *             msg = f"Expected {self._mock_name or 'mock'} to have been awaited."
 *             raise AssertionError(msg)             # <<<<<<<<<<<<<<
 * 
 *     def assert_awaited_once(self):
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 2194, __pyx_L1_error)

    /* "cymock.pyx":2192
 *         Assert that the mock was awaited at least once.
 *         """
 *         if self.await_count == 0:             # <<<<<<<<<<<<<<
 *             msg = f"Expected {self._mock_name or 'mock'} to have been awaited."
 *             raise AssertionError(msg)
 */
  }

  /* "cymock.pyx":2188
 *         return self.return_value
 * 
 *     def assert_awaited(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited at least once.
 */

  /* 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_6);
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_awaited", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2196
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_once(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited exactly once.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_8assert_awaited_once(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_14AsyncMockMixin_7assert_awaited_once[] = "\n        Assert that the mock was awaited exactly once.\n        ";
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_8assert_awaited_once = {"assert_awaited_once", (PyCFunction)__pyx_pw_6cymock_14AsyncMockMixin_8assert_awaited_once, METH_O, __pyx_doc_6cymock_14AsyncMockMixin_7assert_awaited_once};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_8assert_awaited_once(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_awaited_once (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_7assert_awaited_once(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_7assert_awaited_once(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("assert_awaited_once", 0);

  /* "cymock.pyx":2200
 *         Assert that the mock was awaited exactly once.
 *         """
 *         if not self.await_count == 1:             # <<<<<<<<<<<<<<
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
 *                    f" Awaited {self.await_count} times.")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_await_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "cymock.pyx":2201
 *         """
 *         if not self.await_count == 1:
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."             # <<<<<<<<<<<<<<
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expected_3);
    __pyx_t_5 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_Expected_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expected_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2201, __pyx_L1_error)
    if (!__pyx_t_4) {
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_1 = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_1 = __pyx_n_u_mock;
    __pyx_L4_bool_binop_done:;
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_to_have_been_awaited_once_Await);
    __pyx_t_5 += 36;
    __Pyx_GIVEREF(__pyx_kp_u_to_have_been_awaited_once_Await);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_to_have_been_awaited_once_Await);

    /* "cymock.pyx":2202
 *         if not self.await_count == 1:
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
 *                    f" Awaited {self.await_count} times.")             # <<<<<<<<<<<<<<
 *             raise AssertionError(msg)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_await_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_times);
    __pyx_t_5 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_times);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_times);

    /* "cymock.pyx":2201
 *         """
 *         if not self.await_count == 1:
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."             # <<<<<<<<<<<<<<
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_msg = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2203
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)             # <<<<<<<<<<<<<<
 * 
 *     def assert_awaited_with(self, *args, **kwargs):
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2203, __pyx_L1_error)

    /* "cymock.pyx":2200
 *         Assert that the mock was awaited exactly once.
 *         """
 *         if not self.await_count == 1:             # <<<<<<<<<<<<<<
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
 *                    f" Awaited {self.await_count} times.")
 */
  }

  /* "cymock.pyx":2196
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_once(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited exactly once.
 */

  /* 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_7);
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_awaited_once", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2205
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the last await was with the specified arguments.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_10assert_awaited_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_14AsyncMockMixin_9assert_awaited_with[] = "\n        Assert that the last await was with the specified arguments.\n        ";
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_10assert_awaited_with = {"assert_awaited_with", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14AsyncMockMixin_10assert_awaited_with, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_14AsyncMockMixin_9assert_awaited_with};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_10assert_awaited_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_awaited_with (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "assert_awaited_with") < 0)) __PYX_ERR(0, 2205, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assert_awaited_with", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2205, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_CLEAR(__pyx_v_args);
  __Pyx_CLEAR(__pyx_v_kwargs);
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_awaited_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_9assert_awaited_with(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

/* "cymock.pyx":2213
 *             raise AssertionError(f'Expected await: {expected}\nNot awaited')
 * 
 *         def _error_message():             # <<<<<<<<<<<<<<
 *             msg = self._format_mock_failure_message(args, kwargs, action='await')
 *             return msg
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_19assert_awaited_with_1_error_message(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_19assert_awaited_with_1_error_message = {"_error_message", (PyCFunction)__pyx_pw_6cymock_14AsyncMockMixin_19assert_awaited_with_1_error_message, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_19assert_awaited_with_1_error_message(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_error_message (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_19assert_awaited_with__error_message(__pyx_self);

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_19assert_awaited_with__error_message(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *__pyx_outer_scope;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_error_message", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":2214
 * 
 *         def _error_message():
 *             msg = self._format_mock_failure_message(args, kwargs, action='await')             # <<<<<<<<<<<<<<
 *             return msg
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2214, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_format_mock_failure_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); __PYX_ERR(0, 2214, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 2214, __pyx_L1_error) }
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_args);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_kwargs);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_action, __pyx_n_u_await_2) < 0) __PYX_ERR(0, 2214, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_msg = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":2215
 *         def _error_message():
 *             msg = self._format_mock_failure_message(args, kwargs, action='await')
 *             return msg             # <<<<<<<<<<<<<<
 * 
 *         expected = self._call_matcher((args, kwargs))
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_msg);
  __pyx_r = __pyx_v_msg;
  goto __pyx_L0;

  /* "cymock.pyx":2213
 *             raise AssertionError(f'Expected await: {expected}\nNot awaited')
 * 
 *         def _error_message():             # <<<<<<<<<<<<<<
 *             msg = self._format_mock_failure_message(args, kwargs, action='await')
 *             return msg
 */

  /* 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("cymock.AsyncMockMixin.assert_awaited_with._error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2205
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the last await was with the specified arguments.
 */

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_9assert_awaited_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *__pyx_cur_scope;
  PyObject *__pyx_v_expected = NULL;
  PyObject *__pyx_v__error_message = 0;
  PyObject *__pyx_v_actual = NULL;
  PyObject *__pyx_v_cause = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  __Pyx_RefNannySetupContext("assert_awaited_with", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *)__pyx_tp_new_6cymock___pyx_scope_struct_25_assert_awaited_with(__pyx_ptype_6cymock___pyx_scope_struct_25_assert_awaited_with, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2205, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);

  /* "cymock.pyx":2209
 *         Assert that the last await was with the specified arguments.
 *         """
 *         if self.await_args is None:             # <<<<<<<<<<<<<<
 *             expected = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(f'Expected await: {expected}\nNot awaited')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_await_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":2210
 *         """
 *         if self.await_args is None:
 *             expected = self._format_mock_call_signature(args, kwargs)             # <<<<<<<<<<<<<<
 *             raise AssertionError(f'Expected await: {expected}\nNot awaited')
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_format_mock_call_signature); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2210, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2210, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_args);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_cur_scope->__pyx_v_kwargs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2210, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_expected = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2211
 *         if self.await_args is None:
 *             expected = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(f'Expected await: {expected}\nNot awaited')             # <<<<<<<<<<<<<<
 * 
 *         def _error_message():
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expected_await);
    __pyx_t_8 += 16;
    __Pyx_GIVEREF(__pyx_kp_u_Expected_await);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Expected_await);
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_expected, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_9;
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u_Not_awaited);
    __pyx_t_8 += 12;
    __Pyx_GIVEREF(__pyx_kp_u_Not_awaited);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_Not_awaited);
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2211, __pyx_L1_error)

    /* "cymock.pyx":2209
 *         Assert that the last await was with the specified arguments.
 *         """
 *         if self.await_args is None:             # <<<<<<<<<<<<<<
 *             expected = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(f'Expected await: {expected}\nNot awaited')
 */
  }

  /* "cymock.pyx":2213
 *             raise AssertionError(f'Expected await: {expected}\nNot awaited')
 * 
 *         def _error_message():             # <<<<<<<<<<<<<<
 *             msg = self._format_mock_failure_message(args, kwargs, action='await')
 *             return msg
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_19assert_awaited_with_1_error_message, 0, __pyx_n_s_AsyncMockMixin_assert_awaited_wi, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__error_message = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2217
 *             return msg
 * 
 *         expected = self._call_matcher((args, kwargs))             # <<<<<<<<<<<<<<
 *         actual = self._call_matcher(self.await_args)
 *         if expected != actual:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_args);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_cur_scope->__pyx_v_kwargs);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_expected = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2218
 * 
 *         expected = self._call_matcher((args, kwargs))
 *         actual = self._call_matcher(self.await_args)             # <<<<<<<<<<<<<<
 *         if expected != actual:
 *             cause = expected if isinstance(expected, Exception) else None
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_await_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_actual = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2219
 *         expected = self._call_matcher((args, kwargs))
 *         actual = self._call_matcher(self.await_args)
 *         if expected != actual:             # <<<<<<<<<<<<<<
 *             cause = expected if isinstance(expected, Exception) else None
 *             raise AssertionError(_error_message()) from cause
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_expected, __pyx_v_actual, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2219, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":2220
 *         actual = self._call_matcher(self.await_args)
 *         if expected != actual:
 *             cause = expected if isinstance(expected, Exception) else None             # <<<<<<<<<<<<<<
 *             raise AssertionError(_error_message()) from cause
 * 
 */
    __pyx_t_3 = __Pyx_PyException_Check(__pyx_v_expected); 
    if ((__pyx_t_3 != 0)) {
      __Pyx_INCREF(__pyx_v_expected);
      __pyx_t_1 = __pyx_v_expected;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_1 = Py_None;
    }
    __pyx_v_cause = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2221
 *         if expected != actual:
 *             cause = expected if isinstance(expected, Exception) else None
 *             raise AssertionError(_error_message()) from cause             # <<<<<<<<<<<<<<
 * 
 *     def assert_awaited_once_with(self, *args, **kwargs):
 */
    __pyx_t_1 = __pyx_pf_6cymock_14AsyncMockMixin_19assert_awaited_with__error_message(__pyx_v__error_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, __pyx_v_cause);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 2221, __pyx_L1_error)

    /* "cymock.pyx":2219
 *         expected = self._call_matcher((args, kwargs))
 *         actual = self._call_matcher(self.await_args)
 *         if expected != actual:             # <<<<<<<<<<<<<<
 *             cause = expected if isinstance(expected, Exception) else None
 *             raise AssertionError(_error_message()) from cause
 */
  }

  /* "cymock.pyx":2205
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the last await was with the specified arguments.
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_awaited_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expected);
  __Pyx_XDECREF(__pyx_v__error_message);
  __Pyx_XDECREF(__pyx_v_actual);
  __Pyx_XDECREF(__pyx_v_cause);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2223
 *             raise AssertionError(_error_message()) from cause
 * 
 *     def assert_awaited_once_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited exactly once and with the specified
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_12assert_awaited_once_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_14AsyncMockMixin_11assert_awaited_once_with[] = "\n        Assert that the mock was awaited exactly once and with the specified\n        arguments.\n        ";
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_12assert_awaited_once_with = {"assert_awaited_once_with", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14AsyncMockMixin_12assert_awaited_once_with, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_14AsyncMockMixin_11assert_awaited_once_with};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_12assert_awaited_once_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_awaited_once_with (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "assert_awaited_once_with") < 0)) __PYX_ERR(0, 2223, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assert_awaited_once_with", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2223, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_awaited_once_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_11assert_awaited_once_with(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_11assert_awaited_once_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("assert_awaited_once_with", 0);

  /* "cymock.pyx":2228
 *         arguments.
 *         """
 *         if not self.await_count == 1:             # <<<<<<<<<<<<<<
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
 *                    f" Awaited {self.await_count} times.")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_await_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "cymock.pyx":2229
 *         """
 *         if not self.await_count == 1:
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."             # <<<<<<<<<<<<<<
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expected_3);
    __pyx_t_5 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_Expected_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expected_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2229, __pyx_L1_error)
    if (!__pyx_t_4) {
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_1 = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_1 = __pyx_n_u_mock;
    __pyx_L4_bool_binop_done:;
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_to_have_been_awaited_once_Await);
    __pyx_t_5 += 36;
    __Pyx_GIVEREF(__pyx_kp_u_to_have_been_awaited_once_Await);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_to_have_been_awaited_once_Await);

    /* "cymock.pyx":2230
 *         if not self.await_count == 1:
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
 *                    f" Awaited {self.await_count} times.")             # <<<<<<<<<<<<<<
 *             raise AssertionError(msg)
 *         return self.assert_awaited_with(*args, **kwargs)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_await_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_times);
    __pyx_t_5 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_times);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_times);

    /* "cymock.pyx":2229
 *         """
 *         if not self.await_count == 1:
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."             # <<<<<<<<<<<<<<
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_msg = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2231
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)             # <<<<<<<<<<<<<<
 *         return self.assert_awaited_with(*args, **kwargs)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2231, __pyx_L1_error)

    /* "cymock.pyx":2228
 *         arguments.
 *         """
 *         if not self.await_count == 1:             # <<<<<<<<<<<<<<
 *             msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
 *                    f" Awaited {self.await_count} times.")
 */
  }

  /* "cymock.pyx":2232
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)
 *         return self.assert_awaited_with(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def assert_any_await(self, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assert_awaited_with); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2232, __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;

  /* "cymock.pyx":2223
 *             raise AssertionError(_error_message()) from cause
 * 
 *     def assert_awaited_once_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited exactly once and with the specified
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_awaited_once_with", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2234
 *         return self.assert_awaited_with(*args, **kwargs)
 * 
 *     def assert_any_await(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has ever been awaited with the specified arguments.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_14assert_any_await(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_14AsyncMockMixin_13assert_any_await[] = "\n        Assert the mock has ever been awaited with the specified arguments.\n        ";
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_14assert_any_await = {"assert_any_await", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14AsyncMockMixin_14assert_any_await, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_14AsyncMockMixin_13assert_any_await};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_14assert_any_await(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_any_await (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "assert_any_await") < 0)) __PYX_ERR(0, 2234, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assert_any_await", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2234, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_any_await", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_13assert_any_await(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_13assert_any_await(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_expected = NULL;
  PyObject *__pyx_v_actual = NULL;
  PyObject *__pyx_v_cause = NULL;
  PyObject *__pyx_v_expected_string = NULL;
  PyObject *__pyx_9genexpr14__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("assert_any_await", 0);

  /* "cymock.pyx":2238
 *         Assert the mock has ever been awaited with the specified arguments.
 *         """
 *         expected = self._call_matcher((args, kwargs))             # <<<<<<<<<<<<<<
 *         actual = [self._call_matcher(c) for c in self.await_args_list]
 *         if expected not in actual:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_kwargs);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_expected = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2239
 *         """
 *         expected = self._call_matcher((args, kwargs))
 *         actual = [self._call_matcher(c) for c in self.await_args_list]             # <<<<<<<<<<<<<<
 *         if expected not in actual:
 *             cause = expected if isinstance(expected, Exception) else None
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2239, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_await_args_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2239, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2239, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2239, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2239, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2239, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2239, __pyx_L5_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2239, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2239, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_c, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2239, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_9genexpr14__pyx_v_c) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_9genexpr14__pyx_v_c);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2239, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2239, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_c); __pyx_9genexpr14__pyx_v_c = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_c); __pyx_9genexpr14__pyx_v_c = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_v_actual = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2240
 *         expected = self._call_matcher((args, kwargs))
 *         actual = [self._call_matcher(c) for c in self.await_args_list]
 *         if expected not in actual:             # <<<<<<<<<<<<<<
 *             cause = expected if isinstance(expected, Exception) else None
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 */
  __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_expected, __pyx_v_actual, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 2240, __pyx_L1_error)
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (unlikely(__pyx_t_9)) {

    /* "cymock.pyx":2241
 *         actual = [self._call_matcher(c) for c in self.await_args_list]
 *         if expected not in actual:
 *             cause = expected if isinstance(expected, Exception) else None             # <<<<<<<<<<<<<<
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(
 */
    __pyx_t_9 = __Pyx_PyException_Check(__pyx_v_expected); 
    if ((__pyx_t_9 != 0)) {
      __Pyx_INCREF(__pyx_v_expected);
      __pyx_t_1 = __pyx_v_expected;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_1 = Py_None;
    }
    __pyx_v_cause = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2242
 *         if expected not in actual:
 *             cause = expected if isinstance(expected, Exception) else None
 *             expected_string = self._format_mock_call_signature(args, kwargs)             # <<<<<<<<<<<<<<
 *             raise AssertionError(
 *                 '%s await not found' % expected_string
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_mock_call_signature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_args, __pyx_v_kwargs};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_args, __pyx_v_kwargs};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_10, __pyx_v_args);
      __Pyx_INCREF(__pyx_v_kwargs);
      __Pyx_GIVEREF(__pyx_v_kwargs);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_10, __pyx_v_kwargs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_expected_string = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2244
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(
 *                 '%s await not found' % expected_string             # <<<<<<<<<<<<<<
 *             ) from cause
 * 
 */
    __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_await_not_found, __pyx_v_expected_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "cymock.pyx":2243
 *             cause = expected if isinstance(expected, Exception) else None
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 *             raise AssertionError(             # <<<<<<<<<<<<<<
 *                 '%s await not found' % expected_string
 *             ) from cause
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":2245
 *             raise AssertionError(
 *                 '%s await not found' % expected_string
 *             ) from cause             # <<<<<<<<<<<<<<
 * 
 *     def assert_has_awaits(self, calls, any_order=False):
 */
    __Pyx_Raise(__pyx_t_3, 0, 0, __pyx_v_cause);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2243, __pyx_L1_error)

    /* "cymock.pyx":2240
 *         expected = self._call_matcher((args, kwargs))
 *         actual = [self._call_matcher(c) for c in self.await_args_list]
 *         if expected not in actual:             # <<<<<<<<<<<<<<
 *             cause = expected if isinstance(expected, Exception) else None
 *             expected_string = self._format_mock_call_signature(args, kwargs)
 */
  }

  /* "cymock.pyx":2234
 *         return self.assert_awaited_with(*args, **kwargs)
 * 
 *     def assert_any_await(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has ever been awaited with the specified arguments.
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_any_await", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expected);
  __Pyx_XDECREF(__pyx_v_actual);
  __Pyx_XDECREF(__pyx_v_cause);
  __Pyx_XDECREF(__pyx_v_expected_string);
  __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2247
 *             ) from cause
 * 
 *     def assert_has_awaits(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has been awaited with the specified calls.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_16assert_has_awaits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_14AsyncMockMixin_15assert_has_awaits[] = "\n        Assert the mock has been awaited with the specified calls.\n        The :attr:`await_args_list` list is checked for the awaits.\n\n        If `any_order` is False (the default) then the awaits must be\n        sequential. There can be extra calls before or after the\n        specified awaits.\n\n        If `any_order` is True then the awaits can be in any order, but\n        they must all appear in :attr:`await_args_list`.\n        ";
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_16assert_has_awaits = {"assert_has_awaits", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14AsyncMockMixin_16assert_has_awaits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_14AsyncMockMixin_15assert_has_awaits};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_16assert_has_awaits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_calls = 0;
  PyObject *__pyx_v_any_order = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_has_awaits (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_calls,&__pyx_n_s_any_order,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calls)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("assert_has_awaits", 0, 2, 3, 1); __PYX_ERR(0, 2247, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_any_order);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assert_has_awaits") < 0)) __PYX_ERR(0, 2247, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_calls = values[1];
    __pyx_v_any_order = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assert_has_awaits", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2247, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_has_awaits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_15assert_has_awaits(__pyx_self, __pyx_v_self, __pyx_v_calls, __pyx_v_any_order);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_14AsyncMockMixin_17assert_has_awaits_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":2260
 *         """
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)             # <<<<<<<<<<<<<<
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
 *         if not any_order:
 */

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_17assert_has_awaits_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *)__pyx_tp_new_6cymock___pyx_scope_struct_27_genexpr(__pyx_ptype_6cymock___pyx_scope_struct_27_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2260, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_14AsyncMockMixin_17assert_has_awaits_2generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_AsyncMockMixin_assert_has_awaits, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 2260, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_has_awaits.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_14AsyncMockMixin_17assert_has_awaits_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2260, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_expected)) { __Pyx_RaiseClosureNameError("expected"); __PYX_ERR(0, 2260, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_expected == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 2260, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_expected; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 2260, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyException_Check(__pyx_cur_scope->__pyx_v_e); 
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
      __pyx_r = __pyx_cur_scope->__pyx_v_e;
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2260, __pyx_L1_error)
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_14AsyncMockMixin_17assert_has_awaits_5generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":2261
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)             # <<<<<<<<<<<<<<
 *         if not any_order:
 *             if expected not in all_awaits:
 */

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_17assert_has_awaits_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *)__pyx_tp_new_6cymock___pyx_scope_struct_28_genexpr(__pyx_ptype_6cymock___pyx_scope_struct_28_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2261, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_14AsyncMockMixin_17assert_has_awaits_5generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_AsyncMockMixin_assert_has_awaits, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 2261, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_has_awaits.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_14AsyncMockMixin_17assert_has_awaits_5generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2261, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2261, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_await_args_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2261, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2261, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2261, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2261, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2261, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_cur_scope->__pyx_v_c) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2261, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2247
 *             ) from cause
 * 
 *     def assert_has_awaits(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has been awaited with the specified calls.
 */

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_15assert_has_awaits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_calls, PyObject *__pyx_v_any_order) {
  struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *__pyx_cur_scope;
  PyObject *__pyx_v_cause = NULL;
  PyObject *__pyx_v_all_awaits = NULL;
  PyObject *__pyx_v_problem = NULL;
  PyObject *__pyx_v_not_found = NULL;
  PyObject *__pyx_v_kall = NULL;
  PyObject *__pyx_9genexpr15__pyx_v_c = NULL;
  PyObject *__pyx_9genexpr18__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_UCS4 __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("assert_has_awaits", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *)__pyx_tp_new_6cymock___pyx_scope_struct_26_assert_has_awaits(__pyx_ptype_6cymock___pyx_scope_struct_26_assert_has_awaits, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2247, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);

  /* "cymock.pyx":2259
 *         they must all appear in :attr:`await_args_list`.
 *         """
 *         expected = [self._call_matcher(c) for c in calls]             # <<<<<<<<<<<<<<
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2259, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_calls)) || PyTuple_CheckExact(__pyx_v_calls)) {
      __pyx_t_2 = __pyx_v_calls; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_calls); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2259, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2259, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2259, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2259, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2259, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2259, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2259, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_c, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_call_matcher); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2259, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_9genexpr15__pyx_v_c) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_9genexpr15__pyx_v_c);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2259, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2259, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_c); __pyx_9genexpr15__pyx_v_c = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_c); __pyx_9genexpr15__pyx_v_c = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_expected = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2260
 *         """
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)             # <<<<<<<<<<<<<<
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
 *         if not any_order:
 */
  __pyx_t_1 = __pyx_pf_6cymock_14AsyncMockMixin_17assert_has_awaits_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next2(__pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cause = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":2261
 *         expected = [self._call_matcher(c) for c in calls]
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)             # <<<<<<<<<<<<<<
 *         if not any_order:
 *             if expected not in all_awaits:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CallList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __pyx_pf_6cymock_14AsyncMockMixin_17assert_has_awaits_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_all_awaits = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cymock.pyx":2262
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
 *         if not any_order:             # <<<<<<<<<<<<<<
 *             if expected not in all_awaits:
 *                 if cause is None:
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_any_order); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 2262, __pyx_L1_error)
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "cymock.pyx":2263
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
 *         if not any_order:
 *             if expected not in all_awaits:             # <<<<<<<<<<<<<<
 *                 if cause is None:
 *                     problem = 'Awaits not found.'
 */
    __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_expected, __pyx_v_all_awaits, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2263, __pyx_L1_error)
    __pyx_t_8 = (__pyx_t_9 != 0);
    if (__pyx_t_8) {

      /* "cymock.pyx":2264
 *         if not any_order:
 *             if expected not in all_awaits:
 *                 if cause is None:             # <<<<<<<<<<<<<<
 *                     problem = 'Awaits not found.'
 *                 else:
 */
      __pyx_t_8 = (__pyx_v_cause == Py_None);
      __pyx_t_9 = (__pyx_t_8 != 0);
      if (__pyx_t_9) {

        /* "cymock.pyx":2265
 *             if expected not in all_awaits:
 *                 if cause is None:
 *                     problem = 'Awaits not found.'             # <<<<<<<<<<<<<<
 *                 else:
 *                     problem = ('Error processing expected awaits.\n'
 */
        __Pyx_INCREF(__pyx_kp_u_Awaits_not_found);
        __pyx_v_problem = __pyx_kp_u_Awaits_not_found;

        /* "cymock.pyx":2264
 *         if not any_order:
 *             if expected not in all_awaits:
 *                 if cause is None:             # <<<<<<<<<<<<<<
 *                     problem = 'Awaits not found.'
 *                 else:
 */
        goto __pyx_L11;
      }

      /* "cymock.pyx":2268
 *                 else:
 *                     problem = ('Error processing expected awaits.\n'
 *                                'Errors: {}').format(             # <<<<<<<<<<<<<<
 *                                    [e if isinstance(e, Exception) else None
 *                                     for e in expected])
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Error_processing_expected_awaits, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        { /* enter inner scope */

          /* "cymock.pyx":2269
 *                     problem = ('Error processing expected awaits.\n'
 *                                'Errors: {}').format(
 *                                    [e if isinstance(e, Exception) else None             # <<<<<<<<<<<<<<
 *                                     for e in expected])
 *                 raise AssertionError(
 */
          __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2269, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_5);

          /* "cymock.pyx":2270
 *                                'Errors: {}').format(
 *                                    [e if isinstance(e, Exception) else None
 *                                     for e in expected])             # <<<<<<<<<<<<<<
 *                 raise AssertionError(
 *                     f'{problem}\n'
 */
          __pyx_t_6 = __pyx_cur_scope->__pyx_v_expected; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
          for (;;) {
            if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2270, __pyx_L14_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2270, __pyx_L14_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
            __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_e, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "cymock.pyx":2269
 *                     problem = ('Error processing expected awaits.\n'
 *                                'Errors: {}').format(
 *                                    [e if isinstance(e, Exception) else None             # <<<<<<<<<<<<<<
 *                                     for e in expected])
 *                 raise AssertionError(
 */
            __pyx_t_9 = __Pyx_PyException_Check(__pyx_9genexpr18__pyx_v_e); 
            if ((__pyx_t_9 != 0)) {
              __Pyx_INCREF(__pyx_9genexpr18__pyx_v_e);
              __pyx_t_7 = __pyx_9genexpr18__pyx_v_e;
            } else {
              __Pyx_INCREF(Py_None);
              __pyx_t_7 = Py_None;
            }
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2269, __pyx_L14_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

            /* "cymock.pyx":2270
 *                                'Errors: {}').format(
 *                                    [e if isinstance(e, Exception) else None
 *                                     for e in expected])             # <<<<<<<<<<<<<<
 *                 raise AssertionError(
 *                     f'{problem}\n'
 */
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_e); __pyx_9genexpr18__pyx_v_e = 0;
          goto __pyx_L17_exit_scope;
          __pyx_L14_error:;
          __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_e); __pyx_9genexpr18__pyx_v_e = 0;
          goto __pyx_L1_error;
          __pyx_L17_exit_scope:;
        } /* exit inner scope */
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_problem = __pyx_t_2;
        __pyx_t_2 = 0;
      }
      __pyx_L11:;

      /* "cymock.pyx":2272
 *                                     for e in expected])
 *                 raise AssertionError(
 *                     f'{problem}\n'             # <<<<<<<<<<<<<<
 *                     f'Expected: {_CallList(calls)}\n'
 *                     f'Actual: {self.await_args_list}'
 */
      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_10 = 127;
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_problem, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_10;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_kp_u_Expected_2);
      __pyx_t_3 += 11;
      __Pyx_GIVEREF(__pyx_kp_u_Expected_2);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_Expected_2);

      /* "cymock.pyx":2273
 *                 raise AssertionError(
 *                     f'{problem}\n'
 *                     f'Expected: {_CallList(calls)}\n'             # <<<<<<<<<<<<<<
 *                     f'Actual: {self.await_args_list}'
 *                 ) from cause
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CallList); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_calls) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_calls);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_10;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u_Actual);
      __pyx_t_3 += 9;
      __Pyx_GIVEREF(__pyx_kp_u_Actual);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_kp_u_Actual);

      /* "cymock.pyx":2274
 *                     f'{problem}\n'
 *                     f'Expected: {_CallList(calls)}\n'
 *                     f'Actual: {self.await_args_list}'             # <<<<<<<<<<<<<<
 *                 ) from cause
 *             return
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_await_args_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_10) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_10;
      __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cymock.pyx":2272
 *                                     for e in expected])
 *                 raise AssertionError(
 *                     f'{problem}\n'             # <<<<<<<<<<<<<<
 *                     f'Expected: {_CallList(calls)}\n'
 *                     f'Actual: {self.await_args_list}'
 */
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cymock.pyx":2271
 *                                    [e if isinstance(e, Exception) else None
 *                                     for e in expected])
 *                 raise AssertionError(             # <<<<<<<<<<<<<<
 *                     f'{problem}\n'
 *                     f'Expected: {_CallList(calls)}\n'
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cymock.pyx":2275
 *                     f'Expected: {_CallList(calls)}\n'
 *                     f'Actual: {self.await_args_list}'
 *                 ) from cause             # <<<<<<<<<<<<<<
 *             return
 * 
 */
      __Pyx_Raise(__pyx_t_2, 0, 0, __pyx_v_cause);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2271, __pyx_L1_error)

      /* "cymock.pyx":2263
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
 *         if not any_order:
 *             if expected not in all_awaits:             # <<<<<<<<<<<<<<
 *                 if cause is None:
 *                     problem = 'Awaits not found.'
 */
    }

    /* "cymock.pyx":2276
 *                     f'Actual: {self.await_args_list}'
 *                 ) from cause
 *             return             # <<<<<<<<<<<<<<
 * 
 *         all_awaits = list(all_awaits)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cymock.pyx":2262
 *         cause = next((e for e in expected if isinstance(e, Exception)), None)
 *         all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
 *         if not any_order:             # <<<<<<<<<<<<<<
 *             if expected not in all_awaits:
 *                 if cause is None:
 */
  }

  /* "cymock.pyx":2278
 *             return
 * 
 *         all_awaits = list(all_awaits)             # <<<<<<<<<<<<<<
 * 
 *         not_found = []
 */
  __pyx_t_2 = PySequence_List(__pyx_v_all_awaits); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_all_awaits, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cymock.pyx":2280
 *         all_awaits = list(all_awaits)
 * 
 *         not_found = []             # <<<<<<<<<<<<<<
 *         for kall in expected:
 *             try:
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_not_found = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cymock.pyx":2281
 * 
 *         not_found = []
 *         for kall in expected:             # <<<<<<<<<<<<<<
 *             try:
 *                 all_awaits.remove(kall)
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_expected; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2281, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_kall, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2282
 *         not_found = []
 *         for kall in expected:
 *             try:             # <<<<<<<<<<<<<<
 *                 all_awaits.remove(kall)
 *             except ValueError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      /*try:*/ {

        /* "cymock.pyx":2283
 *         for kall in expected:
 *             try:
 *                 all_awaits.remove(kall)             # <<<<<<<<<<<<<<
 *             except ValueError:
 *                 not_found.append(kall)
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_all_awaits, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2283, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_kall) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_kall);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2283, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cymock.pyx":2282
 *         not_found = []
 *         for kall in expected:
 *             try:             # <<<<<<<<<<<<<<
 *                 all_awaits.remove(kall)
 *             except ValueError:
 */
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L27_try_end;
      __pyx_L20_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cymock.pyx":2284
 *             try:
 *                 all_awaits.remove(kall)
 *             except ValueError:             # <<<<<<<<<<<<<<
 *                 not_found.append(kall)
 *         if not_found:
 */
      __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_14) {
        __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_has_awaits", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 2284, __pyx_L22_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_6);

        /* "cymock.pyx":2285
 *                 all_awaits.remove(kall)
 *             except ValueError:
 *                 not_found.append(kall)             # <<<<<<<<<<<<<<
 *         if not_found:
 *             raise AssertionError(
 */
        __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_not_found, __pyx_v_kall); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 2285, __pyx_L22_except_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L21_exception_handled;
      }
      goto __pyx_L22_except_error;
      __pyx_L22_except_error:;

      /* "cymock.pyx":2282
 *         not_found = []
 *         for kall in expected:
 *             try:             # <<<<<<<<<<<<<<
 *                 all_awaits.remove(kall)
 *             except ValueError:
 */
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L1_error;
      __pyx_L21_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_L27_try_end:;
    }

    /* "cymock.pyx":2281
 * 
 *         not_found = []
 *         for kall in expected:             # <<<<<<<<<<<<<<
 *             try:
 *                 all_awaits.remove(kall)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2286
 *             except ValueError:
 *                 not_found.append(kall)
 *         if not_found:             # <<<<<<<<<<<<<<
 *             raise AssertionError(
 *                 '%r not all found in await list' % (tuple(not_found),)
 */
  __pyx_t_9 = (PyList_GET_SIZE(__pyx_v_not_found) != 0);
  if (unlikely(__pyx_t_9)) {

    /* "cymock.pyx":2288
 *         if not_found:
 *             raise AssertionError(
 *                 '%r not all found in await list' % (tuple(not_found),)             # <<<<<<<<<<<<<<
 *             ) from cause
 * 
 */
    __pyx_t_2 = PyList_AsTuple(__pyx_v_not_found); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_t_6, __pyx_kp_u_not_all_found_in_await_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "cymock.pyx":2287
 *                 not_found.append(kall)
 *         if not_found:
 *             raise AssertionError(             # <<<<<<<<<<<<<<
 *                 '%r not all found in await list' % (tuple(not_found),)
 *             ) from cause
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cymock.pyx":2289
 *             raise AssertionError(
 *                 '%r not all found in await list' % (tuple(not_found),)
 *             ) from cause             # <<<<<<<<<<<<<<
 * 
 *     def assert_not_awaited(self):
 */
    __Pyx_Raise(__pyx_t_6, 0, 0, __pyx_v_cause);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 2287, __pyx_L1_error)

    /* "cymock.pyx":2286
 *             except ValueError:
 *                 not_found.append(kall)
 *         if not_found:             # <<<<<<<<<<<<<<
 *             raise AssertionError(
 *                 '%r not all found in await list' % (tuple(not_found),)
 */
  }

  /* "cymock.pyx":2247
 *             ) from cause
 * 
 *     def assert_has_awaits(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has been awaited with the specified calls.
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_has_awaits", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cause);
  __Pyx_XDECREF(__pyx_v_all_awaits);
  __Pyx_XDECREF(__pyx_v_problem);
  __Pyx_XDECREF(__pyx_v_not_found);
  __Pyx_XDECREF(__pyx_v_kall);
  __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_c);
  __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_e);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2291
 *             ) from cause
 * 
 *     def assert_not_awaited(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was never awaited.
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_18assert_not_awaited(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_14AsyncMockMixin_17assert_not_awaited[] = "\n        Assert that the mock was never awaited.\n        ";
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_18assert_not_awaited = {"assert_not_awaited", (PyCFunction)__pyx_pw_6cymock_14AsyncMockMixin_18assert_not_awaited, METH_O, __pyx_doc_6cymock_14AsyncMockMixin_17assert_not_awaited};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_18assert_not_awaited(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("assert_not_awaited (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_17assert_not_awaited(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_17assert_not_awaited(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("assert_not_awaited", 0);

  /* "cymock.pyx":2295
 *         Assert that the mock was never awaited.
 *         """
 *         if self.await_count != 0:             # <<<<<<<<<<<<<<
 *             msg = (f"Expected {self._mock_name or 'mock'} to not have been awaited."
 *                    f" Awaited {self.await_count} times.")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_await_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":2296
 *         """
 *         if self.await_count != 0:
 *             msg = (f"Expected {self._mock_name or 'mock'} to not have been awaited."             # <<<<<<<<<<<<<<
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_Expected_3);
    __pyx_t_4 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_Expected_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expected_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2296, __pyx_L1_error)
    if (!__pyx_t_3) {
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_1 = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_mock);
    __pyx_t_1 = __pyx_n_u_mock;
    __pyx_L4_bool_binop_done:;
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u_to_not_have_been_awaited_Awaite);
    __pyx_t_4 += 35;
    __Pyx_GIVEREF(__pyx_kp_u_to_not_have_been_awaited_Awaite);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_to_not_have_been_awaited_Awaite);

    /* "cymock.pyx":2297
 *         if self.await_count != 0:
 *             msg = (f"Expected {self._mock_name or 'mock'} to not have been awaited."
 *                    f" Awaited {self.await_count} times.")             # <<<<<<<<<<<<<<
 *             raise AssertionError(msg)
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_await_count); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_kp_u_times);
    __pyx_t_4 += 7;
    __Pyx_GIVEREF(__pyx_kp_u_times);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_times);

    /* "cymock.pyx":2296
 *         """
 *         if self.await_count != 0:
 *             msg = (f"Expected {self._mock_name or 'mock'} to not have been awaited."             # <<<<<<<<<<<<<<
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)
 */
    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_msg = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2298
 *             msg = (f"Expected {self._mock_name or 'mock'} to not have been awaited."
 *                    f" Awaited {self.await_count} times.")
 *             raise AssertionError(msg)             # <<<<<<<<<<<<<<
 * 
 *     def reset_mock(self, *args, **kwargs):
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AssertionError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2298, __pyx_L1_error)

    /* "cymock.pyx":2295
 *         Assert that the mock was never awaited.
 *         """
 *         if self.await_count != 0:             # <<<<<<<<<<<<<<
 *             msg = (f"Expected {self._mock_name or 'mock'} to not have been awaited."
 *                    f" Awaited {self.await_count} times.")
 */
  }

  /* "cymock.pyx":2291
 *             ) from cause
 * 
 *     def assert_not_awaited(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was never awaited.
 */

  /* 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_6);
  __Pyx_AddTraceback("cymock.AsyncMockMixin.assert_not_awaited", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2300
 *             raise AssertionError(msg)
 * 
 *     def reset_mock(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         See :func:`.Mock.reset_mock()`
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_20reset_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_14AsyncMockMixin_19reset_mock[] = "\n        See :func:`.Mock.reset_mock()`\n        ";
static PyMethodDef __pyx_mdef_6cymock_14AsyncMockMixin_20reset_mock = {"reset_mock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14AsyncMockMixin_20reset_mock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_14AsyncMockMixin_19reset_mock};
static PyObject *__pyx_pw_6cymock_14AsyncMockMixin_20reset_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_mock (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "reset_mock") < 0)) __PYX_ERR(0, 2300, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reset_mock", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2300, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.AsyncMockMixin.reset_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14AsyncMockMixin_19reset_mock(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_14AsyncMockMixin_19reset_mock(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("reset_mock", 0);

  /* "cymock.pyx":2304
 *         See :func:`.Mock.reset_mock()`
 *         """
 *         super().reset_mock(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         self.await_count = 0
 *         self.await_args = None
 */
  __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_1) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2304, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reset_mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2304, __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;

  /* "cymock.pyx":2305
 *         """
 *         super().reset_mock(*args, **kwargs)
 *         self.await_count = 0             # <<<<<<<<<<<<<<
 *         self.await_args = None
 *         self.await_args_list = _CallList()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_await_count, __pyx_int_0) < 0) __PYX_ERR(0, 2305, __pyx_L1_error)

  /* "cymock.pyx":2306
 *         super().reset_mock(*args, **kwargs)
 *         self.await_count = 0
 *         self.await_args = None             # <<<<<<<<<<<<<<
 *         self.await_args_list = _CallList()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_await_args, Py_None) < 0) __PYX_ERR(0, 2306, __pyx_L1_error)

  /* "cymock.pyx":2307
 *         self.await_count = 0
 *         self.await_args = None
 *         self.await_args_list = _CallList()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_await_args_list, __pyx_t_1) < 0) __PYX_ERR(0, 2307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2300
 *             raise AssertionError(msg)
 * 
 *     def reset_mock(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         See :func:`.Mock.reset_mock()`
 */

  /* 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_AddTraceback("cymock.AsyncMockMixin.reset_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2356
 *     "A helper object that compares equal to everything."
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_4_ANY_1__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_4_ANY_1__eq__ = {"__eq__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_4_ANY_1__eq__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_4_ANY_1__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 2356, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 2356, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2356, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._ANY.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_4_ANY___eq__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_6cymock_4_ANY___eq__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "cymock.pyx":2357
 * 
 *     def __eq__(self, other):
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def __ne__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "cymock.pyx":2356
 *     "A helper object that compares equal to everything."
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */

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

/* "cymock.pyx":2359
 *         return True
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_4_ANY_3__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_4_ANY_3__ne__ = {"__ne__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_4_ANY_3__ne__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_4_ANY_3__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 2359, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) __PYX_ERR(0, 2359, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2359, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._ANY.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_4_ANY_2__ne__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_6cymock_4_ANY_2__ne__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__", 0);

  /* "cymock.pyx":2360
 * 
 *     def __ne__(self, other):
 *         return False             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "cymock.pyx":2359
 *         return True
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */

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

/* "cymock.pyx":2362
 *         return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<ANY>'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_4_ANY_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_4_ANY_5__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6cymock_4_ANY_5__repr__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_4_ANY_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_4_ANY_4__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_4_ANY_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cymock.pyx":2363
 * 
 *     def __repr__(self):
 *         return '<ANY>'             # <<<<<<<<<<<<<<
 * 
 * ANY = _ANY()
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_kp_u_ANY);
  __pyx_r = __pyx_kp_u_ANY;
  goto __pyx_L0;

  /* "cymock.pyx":2362
 *         return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<ANY>'
 * 
 */

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

/* "cymock.pyx":2369
 * 
 * 
 * def _format_call_signature(name, args, kwargs):             # <<<<<<<<<<<<<<
 *     message = '%s(%%s)' % name
 *     formatted_args = ''
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_65_format_call_signature(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_65_format_call_signature = {"_format_call_signature", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_65_format_call_signature, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_65_format_call_signature(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format_call_signature (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name_2,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_format_call_signature", 1, 3, 3, 1); __PYX_ERR(0, 2369, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_format_call_signature", 1, 3, 3, 2); __PYX_ERR(0, 2369, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_format_call_signature") < 0)) __PYX_ERR(0, 2369, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_name = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kwargs = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_format_call_signature", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2369, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._format_call_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_64_format_call_signature(__pyx_self, __pyx_v_name, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_64_format_call_signature(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_message = NULL;
  PyObject *__pyx_v_formatted_args = NULL;
  PyObject *__pyx_v_args_string = NULL;
  PyObject *__pyx_v_kwargs_string = NULL;
  PyObject *__pyx_9genexpr19__pyx_v_arg = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_key = NULL;
  PyObject *__pyx_9genexpr20__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("_format_call_signature", 0);

  /* "cymock.pyx":2370
 * 
 * def _format_call_signature(name, args, kwargs):
 *     message = '%s(%%s)' % name             # <<<<<<<<<<<<<<
 *     formatted_args = ''
 *     args_string = ', '.join([repr(arg) for arg in args])
 */
  __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_message = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2371
 * def _format_call_signature(name, args, kwargs):
 *     message = '%s(%%s)' % name
 *     formatted_args = ''             # <<<<<<<<<<<<<<
 *     args_string = ', '.join([repr(arg) for arg in args])
 *     kwargs_string = ', '.join([
 */
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_v_formatted_args = __pyx_kp_u__31;

  /* "cymock.pyx":2372
 *     message = '%s(%%s)' % name
 *     formatted_args = ''
 *     args_string = ', '.join([repr(arg) for arg in args])             # <<<<<<<<<<<<<<
 *     kwargs_string = ', '.join([
 *         '%s=%r' % (key, value) for key, value in kwargs.items()
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2372, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) {
      __pyx_t_2 = __pyx_v_args; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2372, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2372, __pyx_L5_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2372, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2372, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2372, __pyx_L5_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2372, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2372, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_arg, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Repr(__pyx_9genexpr19__pyx_v_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2372, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2372, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_arg); __pyx_9genexpr19__pyx_v_arg = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_arg); __pyx_9genexpr19__pyx_v_arg = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__77, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_args_string = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cymock.pyx":2373
 *     formatted_args = ''
 *     args_string = ', '.join([repr(arg) for arg in args])
 *     kwargs_string = ', '.join([             # <<<<<<<<<<<<<<
 *         '%s=%r' % (key, value) for key, value in kwargs.items()
 *     ])
 */
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2373, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "cymock.pyx":2374
 *     args_string = ', '.join([repr(arg) for arg in args])
 *     kwargs_string = ', '.join([
 *         '%s=%r' % (key, value) for key, value in kwargs.items()             # <<<<<<<<<<<<<<
 *     ])
 *     if args_string:
 */
    __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 2374, __pyx_L11_error)
    }
    __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_kwargs, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2374, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
    while (1) {
      __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_3, &__pyx_t_5, &__pyx_t_8, NULL, __pyx_t_7);
      if (unlikely(__pyx_t_9 == 0)) break;
      if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2374, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_key, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cymock.pyx":2373
 *     formatted_args = ''
 *     args_string = ', '.join([repr(arg) for arg in args])
 *     kwargs_string = ', '.join([             # <<<<<<<<<<<<<<
 *         '%s=%r' % (key, value) for key, value in kwargs.items()
 *     ])
 */
      __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2374, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = 0;
      __pyx_t_11 = 127;

      /* "cymock.pyx":2374
 *     args_string = ', '.join([repr(arg) for arg in args])
 *     kwargs_string = ', '.join([
 *         '%s=%r' % (key, value) for key, value in kwargs.items()             # <<<<<<<<<<<<<<
 *     ])
 *     if args_string:
 */
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_9genexpr20__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2374, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u__78);
      __pyx_t_10 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__78);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_kp_u__78);
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_9genexpr20__pyx_v_value), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2374, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_11;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 3, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2374, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2373, __pyx_L11_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_key); __pyx_9genexpr20__pyx_v_key = 0;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_value); __pyx_9genexpr20__pyx_v_value = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_key); __pyx_9genexpr20__pyx_v_key = 0;
    __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_value); __pyx_9genexpr20__pyx_v_value = 0;
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */

  /* "cymock.pyx":2373
 *     formatted_args = ''
 *     args_string = ', '.join([repr(arg) for arg in args])
 *     kwargs_string = ', '.join([             # <<<<<<<<<<<<<<
 *         '%s=%r' % (key, value) for key, value in kwargs.items()
 *     ])
 */
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__77, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_kwargs_string = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2376
 *         '%s=%r' % (key, value) for key, value in kwargs.items()
 *     ])
 *     if args_string:             # <<<<<<<<<<<<<<
 *         formatted_args = args_string
 *     if kwargs_string:
 */
  __pyx_t_12 = (__pyx_v_args_string != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_args_string) != 0);
  if (__pyx_t_12) {

    /* "cymock.pyx":2377
 *     ])
 *     if args_string:
 *         formatted_args = args_string             # <<<<<<<<<<<<<<
 *     if kwargs_string:
 *         if formatted_args:
 */
    __Pyx_INCREF(__pyx_v_args_string);
    __Pyx_DECREF_SET(__pyx_v_formatted_args, __pyx_v_args_string);

    /* "cymock.pyx":2376
 *         '%s=%r' % (key, value) for key, value in kwargs.items()
 *     ])
 *     if args_string:             # <<<<<<<<<<<<<<
 *         formatted_args = args_string
 *     if kwargs_string:
 */
  }

  /* "cymock.pyx":2378
 *     if args_string:
 *         formatted_args = args_string
 *     if kwargs_string:             # <<<<<<<<<<<<<<
 *         if formatted_args:
 *             formatted_args += ', '
 */
  __pyx_t_12 = (__pyx_v_kwargs_string != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_kwargs_string) != 0);
  if (__pyx_t_12) {

    /* "cymock.pyx":2379
 *         formatted_args = args_string
 *     if kwargs_string:
 *         if formatted_args:             # <<<<<<<<<<<<<<
 *             formatted_args += ', '
 *         formatted_args += kwargs_string
 */
    __pyx_t_12 = (__pyx_v_formatted_args != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_formatted_args) != 0);
    if (__pyx_t_12) {

      /* "cymock.pyx":2380
 *     if kwargs_string:
 *         if formatted_args:
 *             formatted_args += ', '             # <<<<<<<<<<<<<<
 *         formatted_args += kwargs_string
 * 
 */
      __pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_formatted_args, __pyx_kp_u__77); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2380, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_formatted_args, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "cymock.pyx":2379
 *         formatted_args = args_string
 *     if kwargs_string:
 *         if formatted_args:             # <<<<<<<<<<<<<<
 *             formatted_args += ', '
 *         formatted_args += kwargs_string
 */
    }

    /* "cymock.pyx":2381
 *         if formatted_args:
 *             formatted_args += ', '
 *         formatted_args += kwargs_string             # <<<<<<<<<<<<<<
 * 
 *     return message % formatted_args
 */
    __pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_formatted_args, __pyx_v_kwargs_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_formatted_args, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cymock.pyx":2378
 *     if args_string:
 *         formatted_args = args_string
 *     if kwargs_string:             # <<<<<<<<<<<<<<
 *         if formatted_args:
 *             formatted_args += ', '
 */
  }

  /* "cymock.pyx":2383
 *         formatted_args += kwargs_string
 * 
 *     return message % formatted_args             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_Format(__pyx_v_message, __pyx_v_formatted_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2369
 * 
 * 
 * def _format_call_signature(name, args, kwargs):             # <<<<<<<<<<<<<<
 *     message = '%s(%%s)' % name
 *     formatted_args = ''
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock._format_call_signature", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XDECREF(__pyx_v_formatted_args);
  __Pyx_XDECREF(__pyx_v_args_string);
  __Pyx_XDECREF(__pyx_v_kwargs_string);
  __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_arg);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_key);
  __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2406
 *     If the _Call has no name then it will match any name.
 *     """
 *     def __new__(cls, value=(), name='', parent=None, two=False,             # <<<<<<<<<<<<<<
 *                 from_kall=True):
 *         args = ()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5_Call_1__new__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_5_Call_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_two = 0;
  CYTHON_UNUSED PyObject *__pyx_v_from_kall = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_value,&__pyx_n_s_name_2,&__pyx_n_s_parent,&__pyx_n_s_two,&__pyx_n_s_from_kall,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_u__31));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_False));

    /* "cymock.pyx":2407
 *     """
 *     def __new__(cls, value=(), name='', parent=None, two=False,
 *                 from_kall=True):             # <<<<<<<<<<<<<<
 *         args = ()
 *         kwargs = {}
 */
    values[5] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_two);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_kall);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 2406, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_value = values[1];
    __pyx_v_name = values[2];
    __pyx_v_parent = values[3];
    __pyx_v_two = values[4];
    __pyx_v_from_kall = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2406, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._Call.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5_Call___new__(__pyx_self, __pyx_v_cls, __pyx_v_value, __pyx_v_name, __pyx_v_parent, __pyx_v_two, __pyx_v_from_kall);

  /* "cymock.pyx":2406
 *     If the _Call has no name then it will match any name.
 *     """
 *     def __new__(cls, value=(), name='', parent=None, two=False,             # <<<<<<<<<<<<<<
 *                 from_kall=True):
 *         args = ()
 */

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

static PyObject *__pyx_pf_6cymock_5_Call___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_parent, PyObject *__pyx_v_two, CYTHON_UNUSED PyObject *__pyx_v_from_kall) {
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_kwargs = NULL;
  Py_ssize_t __pyx_v__len;
  PyObject *__pyx_v_first = NULL;
  PyObject *__pyx_v_second = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("__new__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_INCREF(__pyx_v_name);

  /* "cymock.pyx":2408
 *     def __new__(cls, value=(), name='', parent=None, two=False,
 *                 from_kall=True):
 *         args = ()             # <<<<<<<<<<<<<<
 *         kwargs = {}
 *         _len = len(value)
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_v_args = __pyx_empty_tuple;

  /* "cymock.pyx":2409
 *                 from_kall=True):
 *         args = ()
 *         kwargs = {}             # <<<<<<<<<<<<<<
 *         _len = len(value)
 *         if _len == 3:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_kwargs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2410
 *         args = ()
 *         kwargs = {}
 *         _len = len(value)             # <<<<<<<<<<<<<<
 *         if _len == 3:
 *             name, args, kwargs = value
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2410, __pyx_L1_error)
  __pyx_v__len = __pyx_t_2;

  /* "cymock.pyx":2411
 *         kwargs = {}
 *         _len = len(value)
 *         if _len == 3:             # <<<<<<<<<<<<<<
 *             name, args, kwargs = value
 *         elif _len == 2:
 */
  switch (__pyx_v__len) {
    case 3:

    /* "cymock.pyx":2412
 *         _len = len(value)
 *         if _len == 3:
 *             name, args, kwargs = value             # <<<<<<<<<<<<<<
 *         elif _len == 2:
 *             first, second = value
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_value))) || (PyList_CheckExact(__pyx_v_value))) {
      PyObject* sequence = __pyx_v_value;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2412, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 2412, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L4_unpacking_done;
      __pyx_L3_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2412, __pyx_L1_error)
      __pyx_L4_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":2411
 *         kwargs = {}
 *         _len = len(value)
 *         if _len == 3:             # <<<<<<<<<<<<<<
 *             name, args, kwargs = value
 *         elif _len == 2:
 */
    break;
    case 2:

    /* "cymock.pyx":2414
 *             name, args, kwargs = value
 *         elif _len == 2:
 *             first, second = value             # <<<<<<<<<<<<<<
 *             if isinstance(first, str):
 *                 name = first
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_value))) || (PyList_CheckExact(__pyx_v_value))) {
      PyObject* sequence = __pyx_v_value;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2414, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(0, 2414, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2414, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_v_first = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_second = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cymock.pyx":2415
 *         elif _len == 2:
 *             first, second = value
 *             if isinstance(first, str):             # <<<<<<<<<<<<<<
 *                 name = first
 *                 if isinstance(second, tuple):
 */
    __pyx_t_7 = PyUnicode_Check(__pyx_v_first); 
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "cymock.pyx":2416
 *             first, second = value
 *             if isinstance(first, str):
 *                 name = first             # <<<<<<<<<<<<<<
 *                 if isinstance(second, tuple):
 *                     args = second
 */
      __Pyx_INCREF(__pyx_v_first);
      __Pyx_DECREF_SET(__pyx_v_name, __pyx_v_first);

      /* "cymock.pyx":2417
 *             if isinstance(first, str):
 *                 name = first
 *                 if isinstance(second, tuple):             # <<<<<<<<<<<<<<
 *                     args = second
 *                 else:
 */
      __pyx_t_8 = PyTuple_Check(__pyx_v_second); 
      __pyx_t_7 = (__pyx_t_8 != 0);
      if (__pyx_t_7) {

        /* "cymock.pyx":2418
 *                 name = first
 *                 if isinstance(second, tuple):
 *                     args = second             # <<<<<<<<<<<<<<
 *                 else:
 *                     kwargs = second
 */
        __Pyx_INCREF(__pyx_v_second);
        __Pyx_DECREF_SET(__pyx_v_args, __pyx_v_second);

        /* "cymock.pyx":2417
 *             if isinstance(first, str):
 *                 name = first
 *                 if isinstance(second, tuple):             # <<<<<<<<<<<<<<
 *                     args = second
 *                 else:
 */
        goto __pyx_L8;
      }

      /* "cymock.pyx":2420
 *                     args = second
 *                 else:
 *                     kwargs = second             # <<<<<<<<<<<<<<
 *             else:
 *                 args, kwargs = first, second
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_v_second);
        __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_v_second);
      }
      __pyx_L8:;

      /* "cymock.pyx":2415
 *         elif _len == 2:
 *             first, second = value
 *             if isinstance(first, str):             # <<<<<<<<<<<<<<
 *                 name = first
 *                 if isinstance(second, tuple):
 */
      goto __pyx_L7;
    }

    /* "cymock.pyx":2422
 *                     kwargs = second
 *             else:
 *                 args, kwargs = first, second             # <<<<<<<<<<<<<<
 *         elif _len == 1:
 *             value, = value
 */
    /*else*/ {
      __pyx_t_3 = __pyx_v_first;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = __pyx_v_second;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L7:;

    /* "cymock.pyx":2413
 *         if _len == 3:
 *             name, args, kwargs = value
 *         elif _len == 2:             # <<<<<<<<<<<<<<
 *             first, second = value
 *             if isinstance(first, str):
 */
    break;
    case 1:

    /* "cymock.pyx":2424
 *                 args, kwargs = first, second
 *         elif _len == 1:
 *             value, = value             # <<<<<<<<<<<<<<
 *             if isinstance(value, str):
 *                 name = value
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_value))) || (PyList_CheckExact(__pyx_v_value))) {
      PyObject* sequence = __pyx_v_value;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 1)) {
        if (size > 1) __Pyx_RaiseTooManyValuesError(1);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2424, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      }
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_3 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 1) < 0) __PYX_ERR(0, 2424, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2424, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":2425
 *         elif _len == 1:
 *             value, = value
 *             if isinstance(value, str):             # <<<<<<<<<<<<<<
 *                 name = value
 *             elif isinstance(value, tuple):
 */
    __pyx_t_7 = PyUnicode_Check(__pyx_v_value); 
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "cymock.pyx":2426
 *             value, = value
 *             if isinstance(value, str):
 *                 name = value             # <<<<<<<<<<<<<<
 *             elif isinstance(value, tuple):
 *                 args = value
 */
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_DECREF_SET(__pyx_v_name, __pyx_v_value);

      /* "cymock.pyx":2425
 *         elif _len == 1:
 *             value, = value
 *             if isinstance(value, str):             # <<<<<<<<<<<<<<
 *                 name = value
 *             elif isinstance(value, tuple):
 */
      goto __pyx_L11;
    }

    /* "cymock.pyx":2427
 *             if isinstance(value, str):
 *                 name = value
 *             elif isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *                 args = value
 *             else:
 */
    __pyx_t_8 = PyTuple_Check(__pyx_v_value); 
    __pyx_t_7 = (__pyx_t_8 != 0);
    if (__pyx_t_7) {

      /* "cymock.pyx":2428
 *                 name = value
 *             elif isinstance(value, tuple):
 *                 args = value             # <<<<<<<<<<<<<<
 *             else:
 *                 kwargs = value
 */
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_v_value);

      /* "cymock.pyx":2427
 *             if isinstance(value, str):
 *                 name = value
 *             elif isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *                 args = value
 *             else:
 */
      goto __pyx_L11;
    }

    /* "cymock.pyx":2430
 *                 args = value
 *             else:
 *                 kwargs = value             # <<<<<<<<<<<<<<
 * 
 *         if two:
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_v_value);
    }
    __pyx_L11:;

    /* "cymock.pyx":2423
 *             else:
 *                 args, kwargs = first, second
 *         elif _len == 1:             # <<<<<<<<<<<<<<
 *             value, = value
 *             if isinstance(value, str):
 */
    break;
    default: break;
  }

  /* "cymock.pyx":2432
 *                 kwargs = value
 * 
 *         if two:             # <<<<<<<<<<<<<<
 *             return tuple.__new__(cls, (args, kwargs))
 * 
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_two); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 2432, __pyx_L1_error)
  if (__pyx_t_7) {

    /* "cymock.pyx":2433
 * 
 *         if two:
 *             return tuple.__new__(cls, (args, kwargs))             # <<<<<<<<<<<<<<
 * 
 *         return tuple.__new__(cls, (name, args, kwargs))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_args);
    __Pyx_INCREF(__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_kwargs);
    __pyx_t_5 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_cls, __pyx_t_1};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2433, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_cls, __pyx_t_1};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2433, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_cls);
      __Pyx_GIVEREF(__pyx_v_cls);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_cls);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":2432
 *                 kwargs = value
 * 
 *         if two:             # <<<<<<<<<<<<<<
 *             return tuple.__new__(cls, (args, kwargs))
 * 
 */
  }

  /* "cymock.pyx":2435
 *             return tuple.__new__(cls, (args, kwargs))
 * 
 *         return tuple.__new__(cls, (name, args, kwargs))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_name);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_kwargs);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_cls, __pyx_t_10};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_cls, __pyx_t_10};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_cls);
    __Pyx_GIVEREF(__pyx_v_cls);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_cls);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2406
 *     If the _Call has no name then it will match any name.
 *     """
 *     def __new__(cls, value=(), name='', parent=None, two=False,             # <<<<<<<<<<<<<<
 *                 from_kall=True):
 *         args = ()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cymock._Call.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_first);
  __Pyx_XDECREF(__pyx_v_second);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2438
 * 
 * 
 *     def __init__(self, value=(), name=None, parent=None, two=False,             # <<<<<<<<<<<<<<
 *                  from_kall=True):
 *         self._mock_name = name
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_3__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_3__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5_Call_3__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_5_Call_3__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_parent = 0;
  CYTHON_UNUSED PyObject *__pyx_v_two = 0;
  PyObject *__pyx_v_from_kall = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,&__pyx_n_s_name_2,&__pyx_n_s_parent,&__pyx_n_s_two,&__pyx_n_s_from_kall,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_False));

    /* "cymock.pyx":2439
 * 
 *     def __init__(self, value=(), name=None, parent=None, two=False,
 *                  from_kall=True):             # <<<<<<<<<<<<<<
 *         self._mock_name = name
 *         self._mock_parent = parent
 */
    values[5] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_two);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_kall);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2438, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_value = values[1];
    __pyx_v_name = values[2];
    __pyx_v_parent = values[3];
    __pyx_v_two = values[4];
    __pyx_v_from_kall = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2438, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._Call.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5_Call_2__init__(__pyx_self, __pyx_v_self, __pyx_v_value, __pyx_v_name, __pyx_v_parent, __pyx_v_two, __pyx_v_from_kall);

  /* "cymock.pyx":2438
 * 
 * 
 *     def __init__(self, value=(), name=None, parent=None, two=False,             # <<<<<<<<<<<<<<
 *                  from_kall=True):
 *         self._mock_name = name
 */

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

static PyObject *__pyx_pf_6cymock_5_Call_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value, PyObject *__pyx_v_name, PyObject *__pyx_v_parent, CYTHON_UNUSED PyObject *__pyx_v_two, PyObject *__pyx_v_from_kall) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":2440
 *     def __init__(self, value=(), name=None, parent=None, two=False,
 *                  from_kall=True):
 *         self._mock_name = name             # <<<<<<<<<<<<<<
 *         self._mock_parent = parent
 *         self._mock_from_kall = from_kall
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mock_name, __pyx_v_name) < 0) __PYX_ERR(0, 2440, __pyx_L1_error)

  /* "cymock.pyx":2441
 *                  from_kall=True):
 *         self._mock_name = name
 *         self._mock_parent = parent             # <<<<<<<<<<<<<<
 *         self._mock_from_kall = from_kall
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mock_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 2441, __pyx_L1_error)

  /* "cymock.pyx":2442
 *         self._mock_name = name
 *         self._mock_parent = parent
 *         self._mock_from_kall = from_kall             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mock_from_kall, __pyx_v_from_kall) < 0) __PYX_ERR(0, 2442, __pyx_L1_error)

  /* "cymock.pyx":2438
 * 
 * 
 *     def __init__(self, value=(), name=None, parent=None, two=False,             # <<<<<<<<<<<<<<
 *                  from_kall=True):
 *         self._mock_name = name
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock._Call.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2445
 * 
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if other is ANY:
 *             return True
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_5__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_5__eq__ = {"__eq__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5_Call_5__eq__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_5_Call_5__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 2445, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 2445, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2445, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._Call.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5_Call_4__eq__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_6cymock_5_Call_4__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  Py_ssize_t __pyx_v_len_other;
  PyObject *__pyx_v_self_name = NULL;
  PyObject *__pyx_v_self_args = NULL;
  PyObject *__pyx_v_self_kwargs = NULL;
  PyObject *__pyx_v_other_name = NULL;
  PyObject *__pyx_v_other_args = NULL;
  PyObject *__pyx_v_other_kwargs = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_first = NULL;
  PyObject *__pyx_v_second = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "cymock.pyx":2446
 * 
 *     def __eq__(self, other):
 *         if other is ANY:             # <<<<<<<<<<<<<<
 *             return True
 *         try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ANY_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_other == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":2447
 *     def __eq__(self, other):
 *         if other is ANY:
 *             return True             # <<<<<<<<<<<<<<
 *         try:
 *             len_other = len(other)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "cymock.pyx":2446
 * 
 *     def __eq__(self, other):
 *         if other is ANY:             # <<<<<<<<<<<<<<
 *             return True
 *         try:
 */
  }

  /* "cymock.pyx":2448
 *         if other is ANY:
 *             return True
 *         try:             # <<<<<<<<<<<<<<
 *             len_other = len(other)
 *         except TypeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "cymock.pyx":2449
 *             return True
 *         try:
 *             len_other = len(other)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return False
 */
      __pyx_t_7 = PyObject_Length(__pyx_v_other); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2449, __pyx_L4_error)
      __pyx_v_len_other = __pyx_t_7;

      /* "cymock.pyx":2448
 *         if other is ANY:
 *             return True
 *         try:             # <<<<<<<<<<<<<<
 *             len_other = len(other)
 *         except TypeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":2450
 *         try:
 *             len_other = len(other)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("cymock._Call.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 2450, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_10);

      /* "cymock.pyx":2451
 *             len_other = len(other)
 *         except TypeError:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         self_name = ''
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L7_except_return;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "cymock.pyx":2448
 *         if other is ANY:
 *             return True
 *         try:             # <<<<<<<<<<<<<<
 *             len_other = len(other)
 *         except TypeError:
 */
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L7_except_return:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
    __pyx_L9_try_end:;
  }

  /* "cymock.pyx":2453
 *             return False
 * 
 *         self_name = ''             # <<<<<<<<<<<<<<
 *         if len(self) == 2:
 *             self_args, self_kwargs = self
 */
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_v_self_name = __pyx_kp_u__31;

  /* "cymock.pyx":2454
 * 
 *         self_name = ''
 *         if len(self) == 2:             # <<<<<<<<<<<<<<
 *             self_args, self_kwargs = self
 *         else:
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2454, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_7 == 2) != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":2455
 *         self_name = ''
 *         if len(self) == 2:
 *             self_args, self_kwargs = self             # <<<<<<<<<<<<<<
 *         else:
 *             self_name, self_args, self_kwargs = self
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_self))) || (PyList_CheckExact(__pyx_v_self))) {
      PyObject* sequence = __pyx_v_self;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2455, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_9);
      #else
      __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_10 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_1), 2) < 0) __PYX_ERR(0, 2455, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L14_unpacking_done;
      __pyx_L13_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2455, __pyx_L1_error)
      __pyx_L14_unpacking_done:;
    }
    __pyx_v_self_args = __pyx_t_10;
    __pyx_t_10 = 0;
    __pyx_v_self_kwargs = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "cymock.pyx":2454
 * 
 *         self_name = ''
 *         if len(self) == 2:             # <<<<<<<<<<<<<<
 *             self_args, self_kwargs = self
 *         else:
 */
    goto __pyx_L12;
  }

  /* "cymock.pyx":2457
 *             self_args, self_kwargs = self
 *         else:
 *             self_name, self_args, self_kwargs = self             # <<<<<<<<<<<<<<
 * 
 *         if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)
 */
  /*else*/ {
    if ((likely(PyTuple_CheckExact(__pyx_v_self))) || (PyList_CheckExact(__pyx_v_self))) {
      PyObject* sequence = __pyx_v_self;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2457, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_12 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = Py_TYPE(__pyx_t_12)->tp_iternext;
      index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      index = 2; __pyx_t_1 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_12), 3) < 0) __PYX_ERR(0, 2457, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2457, __pyx_L1_error)
      __pyx_L16_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_self_name, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_v_self_args = __pyx_t_10;
    __pyx_t_10 = 0;
    __pyx_v_self_kwargs = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L12:;

  /* "cymock.pyx":2459
 *             self_name, self_args, self_kwargs = self
 * 
 *         if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)             # <<<<<<<<<<<<<<
 *                 and self._mock_parent != other._mock_parent):
 *             return False
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_self, __pyx_n_u_mock_parent, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cymock.pyx":2460
 * 
 *         if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)
 *                 and self._mock_parent != other._mock_parent):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_u_mock_parent, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymock.pyx":2459
 *             self_name, self_args, self_kwargs = self
 * 
 *         if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)             # <<<<<<<<<<<<<<
 *                 and self._mock_parent != other._mock_parent):
 *             return False
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L18_bool_binop_done;
  }

  /* "cymock.pyx":2460
 * 
 *         if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)
 *                 and self._mock_parent != other._mock_parent):             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_mock_parent); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_3 = __pyx_t_2;
  __pyx_L18_bool_binop_done:;

  /* "cymock.pyx":2459
 *             self_name, self_args, self_kwargs = self
 * 
 *         if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)             # <<<<<<<<<<<<<<
 *                 and self._mock_parent != other._mock_parent):
 *             return False
 */
  if (__pyx_t_3) {

    /* "cymock.pyx":2461
 *         if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)
 *                 and self._mock_parent != other._mock_parent):
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         other_name = ''
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cymock.pyx":2459
 *             self_name, self_args, self_kwargs = self
 * 
 *         if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)             # <<<<<<<<<<<<<<
 *                 and self._mock_parent != other._mock_parent):
 *             return False
 */
  }

  /* "cymock.pyx":2463
 *             return False
 * 
 *         other_name = ''             # <<<<<<<<<<<<<<
 *         if len_other == 0:
 *             other_args, other_kwargs = (), {}
 */
  __Pyx_INCREF(__pyx_kp_u__31);
  __pyx_v_other_name = __pyx_kp_u__31;

  /* "cymock.pyx":2464
 * 
 *         other_name = ''
 *         if len_other == 0:             # <<<<<<<<<<<<<<
 *             other_args, other_kwargs = (), {}
 *         elif len_other == 3:
 */
  switch (__pyx_v_len_other) {
    case 0:

    /* "cymock.pyx":2465
 *         other_name = ''
 *         if len_other == 0:
 *             other_args, other_kwargs = (), {}             # <<<<<<<<<<<<<<
 *         elif len_other == 3:
 *             other_name, other_args, other_kwargs = other
 */
    __pyx_t_9 = __pyx_empty_tuple;
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_v_other_args = __pyx_t_9;
    __pyx_t_9 = 0;
    __pyx_v_other_kwargs = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "cymock.pyx":2464
 * 
 *         other_name = ''
 *         if len_other == 0:             # <<<<<<<<<<<<<<
 *             other_args, other_kwargs = (), {}
 *         elif len_other == 3:
 */
    break;
    case 3:

    /* "cymock.pyx":2467
 *             other_args, other_kwargs = (), {}
 *         elif len_other == 3:
 *             other_name, other_args, other_kwargs = other             # <<<<<<<<<<<<<<
 *         elif len_other == 1:
 *             value, = other
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) {
      PyObject* sequence = __pyx_v_other;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2467, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_12 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = Py_TYPE(__pyx_t_12)->tp_iternext;
      index = 0; __pyx_t_10 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L21_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_9)) goto __pyx_L21_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 2; __pyx_t_1 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L21_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_12), 3) < 0) __PYX_ERR(0, 2467, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L22_unpacking_done;
      __pyx_L21_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2467, __pyx_L1_error)
      __pyx_L22_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_other_name, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_v_other_args = __pyx_t_9;
    __pyx_t_9 = 0;
    __pyx_v_other_kwargs = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2466
 *         if len_other == 0:
 *             other_args, other_kwargs = (), {}
 *         elif len_other == 3:             # <<<<<<<<<<<<<<
 *             other_name, other_args, other_kwargs = other
 *         elif len_other == 1:
 */
    break;
    case 1:

    /* "cymock.pyx":2469
 *             other_name, other_args, other_kwargs = other
 *         elif len_other == 1:
 *             value, = other             # <<<<<<<<<<<<<<
 *             if isinstance(value, tuple):
 *                 other_args = value
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) {
      PyObject* sequence = __pyx_v_other;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 1)) {
        if (size > 1) __Pyx_RaiseTooManyValuesError(1);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2469, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      }
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L23_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 1) < 0) __PYX_ERR(0, 2469, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L24_unpacking_done;
      __pyx_L23_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2469, __pyx_L1_error)
      __pyx_L24_unpacking_done:;
    }
    __pyx_v_value = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2470
 *         elif len_other == 1:
 *             value, = other
 *             if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *                 other_args = value
 *                 other_kwargs = {}
 */
    __pyx_t_3 = PyTuple_Check(__pyx_v_value); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "cymock.pyx":2471
 *             value, = other
 *             if isinstance(value, tuple):
 *                 other_args = value             # <<<<<<<<<<<<<<
 *                 other_kwargs = {}
 *             elif isinstance(value, str):
 */
      __Pyx_INCREF(__pyx_v_value);
      __pyx_v_other_args = __pyx_v_value;

      /* "cymock.pyx":2472
 *             if isinstance(value, tuple):
 *                 other_args = value
 *                 other_kwargs = {}             # <<<<<<<<<<<<<<
 *             elif isinstance(value, str):
 *                 other_name = value
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_other_kwargs = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cymock.pyx":2470
 *         elif len_other == 1:
 *             value, = other
 *             if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *                 other_args = value
 *                 other_kwargs = {}
 */
      goto __pyx_L25;
    }

    /* "cymock.pyx":2473
 *                 other_args = value
 *                 other_kwargs = {}
 *             elif isinstance(value, str):             # <<<<<<<<<<<<<<
 *                 other_name = value
 *                 other_args, other_kwargs = (), {}
 */
    __pyx_t_2 = PyUnicode_Check(__pyx_v_value); 
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cymock.pyx":2474
 *                 other_kwargs = {}
 *             elif isinstance(value, str):
 *                 other_name = value             # <<<<<<<<<<<<<<
 *                 other_args, other_kwargs = (), {}
 *             else:
 */
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_DECREF_SET(__pyx_v_other_name, __pyx_v_value);

      /* "cymock.pyx":2475
 *             elif isinstance(value, str):
 *                 other_name = value
 *                 other_args, other_kwargs = (), {}             # <<<<<<<<<<<<<<
 *             else:
 *                 other_args = ()
 */
      __pyx_t_1 = __pyx_empty_tuple;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_v_other_args = __pyx_t_1;
      __pyx_t_1 = 0;
      __pyx_v_other_kwargs = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "cymock.pyx":2473
 *                 other_args = value
 *                 other_kwargs = {}
 *             elif isinstance(value, str):             # <<<<<<<<<<<<<<
 *                 other_name = value
 *                 other_args, other_kwargs = (), {}
 */
      goto __pyx_L25;
    }

    /* "cymock.pyx":2477
 *                 other_args, other_kwargs = (), {}
 *             else:
 *                 other_args = ()             # <<<<<<<<<<<<<<
 *                 other_kwargs = value
 *         elif len_other == 2:
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_empty_tuple);
      __pyx_v_other_args = __pyx_empty_tuple;

      /* "cymock.pyx":2478
 *             else:
 *                 other_args = ()
 *                 other_kwargs = value             # <<<<<<<<<<<<<<
 *         elif len_other == 2:
 *             # could be (name, args) or (name, kwargs) or (args, kwargs)
 */
      __Pyx_INCREF(__pyx_v_value);
      __pyx_v_other_kwargs = __pyx_v_value;
    }
    __pyx_L25:;

    /* "cymock.pyx":2468
 *         elif len_other == 3:
 *             other_name, other_args, other_kwargs = other
 *         elif len_other == 1:             # <<<<<<<<<<<<<<
 *             value, = other
 *             if isinstance(value, tuple):
 */
    break;
    case 2:

    /* "cymock.pyx":2481
 *         elif len_other == 2:
 *             # could be (name, args) or (name, kwargs) or (args, kwargs)
 *             first, second = other             # <<<<<<<<<<<<<<
 *             if isinstance(first, str):
 *                 other_name = first
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) {
      PyObject* sequence = __pyx_v_other;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2481, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L26_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L26_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 2481, __pyx_L1_error)
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L27_unpacking_done;
      __pyx_L26_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2481, __pyx_L1_error)
      __pyx_L27_unpacking_done:;
    }
    __pyx_v_first = __pyx_t_9;
    __pyx_t_9 = 0;
    __pyx_v_second = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2482
 *             # could be (name, args) or (name, kwargs) or (args, kwargs)
 *             first, second = other
 *             if isinstance(first, str):             # <<<<<<<<<<<<<<
 *                 other_name = first
 *                 if isinstance(second, tuple):
 */
    __pyx_t_3 = PyUnicode_Check(__pyx_v_first); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "cymock.pyx":2483
 *             first, second = other
 *             if isinstance(first, str):
 *                 other_name = first             # <<<<<<<<<<<<<<
 *                 if isinstance(second, tuple):
 *                     other_args, other_kwargs = second, {}
 */
      __Pyx_INCREF(__pyx_v_first);
      __Pyx_DECREF_SET(__pyx_v_other_name, __pyx_v_first);

      /* "cymock.pyx":2484
 *             if isinstance(first, str):
 *                 other_name = first
 *                 if isinstance(second, tuple):             # <<<<<<<<<<<<<<
 *                     other_args, other_kwargs = second, {}
 *                 else:
 */
      __pyx_t_2 = PyTuple_Check(__pyx_v_second); 
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "cymock.pyx":2485
 *                 other_name = first
 *                 if isinstance(second, tuple):
 *                     other_args, other_kwargs = second, {}             # <<<<<<<<<<<<<<
 *                 else:
 *                     other_args, other_kwargs = (), second
 */
        __pyx_t_1 = __pyx_v_second;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2485, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_v_other_args = __pyx_t_1;
        __pyx_t_1 = 0;
        __pyx_v_other_kwargs = __pyx_t_9;
        __pyx_t_9 = 0;

        /* "cymock.pyx":2484
 *             if isinstance(first, str):
 *                 other_name = first
 *                 if isinstance(second, tuple):             # <<<<<<<<<<<<<<
 *                     other_args, other_kwargs = second, {}
 *                 else:
 */
        goto __pyx_L29;
      }

      /* "cymock.pyx":2487
 *                     other_args, other_kwargs = second, {}
 *                 else:
 *                     other_args, other_kwargs = (), second             # <<<<<<<<<<<<<<
 *             else:
 *                 other_args, other_kwargs = first, second
 */
      /*else*/ {
        __pyx_t_9 = __pyx_empty_tuple;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_1 = __pyx_v_second;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_v_other_args = __pyx_t_9;
        __pyx_t_9 = 0;
        __pyx_v_other_kwargs = __pyx_t_1;
        __pyx_t_1 = 0;
      }
      __pyx_L29:;

      /* "cymock.pyx":2482
 *             # could be (name, args) or (name, kwargs) or (args, kwargs)
 *             first, second = other
 *             if isinstance(first, str):             # <<<<<<<<<<<<<<
 *                 other_name = first
 *                 if isinstance(second, tuple):
 */
      goto __pyx_L28;
    }

    /* "cymock.pyx":2489
 *                     other_args, other_kwargs = (), second
 *             else:
 *                 other_args, other_kwargs = first, second             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    /*else*/ {
      __pyx_t_1 = __pyx_v_first;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = __pyx_v_second;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_v_other_args = __pyx_t_1;
      __pyx_t_1 = 0;
      __pyx_v_other_kwargs = __pyx_t_9;
      __pyx_t_9 = 0;
    }
    __pyx_L28:;

    /* "cymock.pyx":2479
 *                 other_args = ()
 *                 other_kwargs = value
 *         elif len_other == 2:             # <<<<<<<<<<<<<<
 *             # could be (name, args) or (name, kwargs) or (args, kwargs)
 *             first, second = other
 */
    break;
    default:

    /* "cymock.pyx":2491
 *                 other_args, other_kwargs = first, second
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if self_name and other_name != self_name:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
    break;
  }

  /* "cymock.pyx":2493
 *             return False
 * 
 *         if self_name and other_name != self_name:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2493, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L31_bool_binop_done;
  }
  __pyx_t_9 = PyObject_RichCompare(__pyx_v_other_name, __pyx_v_self_name, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_3 = __pyx_t_2;
  __pyx_L31_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cymock.pyx":2494
 * 
 *         if self_name and other_name != self_name:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # this order is important for ANY to work!
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cymock.pyx":2493
 *             return False
 * 
 *         if self_name and other_name != self_name:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "cymock.pyx":2497
 * 
 *         # this order is important for ANY to work!
 *         return (other_args, other_kwargs) == (self_args, self_kwargs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_other_args);
  __Pyx_GIVEREF(__pyx_v_other_args);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_other_args);
  __Pyx_INCREF(__pyx_v_other_kwargs);
  __Pyx_GIVEREF(__pyx_v_other_kwargs);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_other_kwargs);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self_args);
  __Pyx_GIVEREF(__pyx_v_self_args);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self_args);
  __Pyx_INCREF(__pyx_v_self_kwargs);
  __Pyx_GIVEREF(__pyx_v_self_kwargs);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self_kwargs);
  __pyx_t_10 = PyObject_RichCompare(__pyx_t_9, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2497, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2445
 * 
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if other is ANY:
 *             return True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cymock._Call.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_self_name);
  __Pyx_XDECREF(__pyx_v_self_args);
  __Pyx_XDECREF(__pyx_v_self_kwargs);
  __Pyx_XDECREF(__pyx_v_other_name);
  __Pyx_XDECREF(__pyx_v_other_args);
  __Pyx_XDECREF(__pyx_v_other_kwargs);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_first);
  __Pyx_XDECREF(__pyx_v_second);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2503
 * 
 * 
 *     def __call__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         if self._mock_name is None:
 *             return _Call(('', args, kwargs), name='()')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_7__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_7__call__ = {"__call__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5_Call_7__call__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_5_Call_7__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__call__") < 0)) __PYX_ERR(0, 2503, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2503, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock._Call.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5_Call_6__call__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_5_Call_6__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "cymock.pyx":2504
 * 
 *     def __call__(self, *args, **kwargs):
 *         if self._mock_name is None:             # <<<<<<<<<<<<<<
 *             return _Call(('', args, kwargs), name='()')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":2505
 *     def __call__(self, *args, **kwargs):
 *         if self._mock_name is None:
 *             return _Call(('', args, kwargs), name='()')             # <<<<<<<<<<<<<<
 * 
 *         name = self._mock_name + '()'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Call); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_kp_u__31);
    __Pyx_GIVEREF(__pyx_kp_u__31);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u__31);
    __Pyx_INCREF(__pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args);
    __Pyx_INCREF(__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kwargs);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name_2, __pyx_kp_u__32) < 0) __PYX_ERR(0, 2505, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":2504
 * 
 *     def __call__(self, *args, **kwargs):
 *         if self._mock_name is None:             # <<<<<<<<<<<<<<
 *             return _Call(('', args, kwargs), name='()')
 * 
 */
  }

  /* "cymock.pyx":2507
 *             return _Call(('', args, kwargs), name='()')
 * 
 *         name = self._mock_name + '()'             # <<<<<<<<<<<<<<
 *         return _Call((self._mock_name, args, kwargs), name=name, parent=self)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_name = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cymock.pyx":2508
 * 
 *         name = self._mock_name + '()'
 *         return _Call((self._mock_name, args, kwargs), name=name, parent=self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Call); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_kwargs);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_parent, __pyx_v_self) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2503
 * 
 * 
 *     def __call__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         if self._mock_name is None:
 *             return _Call(('', args, kwargs), name='()')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cymock._Call.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2511
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         if self._mock_name is None:
 *             return _Call(name=attr, from_kall=False)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_9__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_9__getattr__ = {"__getattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5_Call_9__getattr__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_5_Call_9__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_attr = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attr,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 2511, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 2511, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_attr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2511, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._Call.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5_Call_8__getattr__(__pyx_self, __pyx_v_self, __pyx_v_attr);

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

static PyObject *__pyx_pf_6cymock_5_Call_8__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "cymock.pyx":2512
 * 
 *     def __getattr__(self, attr):
 *         if self._mock_name is None:             # <<<<<<<<<<<<<<
 *             return _Call(name=attr, from_kall=False)
 *         name = '%s.%s' % (self._mock_name, attr)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":2513
 *     def __getattr__(self, attr):
 *         if self._mock_name is None:
 *             return _Call(name=attr, from_kall=False)             # <<<<<<<<<<<<<<
 *         name = '%s.%s' % (self._mock_name, attr)
 *         return _Call(name=name, parent=self, from_kall=False)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Call); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_name_2, __pyx_v_attr) < 0) __PYX_ERR(0, 2513, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_from_kall, Py_False) < 0) __PYX_ERR(0, 2513, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":2512
 * 
 *     def __getattr__(self, attr):
 *         if self._mock_name is None:             # <<<<<<<<<<<<<<
 *             return _Call(name=attr, from_kall=False)
 *         name = '%s.%s' % (self._mock_name, attr)
 */
  }

  /* "cymock.pyx":2514
 *         if self._mock_name is None:
 *             return _Call(name=attr, from_kall=False)
 *         name = '%s.%s' % (self._mock_name, attr)             # <<<<<<<<<<<<<<
 *         return _Call(name=name, parent=self, from_kall=False)
 * 
 */
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 0;
  __pyx_t_7 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__33);
  __pyx_t_6 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__33);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u__33);
  __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_attr), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
  __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2515
 *             return _Call(name=attr, from_kall=False)
 *         name = '%s.%s' % (self._mock_name, attr)
 *         return _Call(name=name, parent=self, from_kall=False)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Call); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 2515, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_parent, __pyx_v_self) < 0) __PYX_ERR(0, 2515, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_from_kall, Py_False) < 0) __PYX_ERR(0, 2515, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2511
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         if self._mock_name is None:
 *             return _Call(name=attr, from_kall=False)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cymock._Call.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2518
 * 
 * 
 *     def __getattribute__(self, attr):             # <<<<<<<<<<<<<<
 *         if attr in tuple.__dict__:
 *             raise AttributeError
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_11__getattribute__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_11__getattribute__ = {"__getattribute__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5_Call_11__getattribute__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_5_Call_11__getattribute__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_attr = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattribute__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attr,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattribute__", 1, 2, 2, 1); __PYX_ERR(0, 2518, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattribute__") < 0)) __PYX_ERR(0, 2518, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_attr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattribute__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2518, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._Call.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5_Call_10__getattribute__(__pyx_self, __pyx_v_self, __pyx_v_attr);

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

static PyObject *__pyx_pf_6cymock_5_Call_10__getattribute__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__getattribute__", 0);

  /* "cymock.pyx":2519
 * 
 *     def __getattribute__(self, attr):
 *         if attr in tuple.__dict__:             # <<<<<<<<<<<<<<
 *             raise AttributeError
 *         return tuple.__getattribute__(self, attr)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_attr, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2519, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "cymock.pyx":2520
 *     def __getattribute__(self, attr):
 *         if attr in tuple.__dict__:
 *             raise AttributeError             # <<<<<<<<<<<<<<
 *         return tuple.__getattribute__(self, attr)
 * 
 */
    __Pyx_Raise(__pyx_builtin_AttributeError, 0, 0, 0);
    __PYX_ERR(0, 2520, __pyx_L1_error)

    /* "cymock.pyx":2519
 * 
 *     def __getattribute__(self, attr):
 *         if attr in tuple.__dict__:             # <<<<<<<<<<<<<<
 *             raise AttributeError
 *         return tuple.__getattribute__(self, attr)
 */
  }

  /* "cymock.pyx":2521
 *         if attr in tuple.__dict__:
 *             raise AttributeError
 *         return tuple.__getattribute__(self, attr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_getattribute); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_attr};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2521, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_attr};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2521, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_attr);
    __Pyx_GIVEREF(__pyx_v_attr);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_attr);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2518
 * 
 * 
 *     def __getattribute__(self, attr):             # <<<<<<<<<<<<<<
 *         if attr in tuple.__dict__:
 *             raise AttributeError
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._Call.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2524
 * 
 * 
 *     def count(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.__getattr__('count')(*args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_13count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_13count = {"count", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5_Call_13count, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_5_Call_13count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("count (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "count") < 0)) __PYX_ERR(0, 2524, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("count", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2524, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock._Call.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5_Call_12count(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_5_Call_12count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("count", 0);

  /* "cymock.pyx":2525
 * 
 *     def count(self, *args, **kwargs):
 *         return self.__getattr__('count')(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def index(self, *args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_u_count) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_count);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2525, __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;

  /* "cymock.pyx":2524
 * 
 * 
 *     def count(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.__getattr__('count')(*args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._Call.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2527
 *         return self.__getattr__('count')(*args, **kwargs)
 * 
 *     def index(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.__getattr__('index')(*args, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_15index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_15index = {"index", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_5_Call_15index, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_5_Call_15index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("index (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "index") < 0)) __PYX_ERR(0, 2527, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("index", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2527, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock._Call.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_5_Call_14index(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_5_Call_14index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("index", 0);

  /* "cymock.pyx":2528
 * 
 *     def index(self, *args, **kwargs):
 *         return self.__getattr__('index')(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def _get_call_arguments(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_u_index) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_index);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2528, __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;

  /* "cymock.pyx":2527
 *         return self.__getattr__('count')(*args, **kwargs)
 * 
 *     def index(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.__getattr__('index')(*args, **kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._Call.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2530
 *         return self.__getattr__('index')(*args, **kwargs)
 * 
 *     def _get_call_arguments(self):             # <<<<<<<<<<<<<<
 *         if len(self) == 2:
 *             args, kwargs = self
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_17_get_call_arguments(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_17_get_call_arguments = {"_get_call_arguments", (PyCFunction)__pyx_pw_6cymock_5_Call_17_get_call_arguments, METH_O, 0};
static PyObject *__pyx_pw_6cymock_5_Call_17_get_call_arguments(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_call_arguments (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_5_Call_16_get_call_arguments(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_5_Call_16_get_call_arguments(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_kwargs = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_get_call_arguments", 0);

  /* "cymock.pyx":2531
 * 
 *     def _get_call_arguments(self):
 *         if len(self) == 2:             # <<<<<<<<<<<<<<
 *             args, kwargs = self
 *         else:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2531, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 == 2) != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":2532
 *     def _get_call_arguments(self):
 *         if len(self) == 2:
 *             args, kwargs = self             # <<<<<<<<<<<<<<
 *         else:
 *             name, args, kwargs = self
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_self))) || (PyList_CheckExact(__pyx_v_self))) {
      PyObject* sequence = __pyx_v_self;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2532, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2532, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2532, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_args = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_kwargs = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cymock.pyx":2531
 * 
 *     def _get_call_arguments(self):
 *         if len(self) == 2:             # <<<<<<<<<<<<<<
 *             args, kwargs = self
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cymock.pyx":2534
 *             args, kwargs = self
 *         else:
 *             name, args, kwargs = self             # <<<<<<<<<<<<<<
 * 
 *         return args, kwargs
 */
  /*else*/ {
    if ((likely(PyTuple_CheckExact(__pyx_v_self))) || (PyList_CheckExact(__pyx_v_self))) {
      PyObject* sequence = __pyx_v_self;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2534, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 2; __pyx_t_5 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_7), 3) < 0) __PYX_ERR(0, 2534, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2534, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_name = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_args = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_kwargs = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "cymock.pyx":2536
 *             name, args, kwargs = self
 * 
 *         return args, kwargs             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_args);
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_kwargs);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2530
 *         return self.__getattr__('index')(*args, **kwargs)
 * 
 *     def _get_call_arguments(self):             # <<<<<<<<<<<<<<
 *         if len(self) == 2:
 *             args, kwargs = self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._Call._get_call_arguments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2539
 * 
 *     @property
 *     def args(self):             # <<<<<<<<<<<<<<
 *         return self._get_call_arguments()[0]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_19args(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_19args = {"args", (PyCFunction)__pyx_pw_6cymock_5_Call_19args, METH_O, 0};
static PyObject *__pyx_pw_6cymock_5_Call_19args(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("args (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_5_Call_18args(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_5_Call_18args(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("args", 0);

  /* "cymock.pyx":2540
 *     @property
 *     def args(self):
 *         return self._get_call_arguments()[0]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_call_arguments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2540, __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;

  /* "cymock.pyx":2539
 * 
 *     @property
 *     def args(self):             # <<<<<<<<<<<<<<
 *         return self._get_call_arguments()[0]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._Call.args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2543
 * 
 *     @property
 *     def kwargs(self):             # <<<<<<<<<<<<<<
 *         return self._get_call_arguments()[1]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_21kwargs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_21kwargs = {"kwargs", (PyCFunction)__pyx_pw_6cymock_5_Call_21kwargs, METH_O, 0};
static PyObject *__pyx_pw_6cymock_5_Call_21kwargs(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("kwargs (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_5_Call_20kwargs(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_5_Call_20kwargs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("kwargs", 0);

  /* "cymock.pyx":2544
 *     @property
 *     def kwargs(self):
 *         return self._get_call_arguments()[1]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_call_arguments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2544, __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;

  /* "cymock.pyx":2543
 * 
 *     @property
 *     def kwargs(self):             # <<<<<<<<<<<<<<
 *         return self._get_call_arguments()[1]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock._Call.kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2546
 *         return self._get_call_arguments()[1]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if not self._mock_from_kall:
 *             name = self._mock_name or 'call'
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_23__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_5_Call_23__repr__ = {"__repr__", (PyCFunction)__pyx_pw_6cymock_5_Call_23__repr__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_5_Call_23__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_5_Call_22__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_5_Call_22__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_kwargs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "cymock.pyx":2547
 * 
 *     def __repr__(self):
 *         if not self._mock_from_kall:             # <<<<<<<<<<<<<<
 *             name = self._mock_name or 'call'
 *             if name.startswith('()'):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_from_kall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":2548
 *     def __repr__(self):
 *         if not self._mock_from_kall:
 *             name = self._mock_name or 'call'             # <<<<<<<<<<<<<<
 *             if name.startswith('()'):
 *                 name = 'call%s' % name
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mock_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2548, __pyx_L1_error)
    if (!__pyx_t_3) {
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_1 = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __Pyx_INCREF(__pyx_n_u_call_2);
    __pyx_t_1 = __pyx_n_u_call_2;
    __pyx_L4_bool_binop_done:;
    __pyx_v_name = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2549
 *         if not self._mock_from_kall:
 *             name = self._mock_name or 'call'
 *             if name.startswith('()'):             # <<<<<<<<<<<<<<
 *                 name = 'call%s' % name
 *             return name
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u__32) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u__32);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2549, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "cymock.pyx":2550
 *             name = self._mock_name or 'call'
 *             if name.startswith('()'):
 *                 name = 'call%s' % name             # <<<<<<<<<<<<<<
 *             return name
 * 
 */
      __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_call_s, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cymock.pyx":2549
 *         if not self._mock_from_kall:
 *             name = self._mock_name or 'call'
 *             if name.startswith('()'):             # <<<<<<<<<<<<<<
 *                 name = 'call%s' % name
 *             return name
 */
    }

    /* "cymock.pyx":2551
 *             if name.startswith('()'):
 *                 name = 'call%s' % name
 *             return name             # <<<<<<<<<<<<<<
 * 
 *         if len(self) == 2:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_name);
    __pyx_r = __pyx_v_name;
    goto __pyx_L0;

    /* "cymock.pyx":2547
 * 
 *     def __repr__(self):
 *         if not self._mock_from_kall:             # <<<<<<<<<<<<<<
 *             name = self._mock_name or 'call'
 *             if name.startswith('()'):
 */
  }

  /* "cymock.pyx":2553
 *             return name
 * 
 *         if len(self) == 2:             # <<<<<<<<<<<<<<
 *             name = 'call'
 *             args, kwargs = self
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2553, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_6 == 2) != 0);
  if (__pyx_t_3) {

    /* "cymock.pyx":2554
 * 
 *         if len(self) == 2:
 *             name = 'call'             # <<<<<<<<<<<<<<
 *             args, kwargs = self
 *         else:
 */
    __Pyx_INCREF(__pyx_n_u_call_2);
    __pyx_v_name = __pyx_n_u_call_2;

    /* "cymock.pyx":2555
 *         if len(self) == 2:
 *             name = 'call'
 *             args, kwargs = self             # <<<<<<<<<<<<<<
 *         else:
 *             name, args, kwargs = self
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_self))) || (PyList_CheckExact(__pyx_v_self))) {
      PyObject* sequence = __pyx_v_self;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2555, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2555, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2555, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __pyx_v_args = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_kwargs = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cymock.pyx":2553
 *             return name
 * 
 *         if len(self) == 2:             # <<<<<<<<<<<<<<
 *             name = 'call'
 *             args, kwargs = self
 */
    goto __pyx_L7;
  }

  /* "cymock.pyx":2557
 *             args, kwargs = self
 *         else:
 *             name, args, kwargs = self             # <<<<<<<<<<<<<<
 *             if not name:
 *                 name = 'call'
 */
  /*else*/ {
    if ((likely(PyTuple_CheckExact(__pyx_v_self))) || (PyList_CheckExact(__pyx_v_self))) {
      PyObject* sequence = __pyx_v_self;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2557, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_8), 3) < 0) __PYX_ERR(0, 2557, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2557, __pyx_L1_error)
      __pyx_L11_unpacking_done:;
    }
    __pyx_v_name = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_args = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_kwargs = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cymock.pyx":2558
 *         else:
 *             name, args, kwargs = self
 *             if not name:             # <<<<<<<<<<<<<<
 *                 name = 'call'
 *             elif not name.startswith('()'):
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2558, __pyx_L1_error)
    __pyx_t_2 = ((!__pyx_t_3) != 0);
    if (__pyx_t_2) {

      /* "cymock.pyx":2559
 *             name, args, kwargs = self
 *             if not name:
 *                 name = 'call'             # <<<<<<<<<<<<<<
 *             elif not name.startswith('()'):
 *                 name = 'call.%s' % name
 */
      __Pyx_INCREF(__pyx_n_u_call_2);
      __Pyx_DECREF_SET(__pyx_v_name, __pyx_n_u_call_2);

      /* "cymock.pyx":2558
 *         else:
 *             name, args, kwargs = self
 *             if not name:             # <<<<<<<<<<<<<<
 *                 name = 'call'
 *             elif not name.startswith('()'):
 */
      goto __pyx_L12;
    }

    /* "cymock.pyx":2560
 *             if not name:
 *                 name = 'call'
 *             elif not name.startswith('()'):             # <<<<<<<<<<<<<<
 *                 name = 'call.%s' % name
 *             else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_kp_u__32) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u__32);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2560, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = ((!__pyx_t_2) != 0);
    if (__pyx_t_3) {

      /* "cymock.pyx":2561
 *                 name = 'call'
 *             elif not name.startswith('()'):
 *                 name = 'call.%s' % name             # <<<<<<<<<<<<<<
 *             else:
 *                 name = 'call%s' % name
 */
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_call_s_2, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cymock.pyx":2560
 *             if not name:
 *                 name = 'call'
 *             elif not name.startswith('()'):             # <<<<<<<<<<<<<<
 *                 name = 'call.%s' % name
 *             else:
 */
      goto __pyx_L12;
    }

    /* "cymock.pyx":2563
 *                 name = 'call.%s' % name
 *             else:
 *                 name = 'call%s' % name             # <<<<<<<<<<<<<<
 *         return _format_call_signature(name, args, kwargs)
 * 
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_call_s, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L12:;
  }
  __pyx_L7:;

  /* "cymock.pyx":2564
 *             else:
 *                 name = 'call%s' % name
 *         return _format_call_signature(name, args, kwargs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_format_call_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_name, __pyx_v_args, __pyx_v_kwargs};
    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_name, __pyx_v_args, __pyx_v_kwargs};
    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_v_args);
    __Pyx_INCREF(__pyx_v_kwargs);
    __Pyx_GIVEREF(__pyx_v_kwargs);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_9, __pyx_v_kwargs);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2546
 *         return self._get_call_arguments()[1]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if not self._mock_from_kall:
 *             name = self._mock_name or 'call'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cymock._Call.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2567
 * 
 * 
 *     def call_list(self):             # <<<<<<<<<<<<<<
 *         """For a call object that represents multiple calls, `call_list`
 *         returns a list of all the intermediate calls as well as the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_5_Call_25call_list(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6cymock_5_Call_24call_list[] = "For a call object that represents multiple calls, `call_list`\n        returns a list of all the intermediate calls as well as the\n        final call.";
static PyMethodDef __pyx_mdef_6cymock_5_Call_25call_list = {"call_list", (PyCFunction)__pyx_pw_6cymock_5_Call_25call_list, METH_O, __pyx_doc_6cymock_5_Call_24call_list};
static PyObject *__pyx_pw_6cymock_5_Call_25call_list(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_list (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_5_Call_24call_list(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_5_Call_24call_list(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_vals = NULL;
  PyObject *__pyx_v_thing = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("call_list", 0);

  /* "cymock.pyx":2571
 *         returns a list of all the intermediate calls as well as the
 *         final call."""
 *         vals = []             # <<<<<<<<<<<<<<
 *         thing = self
 *         while thing is not None:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vals = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2572
 *         final call."""
 *         vals = []
 *         thing = self             # <<<<<<<<<<<<<<
 *         while thing is not None:
 *             if thing._mock_from_kall:
 */
  __Pyx_INCREF(__pyx_v_self);
  __pyx_v_thing = __pyx_v_self;

  /* "cymock.pyx":2573
 *         vals = []
 *         thing = self
 *         while thing is not None:             # <<<<<<<<<<<<<<
 *             if thing._mock_from_kall:
 *                 vals.append(thing)
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_thing != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (!__pyx_t_3) break;

    /* "cymock.pyx":2574
 *         thing = self
 *         while thing is not None:
 *             if thing._mock_from_kall:             # <<<<<<<<<<<<<<
 *                 vals.append(thing)
 *             thing = thing._mock_parent
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thing, __pyx_n_s_mock_from_kall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2574, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "cymock.pyx":2575
 *         while thing is not None:
 *             if thing._mock_from_kall:
 *                 vals.append(thing)             # <<<<<<<<<<<<<<
 *             thing = thing._mock_parent
 *         return _CallList(reversed(vals))
 */
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_vals, __pyx_v_thing); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2575, __pyx_L1_error)

      /* "cymock.pyx":2574
 *         thing = self
 *         while thing is not None:
 *             if thing._mock_from_kall:             # <<<<<<<<<<<<<<
 *                 vals.append(thing)
 *             thing = thing._mock_parent
 */
    }

    /* "cymock.pyx":2576
 *             if thing._mock_from_kall:
 *                 vals.append(thing)
 *             thing = thing._mock_parent             # <<<<<<<<<<<<<<
 *         return _CallList(reversed(vals))
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thing, __pyx_n_s_mock_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_thing, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "cymock.pyx":2577
 *                 vals.append(thing)
 *             thing = thing._mock_parent
 *         return _CallList(reversed(vals))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CallList); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_v_vals); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2567
 * 
 * 
 *     def call_list(self):             # <<<<<<<<<<<<<<
 *         """For a call object that represents multiple calls, `call_list`
 *         returns a list of all the intermediate calls as well as the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cymock._Call.call_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vals);
  __Pyx_XDECREF(__pyx_v_thing);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2583
 * 
 * 
 * def create_autospec(spec, spec_set=False, instance=False, _parent=None,             # <<<<<<<<<<<<<<
 *                     _name=None, **kwargs):
 *     """Create a mock object using another object as a spec. Attributes on the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_67create_autospec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_66create_autospec[] = "Create a mock object using another object as a spec. Attributes on the\n    mock will use the corresponding attribute on the `spec` object as their\n    spec.\n\n    Functions or methods being mocked will have their arguments checked\n    to check that they are called with the correct signature.\n\n    If `spec_set` is True then attempting to set attributes that don't exist\n    on the spec object will raise an `AttributeError`.\n\n    If a class is used as a spec then the return value of the mock (the\n    instance of the class) will have the same spec. You can use a class as the\n    spec for an instance object by passing `instance=True`. The returned mock\n    will only be callable if instances of the mock are callable.\n\n    `create_autospec` also takes arbitrary keyword arguments that are passed to\n    the constructor of the created mock.";
static PyMethodDef __pyx_mdef_6cymock_67create_autospec = {"create_autospec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_67create_autospec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_66create_autospec};
static PyObject *__pyx_pw_6cymock_67create_autospec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v_instance = 0;
  PyObject *__pyx_v__parent = 0;
  PyObject *__pyx_v__name = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_autospec (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_spec,&__pyx_n_s_spec_set,&__pyx_n_s_instance,&__pyx_n_s_parent_2,&__pyx_n_s_name_3,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)Py_False);
    values[2] = ((PyObject *)Py_False);
    values[3] = ((PyObject *)Py_None);

    /* "cymock.pyx":2584
 * 
 * def create_autospec(spec, spec_set=False, instance=False, _parent=None,
 *                     _name=None, **kwargs):             # <<<<<<<<<<<<<<
 *     """Create a mock object using another object as a spec. Attributes on the
 *     mock will use the corresponding attribute on the `spec` object as their
 */
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_instance);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_2);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_3);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "create_autospec") < 0)) __PYX_ERR(0, 2583, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_spec = values[0];
    __pyx_v_spec_set = values[1];
    __pyx_v_instance = values[2];
    __pyx_v__parent = values[3];
    __pyx_v__name = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_autospec", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2583, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.create_autospec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_66create_autospec(__pyx_self, __pyx_v_spec, __pyx_v_spec_set, __pyx_v_instance, __pyx_v__parent, __pyx_v__name, __pyx_v_kwargs);

  /* "cymock.pyx":2583
 * 
 * 
 * def create_autospec(spec, spec_set=False, instance=False, _parent=None,             # <<<<<<<<<<<<<<
 *                     _name=None, **kwargs):
 *     """Create a mock object using another object as a spec. Attributes on the
 */

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

static PyObject *__pyx_pf_6cymock_66create_autospec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_instance, PyObject *__pyx_v__parent, PyObject *__pyx_v__name, PyObject *__pyx_v_kwargs) {
  int __pyx_v_is_type;
  PyObject *__pyx_v_is_async_func = NULL;
  PyObject *__pyx_v__kwargs = NULL;
  PyObject *__pyx_v_Klass = NULL;
  PyObject *__pyx_v__new_name = NULL;
  PyObject *__pyx_v_mock = NULL;
  PyObject *__pyx_v_entry = NULL;
  PyObject *__pyx_v_original = NULL;
  PyObject *__pyx_v_new = NULL;
  PyObject *__pyx_v_parent = NULL;
  PyObject *__pyx_v_skipfirst = NULL;
  PyObject *__pyx_v_child_klass = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  __Pyx_RefNannySetupContext("create_autospec", 0);
  __Pyx_INCREF(__pyx_v_spec);
  __Pyx_INCREF(__pyx_v__name);
  __Pyx_INCREF(__pyx_v_kwargs);

  /* "cymock.pyx":2602
 *     `create_autospec` also takes arbitrary keyword arguments that are passed to
 *     the constructor of the created mock."""
 *     if _is_list(spec):             # <<<<<<<<<<<<<<
 *         # can't pass a list instance to the mock constructor as it will be
 *         # interpreted as a list of strings
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_spec);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "cymock.pyx":2605
 *         # can't pass a list instance to the mock constructor as it will be
 *         # interpreted as a list of strings
 *         spec = type(spec)             # <<<<<<<<<<<<<<
 * 
 *     is_type = isinstance(spec, type)
 */
    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_spec)));
    __Pyx_DECREF_SET(__pyx_v_spec, ((PyObject *)Py_TYPE(__pyx_v_spec)));

    /* "cymock.pyx":2602
 *     `create_autospec` also takes arbitrary keyword arguments that are passed to
 *     the constructor of the created mock."""
 *     if _is_list(spec):             # <<<<<<<<<<<<<<
 *         # can't pass a list instance to the mock constructor as it will be
 *         # interpreted as a list of strings
 */
  }

  /* "cymock.pyx":2607
 *         spec = type(spec)
 * 
 *     is_type = isinstance(spec, type)             # <<<<<<<<<<<<<<
 *     is_async_func = _is_async_func(spec)
 *     _kwargs = {'spec': spec}
 */
  __pyx_t_4 = PyType_Check(__pyx_v_spec); 
  __pyx_v_is_type = __pyx_t_4;

  /* "cymock.pyx":2608
 * 
 *     is_type = isinstance(spec, type)
 *     is_async_func = _is_async_func(spec)             # <<<<<<<<<<<<<<
 *     _kwargs = {'spec': spec}
 *     if spec_set:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_async_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_spec);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_is_async_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2609
 *     is_type = isinstance(spec, type)
 *     is_async_func = _is_async_func(spec)
 *     _kwargs = {'spec': spec}             # <<<<<<<<<<<<<<
 *     if spec_set:
 *         _kwargs = {'spec_set': spec}
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_spec, __pyx_v_spec) < 0) __PYX_ERR(0, 2609, __pyx_L1_error)
  __pyx_v__kwargs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2610
 *     is_async_func = _is_async_func(spec)
 *     _kwargs = {'spec': spec}
 *     if spec_set:             # <<<<<<<<<<<<<<
 *         _kwargs = {'spec_set': spec}
 *     elif spec is None:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_spec_set); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2610, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "cymock.pyx":2611
 *     _kwargs = {'spec': spec}
 *     if spec_set:
 *         _kwargs = {'spec_set': spec}             # <<<<<<<<<<<<<<
 *     elif spec is None:
 *         # None we mock with a normal mock without a spec
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_spec_set, __pyx_v_spec) < 0) __PYX_ERR(0, 2611, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v__kwargs, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cymock.pyx":2610
 *     is_async_func = _is_async_func(spec)
 *     _kwargs = {'spec': spec}
 *     if spec_set:             # <<<<<<<<<<<<<<
 *         _kwargs = {'spec_set': spec}
 *     elif spec is None:
 */
    goto __pyx_L4;
  }

  /* "cymock.pyx":2612
 *     if spec_set:
 *         _kwargs = {'spec_set': spec}
 *     elif spec is None:             # <<<<<<<<<<<<<<
 *         # None we mock with a normal mock without a spec
 *         _kwargs = {}
 */
  __pyx_t_4 = (__pyx_v_spec == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":2614
 *     elif spec is None:
 *         # None we mock with a normal mock without a spec
 *         _kwargs = {}             # <<<<<<<<<<<<<<
 *     if _kwargs and instance:
 *         _kwargs['_spec_as_instance'] = True
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v__kwargs, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cymock.pyx":2612
 *     if spec_set:
 *         _kwargs = {'spec_set': spec}
 *     elif spec is None:             # <<<<<<<<<<<<<<
 *         # None we mock with a normal mock without a spec
 *         _kwargs = {}
 */
  }
  __pyx_L4:;

  /* "cymock.pyx":2615
 *         # None we mock with a normal mock without a spec
 *         _kwargs = {}
 *     if _kwargs and instance:             # <<<<<<<<<<<<<<
 *         _kwargs['_spec_as_instance'] = True
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__kwargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2615, __pyx_L1_error)
  if (__pyx_t_4) {
  } else {
    __pyx_t_5 = __pyx_t_4;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_instance); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_4;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_5) {

    /* "cymock.pyx":2616
 *         _kwargs = {}
 *     if _kwargs and instance:
 *         _kwargs['_spec_as_instance'] = True             # <<<<<<<<<<<<<<
 * 
 *     _kwargs.update(kwargs)
 */
    if (unlikely(PyDict_SetItem(__pyx_v__kwargs, __pyx_n_u_spec_as_instance, Py_True) < 0)) __PYX_ERR(0, 2616, __pyx_L1_error)

    /* "cymock.pyx":2615
 *         # None we mock with a normal mock without a spec
 *         _kwargs = {}
 *     if _kwargs and instance:             # <<<<<<<<<<<<<<
 *         _kwargs['_spec_as_instance'] = True
 * 
 */
  }

  /* "cymock.pyx":2618
 *         _kwargs['_spec_as_instance'] = True
 * 
 *     _kwargs.update(kwargs)             # <<<<<<<<<<<<<<
 * 
 *     Klass = MagicMock
 */
  __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v__kwargs, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2620
 *     _kwargs.update(kwargs)
 * 
 *     Klass = MagicMock             # <<<<<<<<<<<<<<
 *     if inspect.isdatadescriptor(spec):
 *         # descriptors don't have a spec
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Klass = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2621
 * 
 *     Klass = MagicMock
 *     if inspect.isdatadescriptor(spec):             # <<<<<<<<<<<<<<
 *         # descriptors don't have a spec
 *         # because we don't know what type they return
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_inspect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isdatadescriptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_spec);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "cymock.pyx":2624
 *         # descriptors don't have a spec
 *         # because we don't know what type they return
 *         _kwargs = {}             # <<<<<<<<<<<<<<
 *     elif is_async_func:
 *         if instance:
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v__kwargs, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cymock.pyx":2621
 * 
 *     Klass = MagicMock
 *     if inspect.isdatadescriptor(spec):             # <<<<<<<<<<<<<<
 *         # descriptors don't have a spec
 *         # because we don't know what type they return
 */
    goto __pyx_L8;
  }

  /* "cymock.pyx":2625
 *         # because we don't know what type they return
 *         _kwargs = {}
 *     elif is_async_func:             # <<<<<<<<<<<<<<
 *         if instance:
 *             raise RuntimeError("Instance can not be True when create_autospec "
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_is_async_func); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2625, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "cymock.pyx":2626
 *         _kwargs = {}
 *     elif is_async_func:
 *         if instance:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Instance can not be True when create_autospec "
 *                                "is mocking an async function")
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_instance); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2626, __pyx_L1_error)
    if (unlikely(__pyx_t_5)) {

      /* "cymock.pyx":2627
 *     elif is_async_func:
 *         if instance:
 *             raise RuntimeError("Instance can not be True when create_autospec "             # <<<<<<<<<<<<<<
 *                                "is mocking an async function")
 *         Klass = AsyncMock
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 2627, __pyx_L1_error)

      /* "cymock.pyx":2626
 *         _kwargs = {}
 *     elif is_async_func:
 *         if instance:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Instance can not be True when create_autospec "
 *                                "is mocking an async function")
 */
    }

    /* "cymock.pyx":2629
 *             raise RuntimeError("Instance can not be True when create_autospec "
 *                                "is mocking an async function")
 *         Klass = AsyncMock             # <<<<<<<<<<<<<<
 *     elif not _callable(spec):
 *         Klass = NonCallableMagicMock
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_Klass, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2625
 *         # because we don't know what type they return
 *         _kwargs = {}
 *     elif is_async_func:             # <<<<<<<<<<<<<<
 *         if instance:
 *             raise RuntimeError("Instance can not be True when create_autospec "
 */
    goto __pyx_L8;
  }

  /* "cymock.pyx":2630
 *                                "is mocking an async function")
 *         Klass = AsyncMock
 *     elif not _callable(spec):             # <<<<<<<<<<<<<<
 *         Klass = NonCallableMagicMock
 *     elif is_type and instance and not _instance_callable(spec):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_spec);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!__pyx_t_5) != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2631
 *         Klass = AsyncMock
 *     elif not _callable(spec):
 *         Klass = NonCallableMagicMock             # <<<<<<<<<<<<<<
 *     elif is_type and instance and not _instance_callable(spec):
 *         Klass = NonCallableMagicMock
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMagicMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_Klass, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2630
 *                                "is mocking an async function")
 *         Klass = AsyncMock
 *     elif not _callable(spec):             # <<<<<<<<<<<<<<
 *         Klass = NonCallableMagicMock
 *     elif is_type and instance and not _instance_callable(spec):
 */
    goto __pyx_L8;
  }

  /* "cymock.pyx":2632
 *     elif not _callable(spec):
 *         Klass = NonCallableMagicMock
 *     elif is_type and instance and not _instance_callable(spec):             # <<<<<<<<<<<<<<
 *         Klass = NonCallableMagicMock
 * 
 */
  __pyx_t_5 = (__pyx_v_is_type != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_instance); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2632, __pyx_L1_error)
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L10_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_instance_callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_spec) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_spec);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  __pyx_t_4 = __pyx_t_6;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_4) {

    /* "cymock.pyx":2633
 *         Klass = NonCallableMagicMock
 *     elif is_type and instance and not _instance_callable(spec):
 *         Klass = NonCallableMagicMock             # <<<<<<<<<<<<<<
 * 
 *     _name = _kwargs.pop('name', _name)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMagicMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_Klass, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2632
 *     elif not _callable(spec):
 *         Klass = NonCallableMagicMock
 *     elif is_type and instance and not _instance_callable(spec):             # <<<<<<<<<<<<<<
 *         Klass = NonCallableMagicMock
 * 
 */
  }
  __pyx_L8:;

  /* "cymock.pyx":2635
 *         Klass = NonCallableMagicMock
 * 
 *     _name = _kwargs.pop('name', _name)             # <<<<<<<<<<<<<<
 * 
 *     _new_name = _name
 */
  __pyx_t_1 = __Pyx_PyDict_Pop(__pyx_v__kwargs, __pyx_n_u_name_2, __pyx_v__name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v__name, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2637
 *     _name = _kwargs.pop('name', _name)
 * 
 *     _new_name = _name             # <<<<<<<<<<<<<<
 *     if _parent is None:
 *         # for a top level object no _new_name should be set
 */
  __Pyx_INCREF(__pyx_v__name);
  __pyx_v__new_name = __pyx_v__name;

  /* "cymock.pyx":2638
 * 
 *     _new_name = _name
 *     if _parent is None:             # <<<<<<<<<<<<<<
 *         # for a top level object no _new_name should be set
 *         _new_name = ''
 */
  __pyx_t_4 = (__pyx_v__parent == Py_None);
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (__pyx_t_6) {

    /* "cymock.pyx":2640
 *     if _parent is None:
 *         # for a top level object no _new_name should be set
 *         _new_name = ''             # <<<<<<<<<<<<<<
 * 
 *     mock = Klass(parent=_parent, _new_parent=_parent, _new_name=_new_name,
 */
    __Pyx_INCREF(__pyx_kp_u__31);
    __Pyx_DECREF_SET(__pyx_v__new_name, __pyx_kp_u__31);

    /* "cymock.pyx":2638
 * 
 *     _new_name = _name
 *     if _parent is None:             # <<<<<<<<<<<<<<
 *         # for a top level object no _new_name should be set
 *         _new_name = ''
 */
  }

  /* "cymock.pyx":2642
 *         _new_name = ''
 * 
 *     mock = Klass(parent=_parent, _new_parent=_parent, _new_name=_new_name,             # <<<<<<<<<<<<<<
 *                  name=_name, **_kwargs)
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_parent, __pyx_v__parent) < 0) __PYX_ERR(0, 2642, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new_parent, __pyx_v__parent) < 0) __PYX_ERR(0, 2642, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new_name_2, __pyx_v__new_name) < 0) __PYX_ERR(0, 2642, __pyx_L1_error)

  /* "cymock.pyx":2643
 * 
 *     mock = Klass(parent=_parent, _new_parent=_parent, _new_name=_new_name,
 *                  name=_name, **_kwargs)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(spec, FunctionTypes):
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name_2, __pyx_v__name) < 0) __PYX_ERR(0, 2642, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  if (__Pyx_MergeKeywords(__pyx_t_1, __pyx_v__kwargs) < 0) __PYX_ERR(0, 2643, __pyx_L1_error)

  /* "cymock.pyx":2642
 *         _new_name = ''
 * 
 *     mock = Klass(parent=_parent, _new_parent=_parent, _new_name=_new_name,             # <<<<<<<<<<<<<<
 *                  name=_name, **_kwargs)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_Klass, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_mock = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":2645
 *                  name=_name, **_kwargs)
 * 
 *     if isinstance(spec, FunctionTypes):             # <<<<<<<<<<<<<<
 *         # should only happen at the top level because we don't
 *         # recurse for functions
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FunctionTypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyObject_IsInstance(__pyx_v_spec, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 2645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_6 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2648
 *         # should only happen at the top level because we don't
 *         # recurse for functions
 *         mock = _set_signature(mock, spec)             # <<<<<<<<<<<<<<
 *         if is_async_func:
 *             _setup_async_mock(mock)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_set_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_mock, __pyx_v_spec};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2648, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_mock, __pyx_v_spec};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2648, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_mock);
      __Pyx_GIVEREF(__pyx_v_mock);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_mock);
      __Pyx_INCREF(__pyx_v_spec);
      __Pyx_GIVEREF(__pyx_v_spec);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_spec);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_mock, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cymock.pyx":2649
 *         # recurse for functions
 *         mock = _set_signature(mock, spec)
 *         if is_async_func:             # <<<<<<<<<<<<<<
 *             _setup_async_mock(mock)
 *     else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_is_async_func); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2649, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "cymock.pyx":2650
 *         mock = _set_signature(mock, spec)
 *         if is_async_func:
 *             _setup_async_mock(mock)             # <<<<<<<<<<<<<<
 *     else:
 *         _check_signature(spec, mock, is_type, instance)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_setup_async_mock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_mock) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_mock);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cymock.pyx":2649
 *         # recurse for functions
 *         mock = _set_signature(mock, spec)
 *         if is_async_func:             # <<<<<<<<<<<<<<
 *             _setup_async_mock(mock)
 *     else:
 */
    }

    /* "cymock.pyx":2645
 *                  name=_name, **_kwargs)
 * 
 *     if isinstance(spec, FunctionTypes):             # <<<<<<<<<<<<<<
 *         # should only happen at the top level because we don't
 *         # recurse for functions
 */
    goto __pyx_L14;
  }

  /* "cymock.pyx":2652
 *             _setup_async_mock(mock)
 *     else:
 *         _check_signature(spec, mock, is_type, instance)             # <<<<<<<<<<<<<<
 * 
 *     if _parent is not None and not instance:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_check_signature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_is_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_spec, __pyx_v_mock, __pyx_t_8, __pyx_v_instance};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2652, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_spec, __pyx_v_mock, __pyx_t_8, __pyx_v_instance};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2652, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2652, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_spec);
      __Pyx_GIVEREF(__pyx_v_spec);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_v_spec);
      __Pyx_INCREF(__pyx_v_mock);
      __Pyx_GIVEREF(__pyx_v_mock);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_v_mock);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_7, __pyx_t_8);
      __Pyx_INCREF(__pyx_v_instance);
      __Pyx_GIVEREF(__pyx_v_instance);
      PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_7, __pyx_v_instance);
      __pyx_t_8 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2652, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L14:;

  /* "cymock.pyx":2654
 *         _check_signature(spec, mock, is_type, instance)
 * 
 *     if _parent is not None and not instance:             # <<<<<<<<<<<<<<
 *         _parent._mock_children[_name] = mock
 * 
 */
  __pyx_t_6 = (__pyx_v__parent != Py_None);
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_instance); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2654, __pyx_L1_error)
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  __pyx_t_4 = __pyx_t_6;
  __pyx_L17_bool_binop_done:;
  if (__pyx_t_4) {

    /* "cymock.pyx":2655
 * 
 *     if _parent is not None and not instance:
 *         _parent._mock_children[_name] = mock             # <<<<<<<<<<<<<<
 * 
 *     if is_type and not instance and 'return_value' not in kwargs:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v__parent, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v__name, __pyx_v_mock) < 0)) __PYX_ERR(0, 2655, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":2654
 *         _check_signature(spec, mock, is_type, instance)
 * 
 *     if _parent is not None and not instance:             # <<<<<<<<<<<<<<
 *         _parent._mock_children[_name] = mock
 * 
 */
  }

  /* "cymock.pyx":2657
 *         _parent._mock_children[_name] = mock
 * 
 *     if is_type and not instance and 'return_value' not in kwargs:             # <<<<<<<<<<<<<<
 *         mock.return_value = create_autospec(spec, spec_set, instance=True,
 *                                             _name='()', _parent=mock)
 */
  __pyx_t_6 = (__pyx_v_is_type != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_instance); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_6) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_return_value, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_4 = __pyx_t_6;
  __pyx_L20_bool_binop_done:;
  if (__pyx_t_4) {

    /* "cymock.pyx":2658
 * 
 *     if is_type and not instance and 'return_value' not in kwargs:
 *         mock.return_value = create_autospec(spec, spec_set, instance=True,             # <<<<<<<<<<<<<<
 *                                             _name='()', _parent=mock)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_autospec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_spec);
    __Pyx_GIVEREF(__pyx_v_spec);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_spec);
    __Pyx_INCREF(__pyx_v_spec_set);
    __Pyx_GIVEREF(__pyx_v_spec_set);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_spec_set);
    __pyx_t_9 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_instance, Py_True) < 0) __PYX_ERR(0, 2658, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_name_3, __pyx_kp_u__32) < 0) __PYX_ERR(0, 2658, __pyx_L1_error)

    /* "cymock.pyx":2659
 *     if is_type and not instance and 'return_value' not in kwargs:
 *         mock.return_value = create_autospec(spec, spec_set, instance=True,
 *                                             _name='()', _parent=mock)             # <<<<<<<<<<<<<<
 * 
 *     for entry in dir(spec):
 */
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_parent_2, __pyx_v_mock) < 0) __PYX_ERR(0, 2658, __pyx_L1_error)

    /* "cymock.pyx":2658
 * 
 *     if is_type and not instance and 'return_value' not in kwargs:
 *         mock.return_value = create_autospec(spec, spec_set, instance=True,             # <<<<<<<<<<<<<<
 *                                             _name='()', _parent=mock)
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_mock, __pyx_n_s_return_value, __pyx_t_8) < 0) __PYX_ERR(0, 2658, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cymock.pyx":2657
 *         _parent._mock_children[_name] = mock
 * 
 *     if is_type and not instance and 'return_value' not in kwargs:             # <<<<<<<<<<<<<<
 *         mock.return_value = create_autospec(spec, spec_set, instance=True,
 *                                             _name='()', _parent=mock)
 */
  }

  /* "cymock.pyx":2661
 *                                             _name='()', _parent=mock)
 * 
 *     for entry in dir(spec):             # <<<<<<<<<<<<<<
 *         if _is_magic(entry):
 *             # MagicMock already does the useful magic methods for us
 */
  __pyx_t_8 = PyObject_Dir(__pyx_v_spec); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
    __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2661, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_9))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2661, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 2661, __pyx_L1_error)
        #else
        __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2661, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      }
    } else {
      __pyx_t_8 = __pyx_t_11(__pyx_t_9);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2661, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "cymock.pyx":2662
 * 
 *     for entry in dir(spec):
 *         if _is_magic(entry):             # <<<<<<<<<<<<<<
 *             # MagicMock already does the useful magic methods for us
 *             continue
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_is_magic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_8 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_entry) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_entry);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_4) {

      /* "cymock.pyx":2664
 *         if _is_magic(entry):
 *             # MagicMock already does the useful magic methods for us
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         # XXXX do we need a better way of getting attributes without
 */
      goto __pyx_L23_continue;

      /* "cymock.pyx":2662
 * 
 *     for entry in dir(spec):
 *         if _is_magic(entry):             # <<<<<<<<<<<<<<
 *             # MagicMock already does the useful magic methods for us
 *             continue
 */
    }

    /* "cymock.pyx":2675
 *         # we could be resilient against it, or catch and propagate the
 *         # exception when the attribute is fetched from the mock
 *         try:             # <<<<<<<<<<<<<<
 *             original = getattr(spec, entry)
 *         except AttributeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      /*try:*/ {

        /* "cymock.pyx":2676
 *         # exception when the attribute is fetched from the mock
 *         try:
 *             original = getattr(spec, entry)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             continue
 */
        __pyx_t_8 = __Pyx_GetAttr(__pyx_v_spec, __pyx_v_entry); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2676, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_v_original, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "cymock.pyx":2675
 *         # we could be resilient against it, or catch and propagate the
 *         # exception when the attribute is fetched from the mock
 *         try:             # <<<<<<<<<<<<<<
 *             original = getattr(spec, entry)
 *         except AttributeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      goto __pyx_L33_try_end;
      __pyx_L26_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cymock.pyx":2677
 *         try:
 *             original = getattr(spec, entry)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("cymock.create_autospec", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 2677, __pyx_L28_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_3);

        /* "cymock.pyx":2678
 *             original = getattr(spec, entry)
 *         except AttributeError:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         kwargs = {'spec': original}
 */
        goto __pyx_L35_except_continue;
        __pyx_L35_except_continue:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L32_try_continue;
      }
      goto __pyx_L28_except_error;
      __pyx_L28_except_error:;

      /* "cymock.pyx":2675
 *         # we could be resilient against it, or catch and propagate the
 *         # exception when the attribute is fetched from the mock
 *         try:             # <<<<<<<<<<<<<<
 *             original = getattr(spec, entry)
 *         except AttributeError:
 */
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      goto __pyx_L1_error;
      __pyx_L32_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      goto __pyx_L23_continue;
      __pyx_L33_try_end:;
    }

    /* "cymock.pyx":2680
 *             continue
 * 
 *         kwargs = {'spec': original}             # <<<<<<<<<<<<<<
 *         if spec_set:
 *             kwargs = {'spec_set': original}
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_spec, __pyx_v_original) < 0) __PYX_ERR(0, 2680, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_kwargs, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "cymock.pyx":2681
 * 
 *         kwargs = {'spec': original}
 *         if spec_set:             # <<<<<<<<<<<<<<
 *             kwargs = {'spec_set': original}
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_spec_set); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2681, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "cymock.pyx":2682
 *         kwargs = {'spec': original}
 *         if spec_set:
 *             kwargs = {'spec_set': original}             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(original, FunctionTypes):
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_spec_set, __pyx_v_original) < 0) __PYX_ERR(0, 2682, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_kwargs, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "cymock.pyx":2681
 * 
 *         kwargs = {'spec': original}
 *         if spec_set:             # <<<<<<<<<<<<<<
 *             kwargs = {'spec_set': original}
 * 
 */
    }

    /* "cymock.pyx":2684
 *             kwargs = {'spec_set': original}
 * 
 *         if not isinstance(original, FunctionTypes):             # <<<<<<<<<<<<<<
 *             new = _SpecState(original, spec_set, mock, entry, instance)
 *             mock._mock_children[entry] = new
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FunctionTypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_IsInstance(__pyx_v_original, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2684, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((!(__pyx_t_4 != 0)) != 0);
    if (__pyx_t_6) {

      /* "cymock.pyx":2685
 * 
 *         if not isinstance(original, FunctionTypes):
 *             new = _SpecState(original, spec_set, mock, entry, instance)             # <<<<<<<<<<<<<<
 *             mock._mock_children[entry] = new
 *         else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SpecState); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2685, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_v_original, __pyx_v_spec_set, __pyx_v_mock, __pyx_v_entry, __pyx_v_instance};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 5+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2685, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_v_original, __pyx_v_spec_set, __pyx_v_mock, __pyx_v_entry, __pyx_v_instance};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 5+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2685, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_2 = PyTuple_New(5+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2685, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_original);
        __Pyx_GIVEREF(__pyx_v_original);
        PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_7, __pyx_v_original);
        __Pyx_INCREF(__pyx_v_spec_set);
        __Pyx_GIVEREF(__pyx_v_spec_set);
        PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_7, __pyx_v_spec_set);
        __Pyx_INCREF(__pyx_v_mock);
        __Pyx_GIVEREF(__pyx_v_mock);
        PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_7, __pyx_v_mock);
        __Pyx_INCREF(__pyx_v_entry);
        __Pyx_GIVEREF(__pyx_v_entry);
        PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_7, __pyx_v_entry);
        __Pyx_INCREF(__pyx_v_instance);
        __Pyx_GIVEREF(__pyx_v_instance);
        PyTuple_SET_ITEM(__pyx_t_2, 4+__pyx_t_7, __pyx_v_instance);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2685, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cymock.pyx":2686
 *         if not isinstance(original, FunctionTypes):
 *             new = _SpecState(original, spec_set, mock, entry, instance)
 *             mock._mock_children[entry] = new             # <<<<<<<<<<<<<<
 *         else:
 *             parent = mock
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mock, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_entry, __pyx_v_new) < 0)) __PYX_ERR(0, 2686, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cymock.pyx":2684
 *             kwargs = {'spec_set': original}
 * 
 *         if not isinstance(original, FunctionTypes):             # <<<<<<<<<<<<<<
 *             new = _SpecState(original, spec_set, mock, entry, instance)
 *             mock._mock_children[entry] = new
 */
      goto __pyx_L37;
    }

    /* "cymock.pyx":2688
 *             mock._mock_children[entry] = new
 *         else:
 *             parent = mock             # <<<<<<<<<<<<<<
 *             if isinstance(spec, FunctionTypes):
 *                 parent = mock.mock
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_mock);
      __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_v_mock);

      /* "cymock.pyx":2689
 *         else:
 *             parent = mock
 *             if isinstance(spec, FunctionTypes):             # <<<<<<<<<<<<<<
 *                 parent = mock.mock
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FunctionTypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyObject_IsInstance(__pyx_v_spec, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 2689, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = (__pyx_t_6 != 0);
      if (__pyx_t_4) {

        /* "cymock.pyx":2690
 *             parent = mock
 *             if isinstance(spec, FunctionTypes):
 *                 parent = mock.mock             # <<<<<<<<<<<<<<
 * 
 *             skipfirst = _must_skip(spec, entry, is_type)
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mock, __pyx_n_s_mock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2690, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_parent, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "cymock.pyx":2689
 *         else:
 *             parent = mock
 *             if isinstance(spec, FunctionTypes):             # <<<<<<<<<<<<<<
 *                 parent = mock.mock
 * 
 */
      }

      /* "cymock.pyx":2692
 *                 parent = mock.mock
 * 
 *             skipfirst = _must_skip(spec, entry, is_type)             # <<<<<<<<<<<<<<
 *             kwargs['_eat_self'] = skipfirst
 *             if asyncio.iscoroutinefunction(original):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_must_skip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_spec, __pyx_v_entry, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_spec, __pyx_v_entry, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_15 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_spec);
        __Pyx_GIVEREF(__pyx_v_spec);
        PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_7, __pyx_v_spec);
        __Pyx_INCREF(__pyx_v_entry);
        __Pyx_GIVEREF(__pyx_v_entry);
        PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_7, __pyx_v_entry);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_7, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_skipfirst, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cymock.pyx":2693
 * 
 *             skipfirst = _must_skip(spec, entry, is_type)
 *             kwargs['_eat_self'] = skipfirst             # <<<<<<<<<<<<<<
 *             if asyncio.iscoroutinefunction(original):
 *                 child_klass = AsyncMock
 */
      if (unlikely(PyDict_SetItem(__pyx_v_kwargs, __pyx_n_u_eat_self_2, __pyx_v_skipfirst) < 0)) __PYX_ERR(0, 2693, __pyx_L1_error)

      /* "cymock.pyx":2694
 *             skipfirst = _must_skip(spec, entry, is_type)
 *             kwargs['_eat_self'] = skipfirst
 *             if asyncio.iscoroutinefunction(original):             # <<<<<<<<<<<<<<
 *                 child_klass = AsyncMock
 *             else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_asyncio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2694, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_iscoroutinefunction); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2694, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_15);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_15, function);
        }
      }
      __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_1, __pyx_v_original) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_original);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2694, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2694, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_4) {

        /* "cymock.pyx":2695
 *             kwargs['_eat_self'] = skipfirst
 *             if asyncio.iscoroutinefunction(original):
 *                 child_klass = AsyncMock             # <<<<<<<<<<<<<<
 *             else:
 *                 child_klass = MagicMock
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AsyncMock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2695, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_child_klass, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "cymock.pyx":2694
 *             skipfirst = _must_skip(spec, entry, is_type)
 *             kwargs['_eat_self'] = skipfirst
 *             if asyncio.iscoroutinefunction(original):             # <<<<<<<<<<<<<<
 *                 child_klass = AsyncMock
 *             else:
 */
        goto __pyx_L39;
      }

      /* "cymock.pyx":2697
 *                 child_klass = AsyncMock
 *             else:
 *                 child_klass = MagicMock             # <<<<<<<<<<<<<<
 *             new = child_klass(parent=parent, name=entry, _new_name=entry,
 *                               _new_parent=parent,
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2697, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_child_klass, __pyx_t_3);
        __pyx_t_3 = 0;
      }
      __pyx_L39:;

      /* "cymock.pyx":2698
 *             else:
 *                 child_klass = MagicMock
 *             new = child_klass(parent=parent, name=entry, _new_name=entry,             # <<<<<<<<<<<<<<
 *                               _new_parent=parent,
 *                               **kwargs)
 */
      __pyx_t_15 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_name_2, __pyx_v_entry) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_new_name_2, __pyx_v_entry) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)

      /* "cymock.pyx":2699
 *                 child_klass = MagicMock
 *             new = child_klass(parent=parent, name=entry, _new_name=entry,
 *                               _new_parent=parent,             # <<<<<<<<<<<<<<
 *                               **kwargs)
 *             mock._mock_children[entry] = new
 */
      if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_new_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
      __pyx_t_3 = __pyx_t_15;
      __pyx_t_15 = 0;

      /* "cymock.pyx":2700
 *             new = child_klass(parent=parent, name=entry, _new_name=entry,
 *                               _new_parent=parent,
 *                               **kwargs)             # <<<<<<<<<<<<<<
 *             mock._mock_children[entry] = new
 *             _check_signature(original, new, skipfirst=skipfirst)
 */
      if (__Pyx_MergeKeywords(__pyx_t_3, __pyx_v_kwargs) < 0) __PYX_ERR(0, 2700, __pyx_L1_error)

      /* "cymock.pyx":2698
 *             else:
 *                 child_klass = MagicMock
 *             new = child_klass(parent=parent, name=entry, _new_name=entry,             # <<<<<<<<<<<<<<
 *                               _new_parent=parent,
 *                               **kwargs)
 */
      __pyx_t_15 = __Pyx_PyObject_Call(__pyx_v_child_klass, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2698, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_15);
      __pyx_t_15 = 0;

      /* "cymock.pyx":2701
 *                               _new_parent=parent,
 *                               **kwargs)
 *             mock._mock_children[entry] = new             # <<<<<<<<<<<<<<
 *             _check_signature(original, new, skipfirst=skipfirst)
 * 
 */
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_mock, __pyx_n_s_mock_children); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (unlikely(PyObject_SetItem(__pyx_t_15, __pyx_v_entry, __pyx_v_new) < 0)) __PYX_ERR(0, 2701, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "cymock.pyx":2702
 *                               **kwargs)
 *             mock._mock_children[entry] = new
 *             _check_signature(original, new, skipfirst=skipfirst)             # <<<<<<<<<<<<<<
 * 
 *         # so functions created with _set_signature become instance attributes,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_check_signature); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_original);
      __Pyx_GIVEREF(__pyx_v_original);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_original);
      __Pyx_INCREF(__pyx_v_new);
      __Pyx_GIVEREF(__pyx_v_new);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_new);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_skipfirst, __pyx_v_skipfirst) < 0) __PYX_ERR(0, 2702, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L37:;

    /* "cymock.pyx":2708
 *         # mock. Adding to _mock_children may be unnecessary where we are also
 *         # setting as an instance attribute?
 *         if isinstance(new, FunctionTypes):             # <<<<<<<<<<<<<<
 *             setattr(mock, entry, new)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FunctionTypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_IsInstance(__pyx_v_new, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2708, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (__pyx_t_6) {

      /* "cymock.pyx":2709
 *         # setting as an instance attribute?
 *         if isinstance(new, FunctionTypes):
 *             setattr(mock, entry, new)             # <<<<<<<<<<<<<<
 * 
 *     return mock
 */
      __pyx_t_16 = PyObject_SetAttr(__pyx_v_mock, __pyx_v_entry, __pyx_v_new); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 2709, __pyx_L1_error)

      /* "cymock.pyx":2708
 *         # mock. Adding to _mock_children may be unnecessary where we are also
 *         # setting as an instance attribute?
 *         if isinstance(new, FunctionTypes):             # <<<<<<<<<<<<<<
 *             setattr(mock, entry, new)
 * 
 */
    }

    /* "cymock.pyx":2661
 *                                             _name='()', _parent=mock)
 * 
 *     for entry in dir(spec):             # <<<<<<<<<<<<<<
 *         if _is_magic(entry):
 *             # MagicMock already does the useful magic methods for us
 */
    __pyx_L23_continue:;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "cymock.pyx":2711
 *             setattr(mock, entry, new)
 * 
 *     return mock             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_mock);
  __pyx_r = __pyx_v_mock;
  goto __pyx_L0;

  /* "cymock.pyx":2583
 * 
 * 
 * def create_autospec(spec, spec_set=False, instance=False, _parent=None,             # <<<<<<<<<<<<<<
 *                     _name=None, **kwargs):
 *     """Create a mock object using another object as a spec. Attributes on the
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("cymock.create_autospec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XDECREF(__pyx_v_is_async_func);
  __Pyx_XDECREF(__pyx_v__kwargs);
  __Pyx_XDECREF(__pyx_v_Klass);
  __Pyx_XDECREF(__pyx_v__new_name);
  __Pyx_XDECREF(__pyx_v_mock);
  __Pyx_XDECREF(__pyx_v_entry);
  __Pyx_XDECREF(__pyx_v_original);
  __Pyx_XDECREF(__pyx_v_new);
  __Pyx_XDECREF(__pyx_v_parent);
  __Pyx_XDECREF(__pyx_v_skipfirst);
  __Pyx_XDECREF(__pyx_v_child_klass);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_XDECREF(__pyx_v__name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2714
 * 
 * 
 * def _must_skip(spec, entry, is_type):             # <<<<<<<<<<<<<<
 *     """
 *     Return whether we should skip the first argument on spec's `entry`
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_69_must_skip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_68_must_skip[] = "\n    Return whether we should skip the first argument on spec's `entry`\n    attribute.\n    ";
static PyMethodDef __pyx_mdef_6cymock_69_must_skip = {"_must_skip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_69_must_skip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_68_must_skip};
static PyObject *__pyx_pw_6cymock_69_must_skip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_entry = 0;
  PyObject *__pyx_v_is_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_must_skip (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_spec,&__pyx_n_s_entry,&__pyx_n_s_is_type,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_entry)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_must_skip", 1, 3, 3, 1); __PYX_ERR(0, 2714, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_must_skip", 1, 3, 3, 2); __PYX_ERR(0, 2714, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_must_skip") < 0)) __PYX_ERR(0, 2714, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_spec = values[0];
    __pyx_v_entry = values[1];
    __pyx_v_is_type = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_must_skip", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2714, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._must_skip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_68_must_skip(__pyx_self, __pyx_v_spec, __pyx_v_entry, __pyx_v_is_type);

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

static PyObject *__pyx_pf_6cymock_68_must_skip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_entry, PyObject *__pyx_v_is_type) {
  PyObject *__pyx_v_klass = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("_must_skip", 0);
  __Pyx_INCREF(__pyx_v_spec);

  /* "cymock.pyx":2719
 *     attribute.
 *     """
 *     if not isinstance(spec, type):             # <<<<<<<<<<<<<<
 *         if entry in getattr(spec, '__dict__', {}):
 *             # instance attribute - shouldn't skip
 */
  __pyx_t_1 = PyType_Check(__pyx_v_spec); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":2720
 *     """
 *     if not isinstance(spec, type):
 *         if entry in getattr(spec, '__dict__', {}):             # <<<<<<<<<<<<<<
 *             # instance attribute - shouldn't skip
 *             return False
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_spec, __pyx_n_u_dict, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_entry, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2720, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cymock.pyx":2722
 *         if entry in getattr(spec, '__dict__', {}):
 *             # instance attribute - shouldn't skip
 *             return False             # <<<<<<<<<<<<<<
 *         spec = spec.__class__
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "cymock.pyx":2720
 *     """
 *     if not isinstance(spec, type):
 *         if entry in getattr(spec, '__dict__', {}):             # <<<<<<<<<<<<<<
 *             # instance attribute - shouldn't skip
 *             return False
 */
    }

    /* "cymock.pyx":2723
 *             # instance attribute - shouldn't skip
 *             return False
 *         spec = spec.__class__             # <<<<<<<<<<<<<<
 * 
 *     for klass in spec.__mro__:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_spec, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_spec, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":2719
 *     attribute.
 *     """
 *     if not isinstance(spec, type):             # <<<<<<<<<<<<<<
 *         if entry in getattr(spec, '__dict__', {}):
 *             # instance attribute - shouldn't skip
 */
  }

  /* "cymock.pyx":2725
 *         spec = spec.__class__
 * 
 *     for klass in spec.__mro__:             # <<<<<<<<<<<<<<
 *         result = klass.__dict__.get(entry, DEFAULT)
 *         if result is DEFAULT:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_spec, __pyx_n_s_mro); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2725, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2725, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2725, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2725, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_klass, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":2726
 * 
 *     for klass in spec.__mro__:
 *         result = klass.__dict__.get(entry, DEFAULT)             # <<<<<<<<<<<<<<
 *         if result is DEFAULT:
 *             continue
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_entry, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2726, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_entry, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2726, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2726, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_v_entry);
      __Pyx_GIVEREF(__pyx_v_entry);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_entry);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2726, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cymock.pyx":2727
 *     for klass in spec.__mro__:
 *         result = klass.__dict__.get(entry, DEFAULT)
 *         if result is DEFAULT:             # <<<<<<<<<<<<<<
 *             continue
 *         if isinstance(result, (staticmethod, classmethod)):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = (__pyx_v_result == __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cymock.pyx":2728
 *         result = klass.__dict__.get(entry, DEFAULT)
 *         if result is DEFAULT:
 *             continue             # <<<<<<<<<<<<<<
 *         if isinstance(result, (staticmethod, classmethod)):
 *             return False
 */
      goto __pyx_L5_continue;

      /* "cymock.pyx":2727
 *     for klass in spec.__mro__:
 *         result = klass.__dict__.get(entry, DEFAULT)
 *         if result is DEFAULT:             # <<<<<<<<<<<<<<
 *             continue
 *         if isinstance(result, (staticmethod, classmethod)):
 */
    }

    /* "cymock.pyx":2729
 *         if result is DEFAULT:
 *             continue
 *         if isinstance(result, (staticmethod, classmethod)):             # <<<<<<<<<<<<<<
 *             return False
 *         elif isinstance(result, FunctionTypes):
 */
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_result, __pyx_builtin_staticmethod); 
    __pyx_t_12 = (__pyx_t_1 != 0);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_2 = __pyx_t_12;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_12 = PyObject_IsInstance(__pyx_v_result, __pyx_builtin_classmethod); 
    __pyx_t_1 = (__pyx_t_12 != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L9_bool_binop_done:;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cymock.pyx":2730
 *             continue
 *         if isinstance(result, (staticmethod, classmethod)):
 *             return False             # <<<<<<<<<<<<<<
 *         elif isinstance(result, FunctionTypes):
 *             # Normal method => skip if looked up on type
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cymock.pyx":2729
 *         if result is DEFAULT:
 *             continue
 *         if isinstance(result, (staticmethod, classmethod)):             # <<<<<<<<<<<<<<
 *             return False
 *         elif isinstance(result, FunctionTypes):
 */
    }

    /* "cymock.pyx":2731
 *         if isinstance(result, (staticmethod, classmethod)):
 *             return False
 *         elif isinstance(result, FunctionTypes):             # <<<<<<<<<<<<<<
 *             # Normal method => skip if looked up on type
 *             # (if looked up on instance, self is already skipped)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FunctionTypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cymock.pyx":2734
 *             # Normal method => skip if looked up on type
 *             # (if looked up on instance, self is already skipped)
 *             return is_type             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_is_type);
      __pyx_r = __pyx_v_is_type;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "cymock.pyx":2731
 *         if isinstance(result, (staticmethod, classmethod)):
 *             return False
 *         elif isinstance(result, FunctionTypes):             # <<<<<<<<<<<<<<
 *             # Normal method => skip if looked up on type
 *             # (if looked up on instance, self is already skipped)
 */
    }

    /* "cymock.pyx":2736
 *             return is_type
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     # function is a dynamically provided attribute
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cymock.pyx":2725
 *         spec = spec.__class__
 * 
 *     for klass in spec.__mro__:             # <<<<<<<<<<<<<<
 *         result = klass.__dict__.get(entry, DEFAULT)
 *         if result is DEFAULT:
 */
    __pyx_L5_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2739
 * 
 *     # function is a dynamically provided attribute
 *     return is_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_is_type);
  __pyx_r = __pyx_v_is_type;
  goto __pyx_L0;

  /* "cymock.pyx":2714
 * 
 * 
 * def _must_skip(spec, entry, is_type):             # <<<<<<<<<<<<<<
 *     """
 *     Return whether we should skip the first argument on spec's `entry`
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cymock._must_skip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_spec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2744
 * class _SpecState(object):
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,             # <<<<<<<<<<<<<<
 *                  name=None, ids=None, instance=False):
 *         self.spec = spec
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_10_SpecState_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_10_SpecState_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_10_SpecState_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_10_SpecState_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_spec = 0;
  PyObject *__pyx_v_spec_set = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_ids = 0;
  PyObject *__pyx_v_instance = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_spec,&__pyx_n_s_spec_set,&__pyx_n_s_parent,&__pyx_n_s_name_2,&__pyx_n_s_ids,&__pyx_n_s_instance,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject *)Py_None));

    /* "cymock.pyx":2745
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,
 *                  name=None, ids=None, instance=False):             # <<<<<<<<<<<<<<
 *         self.spec = spec
 *         self.ids = ids
 */
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 7, 1); __PYX_ERR(0, 2744, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spec_set);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ids);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_instance);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2744, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_spec = values[1];
    __pyx_v_spec_set = values[2];
    __pyx_v_parent = values[3];
    __pyx_v_name = values[4];
    __pyx_v_ids = values[5];
    __pyx_v_instance = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2744, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._SpecState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_10_SpecState___init__(__pyx_self, __pyx_v_self, __pyx_v_spec, __pyx_v_spec_set, __pyx_v_parent, __pyx_v_name, __pyx_v_ids, __pyx_v_instance);

  /* "cymock.pyx":2744
 * class _SpecState(object):
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,             # <<<<<<<<<<<<<<
 *                  name=None, ids=None, instance=False):
 *         self.spec = spec
 */

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

static PyObject *__pyx_pf_6cymock_10_SpecState___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_spec_set, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, PyObject *__pyx_v_ids, PyObject *__pyx_v_instance) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":2746
 *     def __init__(self, spec, spec_set=False, parent=None,
 *                  name=None, ids=None, instance=False):
 *         self.spec = spec             # <<<<<<<<<<<<<<
 *         self.ids = ids
 *         self.spec_set = spec_set
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spec, __pyx_v_spec) < 0) __PYX_ERR(0, 2746, __pyx_L1_error)

  /* "cymock.pyx":2747
 *                  name=None, ids=None, instance=False):
 *         self.spec = spec
 *         self.ids = ids             # <<<<<<<<<<<<<<
 *         self.spec_set = spec_set
 *         self.parent = parent
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ids, __pyx_v_ids) < 0) __PYX_ERR(0, 2747, __pyx_L1_error)

  /* "cymock.pyx":2748
 *         self.spec = spec
 *         self.ids = ids
 *         self.spec_set = spec_set             # <<<<<<<<<<<<<<
 *         self.parent = parent
 *         self.instance = instance
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_spec_set, __pyx_v_spec_set) < 0) __PYX_ERR(0, 2748, __pyx_L1_error)

  /* "cymock.pyx":2749
 *         self.ids = ids
 *         self.spec_set = spec_set
 *         self.parent = parent             # <<<<<<<<<<<<<<
 *         self.instance = instance
 *         self.name = name
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 2749, __pyx_L1_error)

  /* "cymock.pyx":2750
 *         self.spec_set = spec_set
 *         self.parent = parent
 *         self.instance = instance             # <<<<<<<<<<<<<<
 *         self.name = name
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_instance, __pyx_v_instance) < 0) __PYX_ERR(0, 2750, __pyx_L1_error)

  /* "cymock.pyx":2751
 *         self.parent = parent
 *         self.instance = instance
 *         self.name = name             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 2751, __pyx_L1_error)

  /* "cymock.pyx":2744
 * class _SpecState(object):
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,             # <<<<<<<<<<<<<<
 *                  name=None, ids=None, instance=False):
 *         self.spec = spec
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock._SpecState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2765
 * 
 * 
 * def _to_stream(read_data):             # <<<<<<<<<<<<<<
 *     if isinstance(read_data, bytes):
 *         return io.BytesIO(read_data)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_71_to_stream(PyObject *__pyx_self, PyObject *__pyx_v_read_data); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_71_to_stream = {"_to_stream", (PyCFunction)__pyx_pw_6cymock_71_to_stream, METH_O, 0};
static PyObject *__pyx_pw_6cymock_71_to_stream(PyObject *__pyx_self, PyObject *__pyx_v_read_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_stream (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_70_to_stream(__pyx_self, ((PyObject *)__pyx_v_read_data));

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

static PyObject *__pyx_pf_6cymock_70_to_stream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_read_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_to_stream", 0);

  /* "cymock.pyx":2766
 * 
 * def _to_stream(read_data):
 *     if isinstance(read_data, bytes):             # <<<<<<<<<<<<<<
 *         return io.BytesIO(read_data)
 *     else:
 */
  __pyx_t_1 = PyBytes_Check(__pyx_v_read_data); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cymock.pyx":2767
 * def _to_stream(read_data):
 *     if isinstance(read_data, bytes):
 *         return io.BytesIO(read_data)             # <<<<<<<<<<<<<<
 *     else:
 *         return io.StringIO(read_data)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_io); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_read_data) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_read_data);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "cymock.pyx":2766
 * 
 * def _to_stream(read_data):
 *     if isinstance(read_data, bytes):             # <<<<<<<<<<<<<<
 *         return io.BytesIO(read_data)
 *     else:
 */
  }

  /* "cymock.pyx":2769
 *         return io.BytesIO(read_data)
 *     else:
 *         return io.StringIO(read_data)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_io); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_read_data) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_read_data);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "cymock.pyx":2765
 * 
 * 
 * def _to_stream(read_data):             # <<<<<<<<<<<<<<
 *     if isinstance(read_data, bytes):
 *         return io.BytesIO(read_data)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cymock._to_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2772
 * 
 * 
 * def mock_open(mock=None, read_data=''):             # <<<<<<<<<<<<<<
 *     """
 *     A helper function to create a mock to replace the use of `open`. It works
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_73mock_open(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6cymock_72mock_open[] = "\n    A helper function to create a mock to replace the use of `open`. It works\n    for `open` called directly or used as a context manager.\n\n    The `mock` argument is the mock object to configure. If `None` (the\n    default) then a `MagicMock` will be created for you, with the API limited\n    to methods or attributes available on standard file handles.\n\n    `read_data` is a string for the `read`, `readline` and `readlines` of the\n    file handle to return.  This is an empty string by default.\n    ";
static PyMethodDef __pyx_mdef_6cymock_73mock_open = {"mock_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_73mock_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6cymock_72mock_open};
static PyObject *__pyx_pw_6cymock_73mock_open(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mock = 0;
  PyObject *__pyx_v_read_data = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mock_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mock,&__pyx_n_s_read_data,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)__pyx_kp_u__31);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mock);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read_data);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mock_open") < 0)) __PYX_ERR(0, 2772, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_mock = values[0];
    __pyx_v_read_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mock_open", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2772, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.mock_open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_72mock_open(__pyx_self, __pyx_v_mock, __pyx_v_read_data);

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

/* "cymock.pyx":2787
 *     _state = [_read_data, None]
 * 
 *     def _readlines_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         if handle.readlines.return_value is not None:
 *             return handle.readlines.return_value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9mock_open_1_readlines_side_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9mock_open_1_readlines_side_effect = {"_readlines_side_effect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_9mock_open_1_readlines_side_effect, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_9mock_open_1_readlines_side_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_readlines_side_effect (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_readlines_side_effect", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_9mock_open__readlines_side_effect(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_9mock_open__readlines_side_effect(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_readlines_side_effect", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":2788
 * 
 *     def _readlines_side_effect(*args, **kwargs):
 *         if handle.readlines.return_value is not None:             # <<<<<<<<<<<<<<
 *             return handle.readlines.return_value
 *         return _state[0].readlines(*args, **kwargs)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2788, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readlines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2789
 *     def _readlines_side_effect(*args, **kwargs):
 *         if handle.readlines.return_value is not None:
 *             return handle.readlines.return_value             # <<<<<<<<<<<<<<
 *         return _state[0].readlines(*args, **kwargs)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2789, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readlines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2789, __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;

    /* "cymock.pyx":2788
 * 
 *     def _readlines_side_effect(*args, **kwargs):
 *         if handle.readlines.return_value is not None:             # <<<<<<<<<<<<<<
 *             return handle.readlines.return_value
 *         return _state[0].readlines(*args, **kwargs)
 */
  }

  /* "cymock.pyx":2790
 *         if handle.readlines.return_value is not None:
 *             return handle.readlines.return_value
 *         return _state[0].readlines(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def _read_side_effect(*args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2790, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v__state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 2790, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v__state, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_readlines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2790, __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;

  /* "cymock.pyx":2787
 *     _state = [_read_data, None]
 * 
 *     def _readlines_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         if handle.readlines.return_value is not None:
 *             return handle.readlines.return_value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.mock_open._readlines_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2792
 *         return _state[0].readlines(*args, **kwargs)
 * 
 *     def _read_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         if handle.read.return_value is not None:
 *             return handle.read.return_value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9mock_open_3_read_side_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9mock_open_3_read_side_effect = {"_read_side_effect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_9mock_open_3_read_side_effect, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_9mock_open_3_read_side_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_side_effect (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_read_side_effect", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_9mock_open_2_read_side_effect(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_9mock_open_2_read_side_effect(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_read_side_effect", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":2793
 * 
 *     def _read_side_effect(*args, **kwargs):
 *         if handle.read.return_value is not None:             # <<<<<<<<<<<<<<
 *             return handle.read.return_value
 *         return _state[0].read(*args, **kwargs)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2793, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2794
 *     def _read_side_effect(*args, **kwargs):
 *         if handle.read.return_value is not None:
 *             return handle.read.return_value             # <<<<<<<<<<<<<<
 *         return _state[0].read(*args, **kwargs)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2794, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2794, __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;

    /* "cymock.pyx":2793
 * 
 *     def _read_side_effect(*args, **kwargs):
 *         if handle.read.return_value is not None:             # <<<<<<<<<<<<<<
 *             return handle.read.return_value
 *         return _state[0].read(*args, **kwargs)
 */
  }

  /* "cymock.pyx":2795
 *         if handle.read.return_value is not None:
 *             return handle.read.return_value
 *         return _state[0].read(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def _readline_side_effect(*args, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2795, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v__state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 2795, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v__state, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2795, __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;

  /* "cymock.pyx":2792
 *         return _state[0].readlines(*args, **kwargs)
 * 
 *     def _read_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         if handle.read.return_value is not None:
 *             return handle.read.return_value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.mock_open._read_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_9mock_open_6generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":2797
 *         return _state[0].read(*args, **kwargs)
 * 
 *     def _readline_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         yield from _iter_side_effect()
 *         while True:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9mock_open_5_readline_side_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9mock_open_5_readline_side_effect = {"_readline_side_effect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_9mock_open_5_readline_side_effect, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_9mock_open_5_readline_side_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_readline_side_effect (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_readline_side_effect", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_9mock_open_4_readline_side_effect(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_9mock_open_4_readline_side_effect(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_readline_side_effect", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *)__pyx_tp_new_6cymock___pyx_scope_struct_30__readline_side_effect(__pyx_ptype_6cymock___pyx_scope_struct_30__readline_side_effect, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2797, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs;
  __Pyx_XINCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_XGIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_9mock_open_6generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_readline_side_effect, __pyx_n_s_mock_open_locals__readline_side, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 2797, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.mock_open._readline_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_9mock_open_6generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_readline_side_effect", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_yield_from;
    case 2: goto __pyx_L7_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2797, __pyx_L1_error)

  /* "cymock.pyx":2798
 * 
 *     def _readline_side_effect(*args, **kwargs):
 *         yield from _iter_side_effect()             # <<<<<<<<<<<<<<
 *         while True:
 *             yield _state[0].readline(*args, **kwargs)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v__iter_side_effect)) { __Pyx_RaiseClosureNameError("_iter_side_effect"); __PYX_ERR(0, 2798, __pyx_L1_error) }
  __pyx_t_1 = __pyx_pf_6cymock_9mock_open_7_iter_side_effect(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__iter_side_effect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __Pyx_Generator_Yield_From(__pyx_generator, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XGOTREF(__pyx_r);
  if (likely(__pyx_r)) {
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L4_resume_from_yield_from:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2798, __pyx_L1_error)
  } else {
    PyObject* exc_type = __Pyx_PyErr_Occurred();
    if (exc_type) {
      if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
      else __PYX_ERR(0, 2798, __pyx_L1_error)
    }
  }

  /* "cymock.pyx":2799
 *     def _readline_side_effect(*args, **kwargs):
 *         yield from _iter_side_effect()
 *         while True:             # <<<<<<<<<<<<<<
 *             yield _state[0].readline(*args, **kwargs)
 * 
 */
  while (1) {

    /* "cymock.pyx":2800
 *         yield from _iter_side_effect()
 *         while True:
 *             yield _state[0].readline(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def _iter_side_effect():
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2800, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 2800, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__state, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2800, __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;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 2;
    return __pyx_r;
    __pyx_L7_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2800, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "cymock.pyx":2797
 *         return _state[0].read(*args, **kwargs)
 * 
 *     def _readline_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         yield from _iter_side_effect()
 *         while True:
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_readline_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_9mock_open_9generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":2802
 *             yield _state[0].readline(*args, **kwargs)
 * 
 *     def _iter_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             while True:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9mock_open_8_iter_side_effect(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9mock_open_8_iter_side_effect = {"_iter_side_effect", (PyCFunction)__pyx_pw_6cymock_9mock_open_8_iter_side_effect, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_9mock_open_8_iter_side_effect(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_iter_side_effect (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_9mock_open_7_iter_side_effect(__pyx_self);

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

static PyObject *__pyx_pf_6cymock_9mock_open_7_iter_side_effect(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_iter_side_effect", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *)__pyx_tp_new_6cymock___pyx_scope_struct_31__iter_side_effect(__pyx_ptype_6cymock___pyx_scope_struct_31__iter_side_effect, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2802, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_9mock_open_9generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter_side_effect, __pyx_n_s_mock_open_locals__iter_side_effe, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 2802, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock.mock_open._iter_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_9mock_open_9generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_iter_side_effect", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_yield;
    case 2: goto __pyx_L10_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2802, __pyx_L1_error)

  /* "cymock.pyx":2803
 * 
 *     def _iter_side_effect():
 *         if handle.readline.return_value is not None:             # <<<<<<<<<<<<<<
 *             while True:
 *                 yield handle.readline.return_value
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2803, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2804
 *     def _iter_side_effect():
 *         if handle.readline.return_value is not None:
 *             while True:             # <<<<<<<<<<<<<<
 *                 yield handle.readline.return_value
 *         for line in _state[0]:
 */
    while (1) {

      /* "cymock.pyx":2805
 *         if handle.readline.return_value is not None:
 *             while True:
 *                 yield handle.readline.return_value             # <<<<<<<<<<<<<<
 *         for line in _state[0]:
 *             yield line
 */
      if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2805, __pyx_L1_error) }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2805, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2805, __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;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2805, __pyx_L1_error)
    }

    /* "cymock.pyx":2803
 * 
 *     def _iter_side_effect():
 *         if handle.readline.return_value is not None:             # <<<<<<<<<<<<<<
 *             while True:
 *                 yield handle.readline.return_value
 */
  }

  /* "cymock.pyx":2806
 *             while True:
 *                 yield handle.readline.return_value
 *         for line in _state[0]:             # <<<<<<<<<<<<<<
 *             yield line
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2806, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 2806, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_outer_scope->__pyx_v__state, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2806, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2806, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2806, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2806, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2807
 *                 yield handle.readline.return_value
 *         for line in _state[0]:
 *             yield line             # <<<<<<<<<<<<<<
 * 
 *     def _next_side_effect():
 */
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_line);
    __pyx_r = __pyx_cur_scope->__pyx_v_line;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 2;
    return __pyx_r;
    __pyx_L10_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2807, __pyx_L1_error)

    /* "cymock.pyx":2806
 *             while True:
 *                 yield handle.readline.return_value
 *         for line in _state[0]:             # <<<<<<<<<<<<<<
 *             yield line
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "cymock.pyx":2802
 *             yield _state[0].readline(*args, **kwargs)
 * 
 *     def _iter_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             while True:
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_iter_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2809
 *             yield line
 * 
 *     def _next_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             return handle.readline.return_value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9mock_open_11_next_side_effect(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9mock_open_11_next_side_effect = {"_next_side_effect", (PyCFunction)__pyx_pw_6cymock_9mock_open_11_next_side_effect, METH_NOARGS, 0};
static PyObject *__pyx_pw_6cymock_9mock_open_11_next_side_effect(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_next_side_effect (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_9mock_open_10_next_side_effect(__pyx_self);

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

static PyObject *__pyx_pf_6cymock_9mock_open_10_next_side_effect(PyObject *__pyx_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("_next_side_effect", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":2810
 * 
 *     def _next_side_effect():
 *         if handle.readline.return_value is not None:             # <<<<<<<<<<<<<<
 *             return handle.readline.return_value
 *         return next(_state[0])
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2810, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_return_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2811
 *     def _next_side_effect():
 *         if handle.readline.return_value is not None:
 *             return handle.readline.return_value             # <<<<<<<<<<<<<<
 *         return next(_state[0])
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2811, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_return_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2811, __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;

    /* "cymock.pyx":2810
 * 
 *     def _next_side_effect():
 *         if handle.readline.return_value is not None:             # <<<<<<<<<<<<<<
 *             return handle.readline.return_value
 *         return next(_state[0])
 */
  }

  /* "cymock.pyx":2812
 *         if handle.readline.return_value is not None:
 *             return handle.readline.return_value
 *         return next(_state[0])             # <<<<<<<<<<<<<<
 * 
 *     global file_spec
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2812, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v__state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 2812, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v__state, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2812, __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;

  /* "cymock.pyx":2809
 *             yield line
 * 
 *     def _next_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             return handle.readline.return_value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.mock_open._next_side_effect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2837
 *     handle.__next__.side_effect = _next_side_effect
 * 
 *     def reset_data(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         _state[0] = _to_stream(read_data)
 *         if handle.readline.side_effect == _state[1]:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_9mock_open_13reset_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_9mock_open_13reset_data = {"reset_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_9mock_open_13reset_data, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_9mock_open_13reset_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_data (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset_data", 1))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6cymock_9mock_open_12reset_data(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_9mock_open_12reset_data(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_cur_scope;
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("reset_data", 0);
  __pyx_outer_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cymock.pyx":2838
 * 
 *     def reset_data(*args, **kwargs):
 *         _state[0] = _to_stream(read_data)             # <<<<<<<<<<<<<<
 *         if handle.readline.side_effect == _state[1]:
 *             # Only reset the side effect if the user hasn't overridden it.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_to_stream); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_read_data)) { __Pyx_RaiseClosureNameError("read_data"); __PYX_ERR(0, 2838, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_read_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_read_data);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2838, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v__state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 2838, __pyx_L1_error)
  }
  if (unlikely(__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v__state, 0, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2839
 *     def reset_data(*args, **kwargs):
 *         _state[0] = _to_stream(read_data)
 *         if handle.readline.side_effect == _state[1]:             # <<<<<<<<<<<<<<
 *             # Only reset the side effect if the user hasn't overridden it.
 *             _state[1] = _readline_side_effect()
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2839, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_side_effect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2839, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v__state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 2839, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v__state, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "cymock.pyx":2841
 *         if handle.readline.side_effect == _state[1]:
 *             # Only reset the side effect if the user hasn't overridden it.
 *             _state[1] = _readline_side_effect()             # <<<<<<<<<<<<<<
 *             handle.readline.side_effect = _state[1]
 *         return DEFAULT
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v__readline_side_effect)) { __Pyx_RaiseClosureNameError("_readline_side_effect"); __PYX_ERR(0, 2841, __pyx_L1_error) }
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v__readline_side_effect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_cur_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2841, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_v__state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 2841, __pyx_L1_error)
    }
    if (unlikely(__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v__state, 1, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 2841, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":2842
 *             # Only reset the side effect if the user hasn't overridden it.
 *             _state[1] = _readline_side_effect()
 *             handle.readline.side_effect = _state[1]             # <<<<<<<<<<<<<<
 *         return DEFAULT
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v__state)) { __Pyx_RaiseClosureNameError("_state"); __PYX_ERR(0, 2842, __pyx_L1_error) }
    if (unlikely(__pyx_cur_scope->__pyx_v__state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 2842, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v__state, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_cur_scope->__pyx_v_handle)) { __Pyx_RaiseClosureNameError("handle"); __PYX_ERR(0, 2842, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_side_effect, __pyx_t_3) < 0) __PYX_ERR(0, 2842, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cymock.pyx":2839
 *     def reset_data(*args, **kwargs):
 *         _state[0] = _to_stream(read_data)
 *         if handle.readline.side_effect == _state[1]:             # <<<<<<<<<<<<<<
 *             # Only reset the side effect if the user hasn't overridden it.
 *             _state[1] = _readline_side_effect()
 */
  }

  /* "cymock.pyx":2843
 *             _state[1] = _readline_side_effect()
 *             handle.readline.side_effect = _state[1]
 *         return DEFAULT             # <<<<<<<<<<<<<<
 * 
 *     mock.side_effect = reset_data
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cymock.pyx":2837
 *     handle.__next__.side_effect = _next_side_effect
 * 
 *     def reset_data(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         _state[0] = _to_stream(read_data)
 *         if handle.readline.side_effect == _state[1]:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock.mock_open.reset_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2772
 * 
 * 
 * def mock_open(mock=None, read_data=''):             # <<<<<<<<<<<<<<
 *     """
 *     A helper function to create a mock to replace the use of `open`. It works
 */

static PyObject *__pyx_pf_6cymock_72mock_open(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock, PyObject *__pyx_v_read_data) {
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_cur_scope;
  PyObject *__pyx_v__read_data = NULL;
  PyObject *__pyx_v__readlines_side_effect = 0;
  PyObject *__pyx_v__read_side_effect = 0;
  PyObject *__pyx_v__next_side_effect = 0;
  PyObject *__pyx_v__io = NULL;
  PyObject *__pyx_v_reset_data = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("mock_open", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *)__pyx_tp_new_6cymock___pyx_scope_struct_29_mock_open(__pyx_ptype_6cymock___pyx_scope_struct_29_mock_open, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2772, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_read_data = __pyx_v_read_data;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_read_data);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_read_data);
  __Pyx_INCREF(__pyx_v_mock);

  /* "cymock.pyx":2784
 *     file handle to return.  This is an empty string by default.
 *     """
 *     _read_data = _to_stream(read_data)             # <<<<<<<<<<<<<<
 *     _state = [_read_data, None]
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_to_stream); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_read_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_read_data);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v__read_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2785
 *     """
 *     _read_data = _to_stream(read_data)
 *     _state = [_read_data, None]             # <<<<<<<<<<<<<<
 * 
 *     def _readlines_side_effect(*args, **kwargs):
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v__read_data);
  __Pyx_GIVEREF(__pyx_v__read_data);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v__read_data);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyList_SET_ITEM(__pyx_t_1, 1, Py_None);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v__state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cymock.pyx":2787
 *     _state = [_read_data, None]
 * 
 *     def _readlines_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         if handle.readlines.return_value is not None:
 *             return handle.readlines.return_value
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9mock_open_1_readlines_side_effect, 0, __pyx_n_s_mock_open_locals__readlines_side, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__readlines_side_effect = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2792
 *         return _state[0].readlines(*args, **kwargs)
 * 
 *     def _read_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         if handle.read.return_value is not None:
 *             return handle.read.return_value
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9mock_open_3_read_side_effect, 0, __pyx_n_s_mock_open_locals__read_side_effe, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__read_side_effect = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2797
 *         return _state[0].read(*args, **kwargs)
 * 
 *     def _readline_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         yield from _iter_side_effect()
 *         while True:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9mock_open_5_readline_side_effect, 0, __pyx_n_s_mock_open_locals__readline_side, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v__readline_side_effect = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2802
 *             yield _state[0].readline(*args, **kwargs)
 * 
 *     def _iter_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             while True:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9mock_open_8_iter_side_effect, 0, __pyx_n_s_mock_open_locals__iter_side_effe, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v__iter_side_effect = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2809
 *             yield line
 * 
 *     def _next_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             return handle.readline.return_value
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9mock_open_11_next_side_effect, 0, __pyx_n_s_mock_open_locals__next_side_effe, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__next_side_effect = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2815
 * 
 *     global file_spec
 *     if file_spec is None:             # <<<<<<<<<<<<<<
 *         import _io
 *         file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file_spec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2815, __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;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "cymock.pyx":2816
 *     global file_spec
 *     if file_spec is None:
 *         import _io             # <<<<<<<<<<<<<<
 *         file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))
 * 
 */
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_io_2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v__io = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "cymock.pyx":2817
 *     if file_spec is None:
 *         import _io
 *         file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))             # <<<<<<<<<<<<<<
 * 
 *     if mock is None:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__io, __pyx_n_s_TextIOWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Dir(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PySet_New(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__io, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyObject_Dir(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PySet_New(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_spec, __pyx_t_3) < 0) __PYX_ERR(0, 2817, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cymock.pyx":2815
 * 
 *     global file_spec
 *     if file_spec is None:             # <<<<<<<<<<<<<<
 *         import _io
 *         file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))
 */
  }

  /* "cymock.pyx":2819
 *         file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))
 * 
 *     if mock is None:             # <<<<<<<<<<<<<<
 *         mock = MagicMock(name='open', spec=open)
 * 
 */
  __pyx_t_5 = (__pyx_v_mock == Py_None);
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "cymock.pyx":2820
 * 
 *     if mock is None:
 *         mock = MagicMock(name='open', spec=open)             # <<<<<<<<<<<<<<
 * 
 *     handle = MagicMock(spec=file_spec)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name_2, __pyx_n_u_open) < 0) __PYX_ERR(0, 2820, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_spec, __pyx_builtin_open) < 0) __PYX_ERR(0, 2820, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_mock, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cymock.pyx":2819
 *         file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))
 * 
 *     if mock is None:             # <<<<<<<<<<<<<<
 *         mock = MagicMock(name='open', spec=open)
 * 
 */
  }

  /* "cymock.pyx":2822
 *         mock = MagicMock(name='open', spec=open)
 * 
 *     handle = MagicMock(spec=file_spec)             # <<<<<<<<<<<<<<
 *     handle.__enter__.return_value = handle
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_file_spec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_spec, __pyx_t_3) < 0) __PYX_ERR(0, 2822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_handle = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":2823
 * 
 *     handle = MagicMock(spec=file_spec)
 *     handle.__enter__.return_value = handle             # <<<<<<<<<<<<<<
 * 
 *     handle.write.return_value = None
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_return_value, __pyx_cur_scope->__pyx_v_handle) < 0) __PYX_ERR(0, 2823, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2825
 *     handle.__enter__.return_value = handle
 * 
 *     handle.write.return_value = None             # <<<<<<<<<<<<<<
 *     handle.read.return_value = None
 *     handle.readline.return_value = None
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_return_value, Py_None) < 0) __PYX_ERR(0, 2825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2826
 * 
 *     handle.write.return_value = None
 *     handle.read.return_value = None             # <<<<<<<<<<<<<<
 *     handle.readline.return_value = None
 *     handle.readlines.return_value = None
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_return_value, Py_None) < 0) __PYX_ERR(0, 2826, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2827
 *     handle.write.return_value = None
 *     handle.read.return_value = None
 *     handle.readline.return_value = None             # <<<<<<<<<<<<<<
 *     handle.readlines.return_value = None
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_return_value, Py_None) < 0) __PYX_ERR(0, 2827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2828
 *     handle.read.return_value = None
 *     handle.readline.return_value = None
 *     handle.readlines.return_value = None             # <<<<<<<<<<<<<<
 * 
 *     handle.read.side_effect = _read_side_effect
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readlines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_return_value, Py_None) < 0) __PYX_ERR(0, 2828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2830
 *     handle.readlines.return_value = None
 * 
 *     handle.read.side_effect = _read_side_effect             # <<<<<<<<<<<<<<
 *     _state[1] = _readline_side_effect()
 *     handle.readline.side_effect = _state[1]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_side_effect, __pyx_v__read_side_effect) < 0) __PYX_ERR(0, 2830, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2831
 * 
 *     handle.read.side_effect = _read_side_effect
 *     _state[1] = _readline_side_effect()             # <<<<<<<<<<<<<<
 *     handle.readline.side_effect = _state[1]
 *     handle.readlines.side_effect = _readlines_side_effect
 */
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v__readline_side_effect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__Pyx_SetItemInt(__pyx_cur_scope->__pyx_v__state, 1, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 2831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2832
 *     handle.read.side_effect = _read_side_effect
 *     _state[1] = _readline_side_effect()
 *     handle.readline.side_effect = _state[1]             # <<<<<<<<<<<<<<
 *     handle.readlines.side_effect = _readlines_side_effect
 *     handle.__iter__.side_effect = _iter_side_effect
 */
  __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v__state, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_side_effect, __pyx_t_3) < 0) __PYX_ERR(0, 2832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2833
 *     _state[1] = _readline_side_effect()
 *     handle.readline.side_effect = _state[1]
 *     handle.readlines.side_effect = _readlines_side_effect             # <<<<<<<<<<<<<<
 *     handle.__iter__.side_effect = _iter_side_effect
 *     handle.__next__.side_effect = _next_side_effect
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_readlines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_side_effect, __pyx_v__readlines_side_effect) < 0) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2834
 *     handle.readline.side_effect = _state[1]
 *     handle.readlines.side_effect = _readlines_side_effect
 *     handle.__iter__.side_effect = _iter_side_effect             # <<<<<<<<<<<<<<
 *     handle.__next__.side_effect = _next_side_effect
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_side_effect, __pyx_cur_scope->__pyx_v__iter_side_effect) < 0) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2835
 *     handle.readlines.side_effect = _readlines_side_effect
 *     handle.__iter__.side_effect = _iter_side_effect
 *     handle.__next__.side_effect = _next_side_effect             # <<<<<<<<<<<<<<
 * 
 *     def reset_data(*args, **kwargs):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_handle, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_side_effect, __pyx_v__next_side_effect) < 0) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":2837
 *     handle.__next__.side_effect = _next_side_effect
 * 
 *     def reset_data(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         _state[0] = _to_stream(read_data)
 *         if handle.readline.side_effect == _state[1]:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9mock_open_13reset_data, 0, __pyx_n_s_mock_open_locals_reset_data, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reset_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cymock.pyx":2845
 *         return DEFAULT
 * 
 *     mock.side_effect = reset_data             # <<<<<<<<<<<<<<
 *     mock.return_value = handle
 *     return mock
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_mock, __pyx_n_s_side_effect, __pyx_v_reset_data) < 0) __PYX_ERR(0, 2845, __pyx_L1_error)

  /* "cymock.pyx":2846
 * 
 *     mock.side_effect = reset_data
 *     mock.return_value = handle             # <<<<<<<<<<<<<<
 *     return mock
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_mock, __pyx_n_s_return_value, __pyx_cur_scope->__pyx_v_handle) < 0) __PYX_ERR(0, 2846, __pyx_L1_error)

  /* "cymock.pyx":2847
 *     mock.side_effect = reset_data
 *     mock.return_value = handle
 *     return mock             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_mock);
  __pyx_r = __pyx_v_mock;
  goto __pyx_L0;

  /* "cymock.pyx":2772
 * 
 * 
 * def mock_open(mock=None, read_data=''):             # <<<<<<<<<<<<<<
 *     """
 *     A helper function to create a mock to replace the use of `open`. It works
 */

  /* 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_6);
  __Pyx_AddTraceback("cymock.mock_open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__read_data);
  __Pyx_XDECREF(__pyx_v__readlines_side_effect);
  __Pyx_XDECREF(__pyx_v__read_side_effect);
  __Pyx_XDECREF(__pyx_v__next_side_effect);
  __Pyx_XDECREF(__pyx_v__io);
  __Pyx_XDECREF(__pyx_v_reset_data);
  __Pyx_XDECREF(__pyx_v_mock);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2859
 *     no args. Setting it calls the mock with the value being set.
 *     """
 *     def _get_child_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         return MagicMock(**kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_12PropertyMock_1_get_child_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_12PropertyMock_1_get_child_mock = {"_get_child_mock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_12PropertyMock_1_get_child_mock, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_12PropertyMock_1_get_child_mock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_child_mock (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "_get_child_mock") < 0)) __PYX_ERR(0, 2859, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_child_mock", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2859, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("cymock.PropertyMock._get_child_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_12PropertyMock__get_child_mock(__pyx_self, __pyx_v_self, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_6cymock_12PropertyMock__get_child_mock(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_get_child_mock", 0);

  /* "cymock.pyx":2860
 *     """
 *     def _get_child_mock(self, **kwargs):
 *         return MagicMock(**kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def __get__(self, obj, obj_type=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MagicMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2860, __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;

  /* "cymock.pyx":2859
 *     no args. Setting it calls the mock with the value being set.
 *     """
 *     def _get_child_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         return MagicMock(**kwargs)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cymock.PropertyMock._get_child_mock", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2862
 *         return MagicMock(**kwargs)
 * 
 *     def __get__(self, obj, obj_type=None):             # <<<<<<<<<<<<<<
 *         return self()
 *     def __set__(self, obj, val):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_12PropertyMock_3__get__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_12PropertyMock_3__get__ = {"__get__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_12PropertyMock_3__get__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_12PropertyMock_3__get__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_obj = 0;
  CYTHON_UNUSED PyObject *__pyx_v_obj_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_obj,&__pyx_n_s_obj_type,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__get__", 0, 2, 3, 1); __PYX_ERR(0, 2862, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj_type);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__get__") < 0)) __PYX_ERR(0, 2862, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_obj = values[1];
    __pyx_v_obj_type = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__get__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2862, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.PropertyMock.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_12PropertyMock_2__get__(__pyx_self, __pyx_v_self, __pyx_v_obj, __pyx_v_obj_type);

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

static PyObject *__pyx_pf_6cymock_12PropertyMock_2__get__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_obj_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "cymock.pyx":2863
 * 
 *     def __get__(self, obj, obj_type=None):
 *         return self()             # <<<<<<<<<<<<<<
 *     def __set__(self, obj, val):
 *         self(val)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_t_2 = __pyx_v_self; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2863, __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;

  /* "cymock.pyx":2862
 *         return MagicMock(**kwargs)
 * 
 *     def __get__(self, obj, obj_type=None):             # <<<<<<<<<<<<<<
 *         return self()
 *     def __set__(self, obj, val):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cymock.PropertyMock.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2864
 *     def __get__(self, obj, obj_type=None):
 *         return self()
 *     def __set__(self, obj, val):             # <<<<<<<<<<<<<<
 *         self(val)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_12PropertyMock_5__set__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_12PropertyMock_5__set__ = {"__set__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_12PropertyMock_5__set__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_12PropertyMock_5__set__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_obj,&__pyx_n_s_val,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__set__", 1, 3, 3, 1); __PYX_ERR(0, 2864, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__set__", 1, 3, 3, 2); __PYX_ERR(0, 2864, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__set__") < 0)) __PYX_ERR(0, 2864, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_obj = values[1];
    __pyx_v_val = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__set__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2864, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock.PropertyMock.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_12PropertyMock_4__set__(__pyx_self, __pyx_v_self, __pyx_v_obj, __pyx_v_val);

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

static PyObject *__pyx_pf_6cymock_12PropertyMock_4__set__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "cymock.pyx":2865
 *         return self()
 *     def __set__(self, obj, val):
 *         self(val)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(__pyx_v_self);
  __pyx_t_2 = __pyx_v_self; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_val);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2865, __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;

  /* "cymock.pyx":2864
 *     def __get__(self, obj, obj_type=None):
 *         return self()
 *     def __set__(self, obj, val):             # <<<<<<<<<<<<<<
 *         self(val)
 * 
 */

  /* 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_AddTraceback("cymock.PropertyMock.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2868
 * 
 * 
 * def seal(mock):             # <<<<<<<<<<<<<<
 *     """Disable the automatic generation of child mocks.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_75seal(PyObject *__pyx_self, PyObject *__pyx_v_mock); /*proto*/
static char __pyx_doc_6cymock_74seal[] = "Disable the automatic generation of child mocks.\n\n    Given an input Mock, seals it to ensure no further mocks will be generated\n    when accessing an attribute that was not already defined.\n\n    The operation recursively seals the mock passed in, meaning that\n    the mock itself, any mocks generated by accessing one of its attributes,\n    and all assigned mocks without a name or spec will be sealed.\n    ";
static PyMethodDef __pyx_mdef_6cymock_75seal = {"seal", (PyCFunction)__pyx_pw_6cymock_75seal, METH_O, __pyx_doc_6cymock_74seal};
static PyObject *__pyx_pw_6cymock_75seal(PyObject *__pyx_self, PyObject *__pyx_v_mock) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seal (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_74seal(__pyx_self, ((PyObject *)__pyx_v_mock));

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

static PyObject *__pyx_pf_6cymock_74seal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mock) {
  PyObject *__pyx_v_attr = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("seal", 0);

  /* "cymock.pyx":2878
 *     and all assigned mocks without a name or spec will be sealed.
 *     """
 *     mock._mock_sealed = True             # <<<<<<<<<<<<<<
 *     for attr in dir(mock):
 *         try:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_mock, __pyx_n_s_mock_sealed, Py_True) < 0) __PYX_ERR(0, 2878, __pyx_L1_error)

  /* "cymock.pyx":2879
 *     """
 *     mock._mock_sealed = True
 *     for attr in dir(mock):             # <<<<<<<<<<<<<<
 *         try:
 *             m = getattr(mock, attr)
 */
  __pyx_t_1 = PyObject_Dir(__pyx_v_mock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2879, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2879, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2879, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2879, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cymock.pyx":2880
 *     mock._mock_sealed = True
 *     for attr in dir(mock):
 *         try:             # <<<<<<<<<<<<<<
 *             m = getattr(mock, attr)
 *         except AttributeError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "cymock.pyx":2881
 *     for attr in dir(mock):
 *         try:
 *             m = getattr(mock, attr)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             continue
 */
        __pyx_t_1 = __Pyx_GetAttr(__pyx_v_mock, __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2881, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "cymock.pyx":2880
 *     mock._mock_sealed = True
 *     for attr in dir(mock):
 *         try:             # <<<<<<<<<<<<<<
 *             m = getattr(mock, attr)
 *         except AttributeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cymock.pyx":2882
 *         try:
 *             m = getattr(mock, attr)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             continue
 *         if not isinstance(m, NonCallableMock):
 */
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("cymock.seal", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 2882, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_10);

        /* "cymock.pyx":2883
 *             m = getattr(mock, attr)
 *         except AttributeError:
 *             continue             # <<<<<<<<<<<<<<
 *         if not isinstance(m, NonCallableMock):
 *             continue
 */
        goto __pyx_L14_except_continue;
        __pyx_L14_except_continue:;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L11_try_continue;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "cymock.pyx":2880
 *     mock._mock_sealed = True
 *     for attr in dir(mock):
 *         try:             # <<<<<<<<<<<<<<
 *             m = getattr(mock, attr)
 *         except AttributeError:
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L11_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L3_continue;
      __pyx_L12_try_end:;
    }

    /* "cymock.pyx":2884
 *         except AttributeError:
 *             continue
 *         if not isinstance(m, NonCallableMock):             # <<<<<<<<<<<<<<
 *             continue
 *         if m._mock_new_parent is mock:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = PyObject_IsInstance(__pyx_v_m, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2884, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
    if (__pyx_t_12) {

      /* "cymock.pyx":2885
 *             continue
 *         if not isinstance(m, NonCallableMock):
 *             continue             # <<<<<<<<<<<<<<
 *         if m._mock_new_parent is mock:
 *             seal(m)
 */
      goto __pyx_L3_continue;

      /* "cymock.pyx":2884
 *         except AttributeError:
 *             continue
 *         if not isinstance(m, NonCallableMock):             # <<<<<<<<<<<<<<
 *             continue
 *         if m._mock_new_parent is mock:
 */
    }

    /* "cymock.pyx":2886
 *         if not isinstance(m, NonCallableMock):
 *             continue
 *         if m._mock_new_parent is mock:             # <<<<<<<<<<<<<<
 *             seal(m)
 * 
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_n_s_mock_new_parent); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = (__pyx_t_10 == __pyx_v_mock);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = (__pyx_t_12 != 0);
    if (__pyx_t_11) {

      /* "cymock.pyx":2887
 *             continue
 *         if m._mock_new_parent is mock:
 *             seal(m)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_seal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_10 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_1, __pyx_v_m) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_m);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2887, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cymock.pyx":2886
 *         if not isinstance(m, NonCallableMock):
 *             continue
 *         if m._mock_new_parent is mock:             # <<<<<<<<<<<<<<
 *             seal(m)
 * 
 */
    }

    /* "cymock.pyx":2879
 *     """
 *     mock._mock_sealed = True
 *     for attr in dir(mock):             # <<<<<<<<<<<<<<
 *         try:
 *             m = getattr(mock, attr)
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2868
 * 
 * 
 * def seal(mock):             # <<<<<<<<<<<<<<
 *     """Disable the automatic generation of child mocks.
 * 
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cymock.seal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attr);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2894
 *     Wraps an iterator in an asynchronous iterator.
 *     """
 *     def __init__(self, iterator):             # <<<<<<<<<<<<<<
 *         self.iterator = iterator
 *         code_mock = NonCallableMock(spec_set=CodeType)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14_AsyncIterator_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_14_AsyncIterator_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6cymock_14_AsyncIterator_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6cymock_14_AsyncIterator_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_iterator = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_iterator,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterator)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2894, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2894, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_iterator = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2894, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cymock._AsyncIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6cymock_14_AsyncIterator___init__(__pyx_self, __pyx_v_self, __pyx_v_iterator);

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

static PyObject *__pyx_pf_6cymock_14_AsyncIterator___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_iterator) {
  PyObject *__pyx_v_code_mock = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cymock.pyx":2895
 *     """
 *     def __init__(self, iterator):
 *         self.iterator = iterator             # <<<<<<<<<<<<<<
 *         code_mock = NonCallableMock(spec_set=CodeType)
 *         code_mock.co_flags = inspect.CO_ITERABLE_COROUTINE
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_iterator, __pyx_v_iterator) < 0) __PYX_ERR(0, 2895, __pyx_L1_error)

  /* "cymock.pyx":2896
 *     def __init__(self, iterator):
 *         self.iterator = iterator
 *         code_mock = NonCallableMock(spec_set=CodeType)             # <<<<<<<<<<<<<<
 *         code_mock.co_flags = inspect.CO_ITERABLE_COROUTINE
 *         self.__dict__['__code__'] = code_mock
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CodeType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_spec_set, __pyx_t_3) < 0) __PYX_ERR(0, 2896, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2896, __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_v_code_mock = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cymock.pyx":2897
 *         self.iterator = iterator
 *         code_mock = NonCallableMock(spec_set=CodeType)
 *         code_mock.co_flags = inspect.CO_ITERABLE_COROUTINE             # <<<<<<<<<<<<<<
 *         self.__dict__['__code__'] = code_mock
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_inspect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CO_ITERABLE_COROUTINE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_code_mock, __pyx_n_s_co_flags, __pyx_t_2) < 0) __PYX_ERR(0, 2897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2898
 *         code_mock = NonCallableMock(spec_set=CodeType)
 *         code_mock.co_flags = inspect.CO_ITERABLE_COROUTINE
 *         self.__dict__['__code__'] = code_mock             # <<<<<<<<<<<<<<
 * 
 *     def __aiter__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_u_code, __pyx_v_code_mock) < 0)) __PYX_ERR(0, 2898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2894
 *     Wraps an iterator in an asynchronous iterator.
 *     """
 *     def __init__(self, iterator):             # <<<<<<<<<<<<<<
 *         self.iterator = iterator
 *         code_mock = NonCallableMock(spec_set=CodeType)
 */

  /* 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_AddTraceback("cymock._AsyncIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_code_mock);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cymock.pyx":2900
 *         self.__dict__['__code__'] = code_mock
 * 
 *     def __aiter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14_AsyncIterator_3__aiter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_14_AsyncIterator_3__aiter__ = {"__aiter__", (PyCFunction)__pyx_pw_6cymock_14_AsyncIterator_3__aiter__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_14_AsyncIterator_3__aiter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__aiter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_14_AsyncIterator_2__aiter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_14_AsyncIterator_2__aiter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__aiter__", 0);

  /* "cymock.pyx":2901
 * 
 *     def __aiter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     async def __anext__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "cymock.pyx":2900
 *         self.__dict__['__code__'] = code_mock
 * 
 *     def __aiter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6cymock_14_AsyncIterator_6generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "cymock.pyx":2903
 *         return self
 * 
 *     async def __anext__(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return next(self.iterator)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6cymock_14_AsyncIterator_5__anext__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6cymock_14_AsyncIterator_5__anext__ = {"__anext__", (PyCFunction)__pyx_pw_6cymock_14_AsyncIterator_5__anext__, METH_O, 0};
static PyObject *__pyx_pw_6cymock_14_AsyncIterator_5__anext__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__anext__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6cymock_14_AsyncIterator_4__anext__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6cymock_14_AsyncIterator_4__anext__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__anext__", 0);
  __pyx_cur_scope = (struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *)__pyx_tp_new_6cymock___pyx_scope_struct_32___anext__(__pyx_ptype_6cymock___pyx_scope_struct_32___anext__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 2903, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_6cymock_14_AsyncIterator_6generator2, __pyx_codeobj__91, (PyObject *) __pyx_cur_scope, __pyx_n_s_anext, __pyx_n_s_AsyncIterator___anext, __pyx_n_s_cymock); if (unlikely(!gen)) __PYX_ERR(0, 2903, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cymock._AsyncIterator.__anext__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6cymock_14_AsyncIterator_6generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *__pyx_cur_scope = ((struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__anext__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2903, __pyx_L1_error)

  /* "cymock.pyx":2904
 * 
 *     async def __anext__(self):
 *         try:             # <<<<<<<<<<<<<<
 *             return next(self.iterator)
 *         except StopIteration:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "cymock.pyx":2905
 *     async def __anext__(self):
 *         try:
 *             return next(self.iterator)             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             pass
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_iterator); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2905, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2905, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L8_try_return;

      /* "cymock.pyx":2904
 * 
 *     async def __anext__(self):
 *         try:             # <<<<<<<<<<<<<<
 *             return next(self.iterator)
 *         except StopIteration:
 */
    }
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cymock.pyx":2906
 *         try:
 *             return next(self.iterator)
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             pass
 *         raise StopAsyncIteration
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_6) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "cymock.pyx":2904
 * 
 *     async def __anext__(self):
 *         try:             # <<<<<<<<<<<<<<
 *             return next(self.iterator)
 *         except StopIteration:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  }

  /* "cymock.pyx":2908
 *         except StopIteration:
 *             pass
 *         raise StopAsyncIteration             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(((PyObject *)(&((PyTypeObject*)__Pyx_PyExc_StopAsyncIteration)[0])), 0, 0, 0);
  __PYX_ERR(0, 2908, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "cymock.pyx":2903
 *         return self
 * 
 *     async def __anext__(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return next(self.iterator)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("__anext__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *__pyx_freelist_6cymock___pyx_scope_struct___check_signature[8];
static int __pyx_freecount_6cymock___pyx_scope_struct___check_signature = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct___check_signature(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct___check_signature > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct___check_signature)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct___check_signature[--__pyx_freecount_6cymock___pyx_scope_struct___check_signature];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct___check_signature));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct___check_signature(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *p = (struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_sig);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct___check_signature < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct___check_signature)))) {
    __pyx_freelist_6cymock___pyx_scope_struct___check_signature[__pyx_freecount_6cymock___pyx_scope_struct___check_signature++] = ((struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct___check_signature(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *p = (struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *)o;
  if (p->__pyx_v_sig) {
    e = (*v)(p->__pyx_v_sig, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct___check_signature(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *p = (struct __pyx_obj_6cymock___pyx_scope_struct___check_signature *)o;
  tmp = ((PyObject*)p->__pyx_v_sig);
  p->__pyx_v_sig = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct___check_signature = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct___check_signature", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct___check_signature), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct___check_signature, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct___check_signature, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct___check_signature, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct___check_signature, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *__pyx_freelist_6cymock___pyx_scope_struct_1__set_signature[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_1__set_signature = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_1__set_signature(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_1__set_signature > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_1__set_signature[--__pyx_freecount_6cymock___pyx_scope_struct_1__set_signature];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_1__set_signature(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *p = (struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_sig);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_1__set_signature < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_1__set_signature[__pyx_freecount_6cymock___pyx_scope_struct_1__set_signature++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_1__set_signature(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *p = (struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *)o;
  if (p->__pyx_v_sig) {
    e = (*v)(p->__pyx_v_sig, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_1__set_signature(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *p = (struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature *)o;
  tmp = ((PyObject*)p->__pyx_v_sig);
  p->__pyx_v_sig = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_1__set_signature = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_1__set_signature", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_1__set_signature), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_1__set_signature, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_1__set_signature, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_1__set_signature, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_1__set_signature, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *__pyx_freelist_6cymock___pyx_scope_struct_2__setup_func[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_2__setup_func = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_2__setup_func(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_2__setup_func > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_2__setup_func[--__pyx_freecount_6cymock___pyx_scope_struct_2__setup_func];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_2__setup_func(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *p = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_funcopy);
  Py_CLEAR(p->__pyx_v_mock);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_2__setup_func < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_2__setup_func[__pyx_freecount_6cymock___pyx_scope_struct_2__setup_func++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_2__setup_func(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *p = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *)o;
  if (p->__pyx_v_funcopy) {
    e = (*v)(p->__pyx_v_funcopy, a); if (e) return e;
  }
  if (p->__pyx_v_mock) {
    e = (*v)(p->__pyx_v_mock, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_2__setup_func(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *p = (struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func *)o;
  tmp = ((PyObject*)p->__pyx_v_funcopy);
  p->__pyx_v_funcopy = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_mock);
  p->__pyx_v_mock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_2__setup_func = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_2__setup_func", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_2__setup_func), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_2__setup_func, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_2__setup_func, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_2__setup_func, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_2__setup_func, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *__pyx_freelist_6cymock___pyx_scope_struct_3__setup_async_mock[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_3__setup_async_mock = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_3__setup_async_mock(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_3__setup_async_mock > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_3__setup_async_mock[--__pyx_freecount_6cymock___pyx_scope_struct_3__setup_async_mock];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_3__setup_async_mock(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *p = (struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_mock);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_3__setup_async_mock < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_3__setup_async_mock[__pyx_freecount_6cymock___pyx_scope_struct_3__setup_async_mock++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_3__setup_async_mock(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *p = (struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *)o;
  if (p->__pyx_v_mock) {
    e = (*v)(p->__pyx_v_mock, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_3__setup_async_mock(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *p = (struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock *)o;
  tmp = ((PyObject*)p->__pyx_v_mock);
  p->__pyx_v_mock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_3__setup_async_mock = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_3__setup_async_mock", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_3__setup_async_mock), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_3__setup_async_mock, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_3__setup_async_mock, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_3__setup_async_mock, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_3__setup_async_mock, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *__pyx_freelist_6cymock___pyx_scope_struct_4___setattr__[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_4___setattr__ = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_4___setattr__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_4___setattr__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_4___setattr__[--__pyx_freecount_6cymock___pyx_scope_struct_4___setattr__];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_4___setattr__(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *p = (struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_original);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_4___setattr__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_4___setattr__[__pyx_freecount_6cymock___pyx_scope_struct_4___setattr__++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_4___setattr__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *p = (struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *)o;
  if (p->__pyx_v_original) {
    e = (*v)(p->__pyx_v_original, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_4___setattr__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *p = (struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__ *)o;
  tmp = ((PyObject*)p->__pyx_v_original);
  p->__pyx_v_original = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_4___setattr__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_4___setattr__", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_4___setattr__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_4___setattr__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_4___setattr__, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_4___setattr__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_4___setattr__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *__pyx_freelist_6cymock___pyx_scope_struct_5_assert_called_with[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_5_assert_called_with = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_5_assert_called_with(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_5_assert_called_with > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_5_assert_called_with[--__pyx_freecount_6cymock___pyx_scope_struct_5_assert_called_with];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_5_assert_called_with(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *p = (struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_kwargs);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_5_assert_called_with < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_5_assert_called_with[__pyx_freecount_6cymock___pyx_scope_struct_5_assert_called_with++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_5_assert_called_with(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *p = (struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_kwargs) {
    e = (*v)(p->__pyx_v_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_5_assert_called_with(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *p = (struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_kwargs);
  p->__pyx_v_kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_5_assert_called_with = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_5_assert_called_with", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_5_assert_called_with), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_5_assert_called_with, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_5_assert_called_with, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_5_assert_called_with, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_5_assert_called_with, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *__pyx_freelist_6cymock___pyx_scope_struct_6_assert_has_calls[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_6_assert_has_calls = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_6_assert_has_calls(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_6_assert_has_calls > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_6_assert_has_calls[--__pyx_freecount_6cymock___pyx_scope_struct_6_assert_has_calls];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_6_assert_has_calls(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *p = (struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_expected);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_6_assert_has_calls < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_6_assert_has_calls[__pyx_freecount_6cymock___pyx_scope_struct_6_assert_has_calls++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_6_assert_has_calls(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *p = (struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *)o;
  if (p->__pyx_v_expected) {
    e = (*v)(p->__pyx_v_expected, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_6_assert_has_calls(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *p = (struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls *)o;
  tmp = ((PyObject*)p->__pyx_v_expected);
  p->__pyx_v_expected = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_6_assert_has_calls = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_6_assert_has_calls", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_6_assert_has_calls), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_6_assert_has_calls, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_6_assert_has_calls, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_6_assert_has_calls, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_6_assert_has_calls, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *__pyx_freelist_6cymock___pyx_scope_struct_7_genexpr[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_7_genexpr = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_7_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_7_genexpr[--__pyx_freecount_6cymock___pyx_scope_struct_7_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_7_genexpr(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_e);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_7_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_7_genexpr[__pyx_freecount_6cymock___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_e) {
    e = (*v)(p->__pyx_v_e, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_7_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_7_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_7_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_7_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_7_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_7_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *__pyx_freelist_6cymock___pyx_scope_struct_8_genexpr[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_8_genexpr = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_8_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_8_genexpr[--__pyx_freecount_6cymock___pyx_scope_struct_8_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_8_genexpr(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_c);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_8_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_8_genexpr[__pyx_freecount_6cymock___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_8_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_8_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_8_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_8_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_8_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_8_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *__pyx_freelist_6cymock___pyx_scope_struct_9_decoration_helper[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_9_decoration_helper = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_9_decoration_helper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_9_decoration_helper > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_9_decoration_helper[--__pyx_freecount_6cymock___pyx_scope_struct_9_decoration_helper];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_9_decoration_helper(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *p = (struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_arg);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_entered_patchers);
  Py_CLEAR(p->__pyx_v_exc_info);
  Py_CLEAR(p->__pyx_v_extra_args);
  Py_CLEAR(p->__pyx_v_keywargs);
  Py_CLEAR(p->__pyx_v_patched);
  Py_CLEAR(p->__pyx_v_patching);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_9_decoration_helper < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_9_decoration_helper[__pyx_freecount_6cymock___pyx_scope_struct_9_decoration_helper++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_9_decoration_helper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *p = (struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper *)o;
  if (p->__pyx_v_arg) {
    e = (*v)(p->__pyx_v_arg, a); if (e) return e;
  }
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_entered_patchers) {
    e = (*v)(p->__pyx_v_entered_patchers, a); if (e) return e;
  }
  if (p->__pyx_v_exc_info) {
    e = (*v)(p->__pyx_v_exc_info, a); if (e) return e;
  }
  if (p->__pyx_v_extra_args) {
    e = (*v)(p->__pyx_v_extra_args, a); if (e) return e;
  }
  if (p->__pyx_v_keywargs) {
    e = (*v)(p->__pyx_v_keywargs, a); if (e) return e;
  }
  if (p->__pyx_v_patched) {
    e = (*v)(p->__pyx_v_patched, a); if (e) return e;
  }
  if (p->__pyx_v_patching) {
    e = (*v)(p->__pyx_v_patching, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_9_decoration_helper = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_9_decoration_helper", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_9_decoration_helper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_9_decoration_helper, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_9_decoration_helper, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_9_decoration_helper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *__pyx_freelist_6cymock___pyx_scope_struct_10_decorate_callable[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_10_decorate_callable = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_10_decorate_callable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_10_decorate_callable > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_10_decorate_callable[--__pyx_freecount_6cymock___pyx_scope_struct_10_decorate_callable];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_10_decorate_callable(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *p = (struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_func);
  Py_CLEAR(p->__pyx_v_patched);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_10_decorate_callable < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_10_decorate_callable[__pyx_freecount_6cymock___pyx_scope_struct_10_decorate_callable++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_10_decorate_callable(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *p = (struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *)o;
  if (p->__pyx_v_func) {
    e = (*v)(p->__pyx_v_func, a); if (e) return e;
  }
  if (p->__pyx_v_patched) {
    e = (*v)(p->__pyx_v_patched, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_10_decorate_callable(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *p = (struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable *)o;
  tmp = ((PyObject*)p->__pyx_v_func);
  p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_patched);
  p->__pyx_v_patched = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_10_decorate_callable = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_10_decorate_callable", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_10_decorate_callable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_10_decorate_callable, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_10_decorate_callable, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_10_decorate_callable, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_10_decorate_callable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *__pyx_freelist_6cymock___pyx_scope_struct_11_decorate_async_callable[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_11_decorate_async_callable = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_11_decorate_async_callable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_11_decorate_async_callable > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_11_decorate_async_callable[--__pyx_freecount_6cymock___pyx_scope_struct_11_decorate_async_callable];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_11_decorate_async_callable(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *p = (struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_func);
  Py_CLEAR(p->__pyx_v_patched);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_11_decorate_async_callable < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_11_decorate_async_callable[__pyx_freecount_6cymock___pyx_scope_struct_11_decorate_async_callable++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_11_decorate_async_callable(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *p = (struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *)o;
  if (p->__pyx_v_func) {
    e = (*v)(p->__pyx_v_func, a); if (e) return e;
  }
  if (p->__pyx_v_patched) {
    e = (*v)(p->__pyx_v_patched, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_11_decorate_async_callable(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *p = (struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable *)o;
  tmp = ((PyObject*)p->__pyx_v_func);
  p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_patched);
  p->__pyx_v_patched = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_11_decorate_async_callable = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_11_decorate_async_callable", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_11_decorate_async_callable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_11_decorate_async_callable, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_11_decorate_async_callable, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_11_decorate_async_callable, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_11_decorate_async_callable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *__pyx_freelist_6cymock___pyx_scope_struct_12_patched[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_12_patched = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_12_patched(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_12_patched > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_12_patched)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_12_patched[--__pyx_freecount_6cymock___pyx_scope_struct_12_patched];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_12_patched));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_12_patched(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *p = (struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_keywargs);
  Py_CLEAR(p->__pyx_v_newargs);
  Py_CLEAR(p->__pyx_v_newkeywargs);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_12_patched < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_12_patched)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_12_patched[__pyx_freecount_6cymock___pyx_scope_struct_12_patched++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_12_patched(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *p = (struct __pyx_obj_6cymock___pyx_scope_struct_12_patched *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_keywargs) {
    e = (*v)(p->__pyx_v_keywargs, a); if (e) return e;
  }
  if (p->__pyx_v_newargs) {
    e = (*v)(p->__pyx_v_newargs, a); if (e) return e;
  }
  if (p->__pyx_v_newkeywargs) {
    e = (*v)(p->__pyx_v_newkeywargs, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_12_patched = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_12_patched", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_12_patched), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_12_patched, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_12_patched, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_12_patched, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *__pyx_freelist_6cymock___pyx_scope_struct_13__get_target[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_13__get_target = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_13__get_target(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_13__get_target > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_13__get_target[--__pyx_freecount_6cymock___pyx_scope_struct_13__get_target];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_13__get_target(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *p = (struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_target);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_13__get_target < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_13__get_target[__pyx_freecount_6cymock___pyx_scope_struct_13__get_target++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_13__get_target(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *p = (struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *)o;
  if (p->__pyx_v_target) {
    e = (*v)(p->__pyx_v_target, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_13__get_target(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *p = (struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target *)o;
  tmp = ((PyObject*)p->__pyx_v_target);
  p->__pyx_v_target = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_13__get_target = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_13__get_target", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_13__get_target), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_13__get_target, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_13__get_target, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_13__get_target, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_13__get_target, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *__pyx_freelist_6cymock___pyx_scope_struct_14__patch_object[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_14__patch_object = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_14__patch_object(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_14__patch_object > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_14__patch_object[--__pyx_freecount_6cymock___pyx_scope_struct_14__patch_object];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_14__patch_object(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *p = (struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_target);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_14__patch_object < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_14__patch_object[__pyx_freecount_6cymock___pyx_scope_struct_14__patch_object++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_14__patch_object(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *p = (struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *)o;
  if (p->__pyx_v_target) {
    e = (*v)(p->__pyx_v_target, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_14__patch_object(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *p = (struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object *)o;
  tmp = ((PyObject*)p->__pyx_v_target);
  p->__pyx_v_target = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_14__patch_object = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_14__patch_object", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_14__patch_object), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_14__patch_object, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_14__patch_object, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_14__patch_object, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_14__patch_object, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *__pyx_freelist_6cymock___pyx_scope_struct_15__patch_multiple[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_15__patch_multiple = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_15__patch_multiple(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_15__patch_multiple > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_15__patch_multiple[--__pyx_freecount_6cymock___pyx_scope_struct_15__patch_multiple];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_15__patch_multiple(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *p = (struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_target);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_15__patch_multiple < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_15__patch_multiple[__pyx_freecount_6cymock___pyx_scope_struct_15__patch_multiple++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_15__patch_multiple(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *p = (struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *)o;
  if (p->__pyx_v_target) {
    e = (*v)(p->__pyx_v_target, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_15__patch_multiple(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *p = (struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple *)o;
  tmp = ((PyObject*)p->__pyx_v_target);
  p->__pyx_v_target = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_15__patch_multiple = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_15__patch_multiple", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_15__patch_multiple), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_15__patch_multiple, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_15__patch_multiple, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_15__patch_multiple, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_15__patch_multiple, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *__pyx_freelist_6cymock___pyx_scope_struct_16___call__[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_16___call__ = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_16___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_16___call__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_16___call__)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_16___call__[--__pyx_freecount_6cymock___pyx_scope_struct_16___call__];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_16___call__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_16___call__(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *p = (struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_f);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_16___call__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_16___call__)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_16___call__[__pyx_freecount_6cymock___pyx_scope_struct_16___call__++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_16___call__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *p = (struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *)o;
  if (p->__pyx_v_f) {
    e = (*v)(p->__pyx_v_f, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_16___call__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *p = (struct __pyx_obj_6cymock___pyx_scope_struct_16___call__ *)o;
  tmp = ((PyObject*)p->__pyx_v_f);
  p->__pyx_v_f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_16___call__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_16___call__", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_16___call__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_16___call__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_16___call__, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_16___call__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_16___call__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *__pyx_freelist_6cymock___pyx_scope_struct_17_genexpr[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_17_genexpr = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_17_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_17_genexpr[--__pyx_freecount_6cymock___pyx_scope_struct_17_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_17_genexpr(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_n);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_17_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_17_genexpr[__pyx_freecount_6cymock___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr *)o;
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_17_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_17_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_17_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_17_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_17_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_17_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *__pyx_freelist_6cymock___pyx_scope_struct_18_genexpr[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_18_genexpr = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_18_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_18_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_18_genexpr[--__pyx_freecount_6cymock___pyx_scope_struct_18_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_18_genexpr(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_n);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_18_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_18_genexpr[__pyx_freecount_6cymock___pyx_scope_struct_18_genexpr++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_18_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr *)o;
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_18_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_18_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_18_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_18_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_18_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_18_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *__pyx_freelist_6cymock___pyx_scope_struct_19__get_method[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_19__get_method = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_19__get_method(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_19__get_method > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_19__get_method[--__pyx_freecount_6cymock___pyx_scope_struct_19__get_method];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_19__get_method(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *p = (struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_func);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_19__get_method < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_19__get_method[__pyx_freecount_6cymock___pyx_scope_struct_19__get_method++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_19__get_method(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *p = (struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *)o;
  if (p->__pyx_v_func) {
    e = (*v)(p->__pyx_v_func, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_19__get_method(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *p = (struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method *)o;
  tmp = ((PyObject*)p->__pyx_v_func);
  p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_19__get_method = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_19__get_method", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_19__get_method), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_19__get_method, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_19__get_method, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_19__get_method, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_19__get_method, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *__pyx_freelist_6cymock___pyx_scope_struct_20__get_eq[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_20__get_eq = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_20__get_eq(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_20__get_eq > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_20__get_eq[--__pyx_freecount_6cymock___pyx_scope_struct_20__get_eq];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_20__get_eq(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *p = (struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_20__get_eq < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_20__get_eq[__pyx_freecount_6cymock___pyx_scope_struct_20__get_eq++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_20__get_eq(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *p = (struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_20__get_eq(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *p = (struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_20__get_eq = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_20__get_eq", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_20__get_eq), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_20__get_eq, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_20__get_eq, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_20__get_eq, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_20__get_eq, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *__pyx_freelist_6cymock___pyx_scope_struct_21__get_ne[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_21__get_ne = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_21__get_ne(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_21__get_ne > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_21__get_ne[--__pyx_freecount_6cymock___pyx_scope_struct_21__get_ne];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_21__get_ne(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *p = (struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_21__get_ne < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_21__get_ne[__pyx_freecount_6cymock___pyx_scope_struct_21__get_ne++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_21__get_ne(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *p = (struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_21__get_ne(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *p = (struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_21__get_ne = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_21__get_ne", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_21__get_ne), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_21__get_ne, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_21__get_ne, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_21__get_ne, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_21__get_ne, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *__pyx_freelist_6cymock___pyx_scope_struct_22__get_iter[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_22__get_iter = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_22__get_iter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_22__get_iter > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_22__get_iter[--__pyx_freecount_6cymock___pyx_scope_struct_22__get_iter];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_22__get_iter(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *p = (struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_22__get_iter < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_22__get_iter[__pyx_freecount_6cymock___pyx_scope_struct_22__get_iter++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_22__get_iter(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *p = (struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_22__get_iter(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *p = (struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_22__get_iter = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_22__get_iter", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_22__get_iter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_22__get_iter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_22__get_iter, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_22__get_iter, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_22__get_iter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *__pyx_freelist_6cymock___pyx_scope_struct_23__get_async_iter[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_23__get_async_iter = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_23__get_async_iter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_23__get_async_iter > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_23__get_async_iter[--__pyx_freecount_6cymock___pyx_scope_struct_23__get_async_iter];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_23__get_async_iter(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *p = (struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_23__get_async_iter < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_23__get_async_iter[__pyx_freecount_6cymock___pyx_scope_struct_23__get_async_iter++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_23__get_async_iter(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *p = (struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_23__get_async_iter(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *p = (struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_23__get_async_iter = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_23__get_async_iter", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_23__get_async_iter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_23__get_async_iter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_23__get_async_iter, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_23__get_async_iter, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_23__get_async_iter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *__pyx_freelist_6cymock___pyx_scope_struct_24__execute_mock_call[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_24__execute_mock_call = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_24__execute_mock_call(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_24__execute_mock_call > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_24__execute_mock_call[--__pyx_freecount_6cymock___pyx_scope_struct_24__execute_mock_call];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_24__execute_mock_call(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *p = (struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v__call);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_effect);
  Py_CLEAR(p->__pyx_v_kwargs);
  Py_CLEAR(p->__pyx_v_result);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_24__execute_mock_call < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_24__execute_mock_call[__pyx_freecount_6cymock___pyx_scope_struct_24__execute_mock_call++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_24__execute_mock_call(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *p = (struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call *)o;
  if (p->__pyx_v__call) {
    e = (*v)(p->__pyx_v__call, a); if (e) return e;
  }
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_effect) {
    e = (*v)(p->__pyx_v_effect, a); if (e) return e;
  }
  if (p->__pyx_v_kwargs) {
    e = (*v)(p->__pyx_v_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_result) {
    e = (*v)(p->__pyx_v_result, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_24__execute_mock_call = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_24__execute_mock_call", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_24__execute_mock_call), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_24__execute_mock_call, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_24__execute_mock_call, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_24__execute_mock_call, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *__pyx_freelist_6cymock___pyx_scope_struct_25_assert_awaited_with[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_25_assert_awaited_with = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_25_assert_awaited_with(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_25_assert_awaited_with > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_25_assert_awaited_with[--__pyx_freecount_6cymock___pyx_scope_struct_25_assert_awaited_with];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_25_assert_awaited_with(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *p = (struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_kwargs);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_25_assert_awaited_with < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_25_assert_awaited_with[__pyx_freecount_6cymock___pyx_scope_struct_25_assert_awaited_with++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_25_assert_awaited_with(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *p = (struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_kwargs) {
    e = (*v)(p->__pyx_v_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_25_assert_awaited_with(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *p = (struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_kwargs);
  p->__pyx_v_kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_25_assert_awaited_with = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_25_assert_awaited_with", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_25_assert_awaited_with), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_25_assert_awaited_with, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_25_assert_awaited_with, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_25_assert_awaited_with, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_25_assert_awaited_with, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *__pyx_freelist_6cymock___pyx_scope_struct_26_assert_has_awaits[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_26_assert_has_awaits = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_26_assert_has_awaits(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_26_assert_has_awaits > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_26_assert_has_awaits[--__pyx_freecount_6cymock___pyx_scope_struct_26_assert_has_awaits];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_26_assert_has_awaits(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *p = (struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_expected);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_26_assert_has_awaits < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_26_assert_has_awaits[__pyx_freecount_6cymock___pyx_scope_struct_26_assert_has_awaits++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_26_assert_has_awaits(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *p = (struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *)o;
  if (p->__pyx_v_expected) {
    e = (*v)(p->__pyx_v_expected, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_26_assert_has_awaits(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *p = (struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits *)o;
  tmp = ((PyObject*)p->__pyx_v_expected);
  p->__pyx_v_expected = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_26_assert_has_awaits = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_26_assert_has_awaits", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_26_assert_has_awaits), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_26_assert_has_awaits, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_26_assert_has_awaits, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_26_assert_has_awaits, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_26_assert_has_awaits, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *__pyx_freelist_6cymock___pyx_scope_struct_27_genexpr[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_27_genexpr = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_27_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_27_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_27_genexpr[--__pyx_freecount_6cymock___pyx_scope_struct_27_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_27_genexpr(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_e);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_27_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_27_genexpr[__pyx_freecount_6cymock___pyx_scope_struct_27_genexpr++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_27_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_e) {
    e = (*v)(p->__pyx_v_e, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_27_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_27_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_27_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_27_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_27_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_27_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *__pyx_freelist_6cymock___pyx_scope_struct_28_genexpr[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_28_genexpr = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_28_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_28_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_28_genexpr[--__pyx_freecount_6cymock___pyx_scope_struct_28_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_28_genexpr(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_c);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_28_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_28_genexpr[__pyx_freecount_6cymock___pyx_scope_struct_28_genexpr++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_28_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_28_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_28_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_28_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_28_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_28_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_28_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *__pyx_freelist_6cymock___pyx_scope_struct_29_mock_open[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_29_mock_open = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_29_mock_open(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_29_mock_open > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_29_mock_open[--__pyx_freecount_6cymock___pyx_scope_struct_29_mock_open];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_29_mock_open(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *p = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v__iter_side_effect);
  Py_CLEAR(p->__pyx_v__readline_side_effect);
  Py_CLEAR(p->__pyx_v__state);
  Py_CLEAR(p->__pyx_v_handle);
  Py_CLEAR(p->__pyx_v_read_data);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_29_mock_open < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_29_mock_open[__pyx_freecount_6cymock___pyx_scope_struct_29_mock_open++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_29_mock_open(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *p = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *)o;
  if (p->__pyx_v__iter_side_effect) {
    e = (*v)(p->__pyx_v__iter_side_effect, a); if (e) return e;
  }
  if (p->__pyx_v__readline_side_effect) {
    e = (*v)(p->__pyx_v__readline_side_effect, a); if (e) return e;
  }
  if (p->__pyx_v__state) {
    e = (*v)(p->__pyx_v__state, a); if (e) return e;
  }
  if (p->__pyx_v_handle) {
    e = (*v)(p->__pyx_v_handle, a); if (e) return e;
  }
  if (p->__pyx_v_read_data) {
    e = (*v)(p->__pyx_v_read_data, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6cymock___pyx_scope_struct_29_mock_open(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *p = (struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open *)o;
  tmp = ((PyObject*)p->__pyx_v__iter_side_effect);
  p->__pyx_v__iter_side_effect = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v__readline_side_effect);
  p->__pyx_v__readline_side_effect = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v__state);
  p->__pyx_v__state = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_handle);
  p->__pyx_v_handle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_read_data);
  p->__pyx_v_read_data = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_29_mock_open = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_29_mock_open", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_29_mock_open), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_29_mock_open, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_29_mock_open, /*tp_traverse*/
  __pyx_tp_clear_6cymock___pyx_scope_struct_29_mock_open, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_29_mock_open, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *__pyx_freelist_6cymock___pyx_scope_struct_30__readline_side_effect[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_30__readline_side_effect = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_30__readline_side_effect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_30__readline_side_effect > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_30__readline_side_effect[--__pyx_freecount_6cymock___pyx_scope_struct_30__readline_side_effect];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_30__readline_side_effect(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *p = (struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_kwargs);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_30__readline_side_effect < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_30__readline_side_effect[__pyx_freecount_6cymock___pyx_scope_struct_30__readline_side_effect++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_30__readline_side_effect(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *p = (struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_kwargs) {
    e = (*v)(p->__pyx_v_kwargs, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_30__readline_side_effect = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_30__readline_side_effect", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_30__readline_side_effect), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_30__readline_side_effect, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_30__readline_side_effect, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_30__readline_side_effect, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *__pyx_freelist_6cymock___pyx_scope_struct_31__iter_side_effect[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_31__iter_side_effect = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_31__iter_side_effect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_31__iter_side_effect > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_31__iter_side_effect[--__pyx_freecount_6cymock___pyx_scope_struct_31__iter_side_effect];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_31__iter_side_effect(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *p = (struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_line);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_31__iter_side_effect < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_31__iter_side_effect[__pyx_freecount_6cymock___pyx_scope_struct_31__iter_side_effect++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_31__iter_side_effect(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *p = (struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_line) {
    e = (*v)(p->__pyx_v_line, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_31__iter_side_effect = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_31__iter_side_effect", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_31__iter_side_effect), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_31__iter_side_effect, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_31__iter_side_effect, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_31__iter_side_effect, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *__pyx_freelist_6cymock___pyx_scope_struct_32___anext__[8];
static int __pyx_freecount_6cymock___pyx_scope_struct_32___anext__ = 0;

static PyObject *__pyx_tp_new_6cymock___pyx_scope_struct_32___anext__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6cymock___pyx_scope_struct_32___anext__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__)))) {
    o = (PyObject*)__pyx_freelist_6cymock___pyx_scope_struct_32___anext__[--__pyx_freecount_6cymock___pyx_scope_struct_32___anext__];
    memset(o, 0, sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6cymock___pyx_scope_struct_32___anext__(PyObject *o) {
  struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *p = (struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6cymock___pyx_scope_struct_32___anext__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__)))) {
    __pyx_freelist_6cymock___pyx_scope_struct_32___anext__[__pyx_freecount_6cymock___pyx_scope_struct_32___anext__++] = ((struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6cymock___pyx_scope_struct_32___anext__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *p = (struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_6cymock___pyx_scope_struct_32___anext__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "cymock.__pyx_scope_struct_32___anext__", /*tp_name*/
  sizeof(struct __pyx_obj_6cymock___pyx_scope_struct_32___anext__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6cymock___pyx_scope_struct_32___anext__, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6cymock___pyx_scope_struct_32___anext__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6cymock___pyx_scope_struct_32___anext__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_cymock(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_cymock},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "cymock",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_kp_u_1_0, __pyx_k_1_0, sizeof(__pyx_k_1_0), 0, 1, 0, 0},
  {&__pyx_kp_u_ANY, __pyx_k_ANY, sizeof(__pyx_k_ANY), 0, 1, 0, 0},
  {&__pyx_n_s_ANY_2, __pyx_k_ANY_2, sizeof(__pyx_k_ANY_2), 0, 0, 1, 1},
  {&__pyx_n_u_ANY_2, __pyx_k_ANY_2, sizeof(__pyx_k_ANY_2), 0, 1, 0, 1},
  {&__pyx_n_s_ANY_3, __pyx_k_ANY_3, sizeof(__pyx_k_ANY_3), 0, 0, 1, 1},
  {&__pyx_n_s_ANY___eq, __pyx_k_ANY___eq, sizeof(__pyx_k_ANY___eq), 0, 0, 1, 1},
  {&__pyx_n_s_ANY___ne, __pyx_k_ANY___ne, sizeof(__pyx_k_ANY___ne), 0, 0, 1, 1},
  {&__pyx_n_s_ANY___repr, __pyx_k_ANY___repr, sizeof(__pyx_k_ANY___repr), 0, 0, 1, 1},
  {&__pyx_kp_s_A_helper_object_that_compares_eq, __pyx_k_A_helper_object_that_compares_eq, sizeof(__pyx_k_A_helper_object_that_compares_eq), 0, 0, 1, 0},
  {&__pyx_kp_s_A_mock_intended_to_be_used_as_a, __pyx_k_A_mock_intended_to_be_used_as_a, sizeof(__pyx_k_A_mock_intended_to_be_used_as_a), 0, 0, 1, 0},
  {&__pyx_kp_s_A_non_callable_version_of_Mock, __pyx_k_A_non_callable_version_of_Mock, sizeof(__pyx_k_A_non_callable_version_of_Mock), 0, 0, 1, 0},
  {&__pyx_kp_s_A_tuple_for_holding_the_results, __pyx_k_A_tuple_for_holding_the_results, sizeof(__pyx_k_A_tuple_for_holding_the_results), 0, 0, 1, 0},
  {&__pyx_kp_s_A_unique_named_sentinel_object, __pyx_k_A_unique_named_sentinel_object, sizeof(__pyx_k_A_unique_named_sentinel_object), 0, 0, 1, 0},
  {&__pyx_kp_s_A_version_of_MagicMock_that_isn, __pyx_k_A_version_of_MagicMock_that_isn, sizeof(__pyx_k_A_version_of_MagicMock_that_isn), 0, 0, 1, 0},
  {&__pyx_kp_s_Access_attributes_to_return_a_na, __pyx_k_Access_attributes_to_return_a_na, sizeof(__pyx_k_Access_attributes_to_return_a_na), 0, 0, 1, 0},
  {&__pyx_kp_u_Actual, __pyx_k_Actual, sizeof(__pyx_k_Actual), 0, 1, 0, 0},
  {&__pyx_n_u_Actual_2, __pyx_k_Actual_2, sizeof(__pyx_k_Actual_2), 0, 1, 0, 1},
  {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncIterator, __pyx_k_AsyncIterator, sizeof(__pyx_k_AsyncIterator), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncIterator___aiter, __pyx_k_AsyncIterator___aiter, sizeof(__pyx_k_AsyncIterator___aiter), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncIterator___anext, __pyx_k_AsyncIterator___anext, sizeof(__pyx_k_AsyncIterator___anext), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncIterator___init, __pyx_k_AsyncIterator___init, sizeof(__pyx_k_AsyncIterator___init), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMagicMixin, __pyx_k_AsyncMagicMixin, sizeof(__pyx_k_AsyncMagicMixin), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMagicMixin___init, __pyx_k_AsyncMagicMixin___init, sizeof(__pyx_k_AsyncMagicMixin___init), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMock, __pyx_k_AsyncMock, sizeof(__pyx_k_AsyncMock), 0, 0, 1, 1},
  {&__pyx_n_u_AsyncMock, __pyx_k_AsyncMock, sizeof(__pyx_k_AsyncMock), 0, 1, 0, 1},
  {&__pyx_n_s_AsyncMockMixin, __pyx_k_AsyncMockMixin, sizeof(__pyx_k_AsyncMockMixin), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin___init, __pyx_k_AsyncMockMixin___init, sizeof(__pyx_k_AsyncMockMixin___init), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin__execute_mock_cal, __pyx_k_AsyncMockMixin__execute_mock_cal, sizeof(__pyx_k_AsyncMockMixin__execute_mock_cal), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_any_await, __pyx_k_AsyncMockMixin_assert_any_await, sizeof(__pyx_k_AsyncMockMixin_assert_any_await), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_awaited, __pyx_k_AsyncMockMixin_assert_awaited, sizeof(__pyx_k_AsyncMockMixin_assert_awaited), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_awaited_on, __pyx_k_AsyncMockMixin_assert_awaited_on, sizeof(__pyx_k_AsyncMockMixin_assert_awaited_on), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_awaited_on_2, __pyx_k_AsyncMockMixin_assert_awaited_on_2, sizeof(__pyx_k_AsyncMockMixin_assert_awaited_on_2), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_awaited_wi, __pyx_k_AsyncMockMixin_assert_awaited_wi, sizeof(__pyx_k_AsyncMockMixin_assert_awaited_wi), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_awaited_wi_2, __pyx_k_AsyncMockMixin_assert_awaited_wi_2, sizeof(__pyx_k_AsyncMockMixin_assert_awaited_wi_2), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_has_awaits, __pyx_k_AsyncMockMixin_assert_has_awaits, sizeof(__pyx_k_AsyncMockMixin_assert_has_awaits), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_has_awaits_2, __pyx_k_AsyncMockMixin_assert_has_awaits_2, sizeof(__pyx_k_AsyncMockMixin_assert_has_awaits_2), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_assert_not_awaite, __pyx_k_AsyncMockMixin_assert_not_awaite, sizeof(__pyx_k_AsyncMockMixin_assert_not_awaite), 0, 0, 1, 1},
  {&__pyx_n_s_AsyncMockMixin_reset_mock, __pyx_k_AsyncMockMixin_reset_mock, sizeof(__pyx_k_AsyncMockMixin_reset_mock), 0, 0, 1, 1},
  {&__pyx_kp_u_Attempting_to_set_unsupported_ma, __pyx_k_Attempting_to_set_unsupported_ma, sizeof(__pyx_k_Attempting_to_set_unsupported_ma), 0, 1, 0, 0},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_kp_u_Attributes_cannot_start_with_ass, __pyx_k_Attributes_cannot_start_with_ass, sizeof(__pyx_k_Attributes_cannot_start_with_ass), 0, 1, 0, 0},
  {&__pyx_kp_u_Awaits_not_found, __pyx_k_Awaits_not_found, sizeof(__pyx_k_Awaits_not_found), 0, 1, 0, 0},
  {&__pyx_n_s_Base, __pyx_k_Base, sizeof(__pyx_k_Base), 0, 0, 1, 1},
  {&__pyx_n_s_BaseException, __pyx_k_BaseException, sizeof(__pyx_k_BaseException), 0, 0, 1, 1},
  {&__pyx_n_s_Base___init, __pyx_k_Base___init, sizeof(__pyx_k_Base___init), 0, 0, 1, 1},
  {&__pyx_n_s_BytesIO, __pyx_k_BytesIO, sizeof(__pyx_k_BytesIO), 0, 0, 1, 1},
  {&__pyx_n_s_CO_COROUTINE, __pyx_k_CO_COROUTINE, sizeof(__pyx_k_CO_COROUTINE), 0, 0, 1, 1},
  {&__pyx_n_s_CO_ITERABLE_COROUTINE, __pyx_k_CO_ITERABLE_COROUTINE, sizeof(__pyx_k_CO_ITERABLE_COROUTINE), 0, 0, 1, 1},
  {&__pyx_n_s_Call, __pyx_k_Call, sizeof(__pyx_k_Call), 0, 0, 1, 1},
  {&__pyx_n_s_CallList, __pyx_k_CallList, sizeof(__pyx_k_CallList), 0, 0, 1, 1},
  {&__pyx_n_s_CallList___contains, __pyx_k_CallList___contains, sizeof(__pyx_k_CallList___contains), 0, 0, 1, 1},
  {&__pyx_n_s_CallList___repr, __pyx_k_CallList___repr, sizeof(__pyx_k_CallList___repr), 0, 0, 1, 1},
  {&__pyx_n_s_Call___call, __pyx_k_Call___call, sizeof(__pyx_k_Call___call), 0, 0, 1, 1},
  {&__pyx_n_s_Call___eq, __pyx_k_Call___eq, sizeof(__pyx_k_Call___eq), 0, 0, 1, 1},
  {&__pyx_n_s_Call___getattr, __pyx_k_Call___getattr, sizeof(__pyx_k_Call___getattr), 0, 0, 1, 1},
  {&__pyx_n_s_Call___getattribute, __pyx_k_Call___getattribute, sizeof(__pyx_k_Call___getattribute), 0, 0, 1, 1},
  {&__pyx_n_s_Call___init, __pyx_k_Call___init, sizeof(__pyx_k_Call___init), 0, 0, 1, 1},
  {&__pyx_n_s_Call___new, __pyx_k_Call___new, sizeof(__pyx_k_Call___new), 0, 0, 1, 1},
  {&__pyx_n_s_Call___repr, __pyx_k_Call___repr, sizeof(__pyx_k_Call___repr), 0, 0, 1, 1},
  {&__pyx_n_s_Call__get_call_arguments, __pyx_k_Call__get_call_arguments, sizeof(__pyx_k_Call__get_call_arguments), 0, 0, 1, 1},
  {&__pyx_n_s_Call_args, __pyx_k_Call_args, sizeof(__pyx_k_Call_args), 0, 0, 1, 1},
  {&__pyx_n_s_Call_call_list, __pyx_k_Call_call_list, sizeof(__pyx_k_Call_call_list), 0, 0, 1, 1},
  {&__pyx_n_s_Call_count, __pyx_k_Call_count, sizeof(__pyx_k_Call_count), 0, 0, 1, 1},
  {&__pyx_n_s_Call_index, __pyx_k_Call_index, sizeof(__pyx_k_Call_index), 0, 0, 1, 1},
  {&__pyx_n_s_Call_kwargs, __pyx_k_Call_kwargs, sizeof(__pyx_k_Call_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_CallableMixin, __pyx_k_CallableMixin, sizeof(__pyx_k_CallableMixin), 0, 0, 1, 1},
  {&__pyx_n_s_CallableMixin___call, __pyx_k_CallableMixin___call, sizeof(__pyx_k_CallableMixin___call), 0, 0, 1, 1},
  {&__pyx_n_s_CallableMixin___init, __pyx_k_CallableMixin___init, sizeof(__pyx_k_CallableMixin___init), 0, 0, 1, 1},
  {&__pyx_n_s_CallableMixin__execute_mock_call, __pyx_k_CallableMixin__execute_mock_call, sizeof(__pyx_k_CallableMixin__execute_mock_call), 0, 0, 1, 1},
  {&__pyx_n_s_CallableMixin__increment_mock_ca, __pyx_k_CallableMixin__increment_mock_ca, sizeof(__pyx_k_CallableMixin__increment_mock_ca), 0, 0, 1, 1},
  {&__pyx_n_s_CallableMixin__mock_call, __pyx_k_CallableMixin__mock_call, sizeof(__pyx_k_CallableMixin__mock_call), 0, 0, 1, 1},
  {&__pyx_n_s_CallableMixin__mock_check_sig, __pyx_k_CallableMixin__mock_check_sig, sizeof(__pyx_k_CallableMixin__mock_check_sig), 0, 0, 1, 1},
  {&__pyx_n_u_Calls, __pyx_k_Calls, sizeof(__pyx_k_Calls), 0, 1, 0, 1},
  {&__pyx_kp_u_Calls_not_found, __pyx_k_Calls_not_found, sizeof(__pyx_k_Calls_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_pass_kwargs_to_a_mock_we_a, __pyx_k_Can_t_pass_kwargs_to_a_mock_we_a, sizeof(__pyx_k_Can_t_pass_kwargs_to_a_mock_we_a), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_provide_explicit_spec_set, __pyx_k_Can_t_provide_explicit_spec_set, sizeof(__pyx_k_Can_t_provide_explicit_spec_set), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_specify_spec_and_autospec, __pyx_k_Can_t_specify_spec_and_autospec, sizeof(__pyx_k_Can_t_specify_spec_and_autospec), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_use_autospec_with_create_T, __pyx_k_Can_t_use_autospec_with_create_T, sizeof(__pyx_k_Can_t_use_autospec_with_create_T), 0, 1, 0, 0},
  {&__pyx_kp_u_Can_t_use_spec_with_create_True, __pyx_k_Can_t_use_spec_with_create_True, sizeof(__pyx_k_Can_t_use_spec_with_create_True), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_set, __pyx_k_Cannot_set, sizeof(__pyx_k_Cannot_set), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_use_autospec_and_new_call, __pyx_k_Cannot_use_autospec_and_new_call, sizeof(__pyx_k_Cannot_use_autospec_and_new_call), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_use_new_and_new_callable, __pyx_k_Cannot_use_new_and_new_callable, sizeof(__pyx_k_Cannot_use_new_and_new_callable), 0, 1, 0, 0},
  {&__pyx_n_s_CodeType, __pyx_k_CodeType, sizeof(__pyx_k_CodeType), 0, 0, 1, 1},
  {&__pyx_kp_s_Create_a_new_Mock_object_Mock_t, __pyx_k_Create_a_new_Mock_object_Mock_t, sizeof(__pyx_k_Create_a_new_Mock_object_Mock_t), 0, 0, 1, 0},
  {&__pyx_n_s_DEFAULT, __pyx_k_DEFAULT, sizeof(__pyx_k_DEFAULT), 0, 0, 1, 1},
  {&__pyx_n_u_DEFAULT, __pyx_k_DEFAULT, sizeof(__pyx_k_DEFAULT), 0, 1, 0, 1},
  {&__pyx_n_s_DELETED, __pyx_k_DELETED, sizeof(__pyx_k_DELETED), 0, 0, 1, 1},
  {&__pyx_kp_s_Enhance_class_Mock_with_feature, __pyx_k_Enhance_class_Mock_with_feature, sizeof(__pyx_k_Enhance_class_Mock_with_feature), 0, 0, 1, 0},
  {&__pyx_kp_u_Error_processing_expected_awaits, __pyx_k_Error_processing_expected_awaits, sizeof(__pyx_k_Error_processing_expected_awaits), 0, 1, 0, 0},
  {&__pyx_kp_u_Error_processing_expected_calls, __pyx_k_Error_processing_expected_calls, sizeof(__pyx_k_Error_processing_expected_calls), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected, __pyx_k_Expected, sizeof(__pyx_k_Expected), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_2, __pyx_k_Expected_2, sizeof(__pyx_k_Expected_2), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_3, __pyx_k_Expected_3, sizeof(__pyx_k_Expected_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_await, __pyx_k_Expected_await, sizeof(__pyx_k_Expected_await), 0, 1, 0, 0},
  {&__pyx_kp_u_Expected_s_to_have_been_called, __pyx_k_Expected_s_to_have_been_called, sizeof(__pyx_k_Expected_s_to_have_been_called), 0, 1, 0, 0},
  {&__pyx_n_s_FILTER_DIR, __pyx_k_FILTER_DIR, sizeof(__pyx_k_FILTER_DIR), 0, 0, 1, 1},
  {&__pyx_n_u_FILTER_DIR, __pyx_k_FILTER_DIR, sizeof(__pyx_k_FILTER_DIR), 0, 1, 0, 1},
  {&__pyx_n_s_FunctionTypes, __pyx_k_FunctionTypes, sizeof(__pyx_k_FunctionTypes), 0, 0, 1, 1},
  {&__pyx_kp_u_Instance_can_not_be_True_when_cr, __pyx_k_Instance_can_not_be_True_when_cr, sizeof(__pyx_k_Instance_can_not_be_True_when_cr), 0, 1, 0, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_Klass, __pyx_k_Klass, sizeof(__pyx_k_Klass), 0, 0, 1, 1},
  {&__pyx_n_s_MISSING, __pyx_k_MISSING, sizeof(__pyx_k_MISSING), 0, 0, 1, 1},
  {&__pyx_n_s_MagicMixin, __pyx_k_MagicMixin, sizeof(__pyx_k_MagicMixin), 0, 0, 1, 1},
  {&__pyx_n_s_MagicMixin___init, __pyx_k_MagicMixin___init, sizeof(__pyx_k_MagicMixin___init), 0, 0, 1, 1},
  {&__pyx_n_s_MagicMixin__mock_set_magics, __pyx_k_MagicMixin__mock_set_magics, sizeof(__pyx_k_MagicMixin__mock_set_magics), 0, 0, 1, 1},
  {&__pyx_n_s_MagicMock, __pyx_k_MagicMock, sizeof(__pyx_k_MagicMock), 0, 0, 1, 1},
  {&__pyx_n_u_MagicMock, __pyx_k_MagicMock, sizeof(__pyx_k_MagicMock), 0, 1, 0, 1},
  {&__pyx_kp_s_MagicMock_is_a_subclass_of_Mock, __pyx_k_MagicMock_is_a_subclass_of_Mock, sizeof(__pyx_k_MagicMock_is_a_subclass_of_Mock), 0, 0, 1, 0},
  {&__pyx_n_s_MagicMock_mock_add_spec, __pyx_k_MagicMock_mock_add_spec, sizeof(__pyx_k_MagicMock_mock_add_spec), 0, 0, 1, 1},
  {&__pyx_n_s_MagicProxy, __pyx_k_MagicProxy, sizeof(__pyx_k_MagicProxy), 0, 0, 1, 1},
  {&__pyx_n_s_MagicProxy___get, __pyx_k_MagicProxy___get, sizeof(__pyx_k_MagicProxy___get), 0, 0, 1, 1},
  {&__pyx_n_s_MagicProxy___init, __pyx_k_MagicProxy___init, sizeof(__pyx_k_MagicProxy___init), 0, 0, 1, 1},
  {&__pyx_n_s_MagicProxy_create_mock, __pyx_k_MagicProxy_create_mock, sizeof(__pyx_k_MagicProxy_create_mock), 0, 0, 1, 1},
  {&__pyx_n_s_MethodType, __pyx_k_MethodType, sizeof(__pyx_k_MethodType), 0, 0, 1, 1},
  {&__pyx_n_s_Mock, __pyx_k_Mock, sizeof(__pyx_k_Mock), 0, 0, 1, 1},
  {&__pyx_n_u_Mock, __pyx_k_Mock, sizeof(__pyx_k_Mock), 0, 1, 0, 1},
  {&__pyx_n_s_MockIter, __pyx_k_MockIter, sizeof(__pyx_k_MockIter), 0, 0, 1, 1},
  {&__pyx_n_s_MockIter___init, __pyx_k_MockIter___init, sizeof(__pyx_k_MockIter___init), 0, 0, 1, 1},
  {&__pyx_n_s_MockIter___next, __pyx_k_MockIter___next, sizeof(__pyx_k_MockIter___next), 0, 0, 1, 1},
  {&__pyx_kp_u_Mock_object_has_no_attribute_r, __pyx_k_Mock_object_has_no_attribute_r, sizeof(__pyx_k_Mock_object_has_no_attribute_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Mock_object_has_no_attribute_s, __pyx_k_Mock_object_has_no_attribute_s, sizeof(__pyx_k_Mock_object_has_no_attribute_s), 0, 1, 0, 0},
  {&__pyx_n_s_ModuleType, __pyx_k_ModuleType, sizeof(__pyx_k_ModuleType), 0, 0, 1, 1},
  {&__pyx_kp_u_Must_supply_at_least_one_keyword, __pyx_k_Must_supply_at_least_one_keyword, sizeof(__pyx_k_Must_supply_at_least_one_keyword), 0, 1, 0, 0},
  {&__pyx_kp_u_Need_a_valid_target_to_patch_You, __pyx_k_Need_a_valid_target_to_patch_You, sizeof(__pyx_k_Need_a_valid_target_to_patch_You), 0, 1, 0, 0},
  {&__pyx_n_s_NonCallableMagicMock, __pyx_k_NonCallableMagicMock, sizeof(__pyx_k_NonCallableMagicMock), 0, 0, 1, 1},
  {&__pyx_n_u_NonCallableMagicMock, __pyx_k_NonCallableMagicMock, sizeof(__pyx_k_NonCallableMagicMock), 0, 1, 0, 1},
  {&__pyx_n_s_NonCallableMagicMock_mock_add_sp, __pyx_k_NonCallableMagicMock_mock_add_sp, sizeof(__pyx_k_NonCallableMagicMock_mock_add_sp), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock, __pyx_k_NonCallableMock, sizeof(__pyx_k_NonCallableMock), 0, 0, 1, 1},
  {&__pyx_n_u_NonCallableMock, __pyx_k_NonCallableMock, sizeof(__pyx_k_NonCallableMock), 0, 1, 0, 1},
  {&__pyx_n_s_NonCallableMock___class, __pyx_k_NonCallableMock___class, sizeof(__pyx_k_NonCallableMock___class), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___delattr, __pyx_k_NonCallableMock___delattr, sizeof(__pyx_k_NonCallableMock___delattr), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___dir, __pyx_k_NonCallableMock___dir, sizeof(__pyx_k_NonCallableMock___dir), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___get_return_val, __pyx_k_NonCallableMock___get_return_val, sizeof(__pyx_k_NonCallableMock___get_return_val), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___get_side_effec, __pyx_k_NonCallableMock___get_side_effec, sizeof(__pyx_k_NonCallableMock___get_side_effec), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___getattr, __pyx_k_NonCallableMock___getattr, sizeof(__pyx_k_NonCallableMock___getattr), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___init, __pyx_k_NonCallableMock___init, sizeof(__pyx_k_NonCallableMock___init), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___new, __pyx_k_NonCallableMock___new, sizeof(__pyx_k_NonCallableMock___new), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___repr, __pyx_k_NonCallableMock___repr, sizeof(__pyx_k_NonCallableMock___repr), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___set_return_val, __pyx_k_NonCallableMock___set_return_val, sizeof(__pyx_k_NonCallableMock___set_return_val), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___set_side_effec, __pyx_k_NonCallableMock___set_side_effec, sizeof(__pyx_k_NonCallableMock___set_side_effec), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___setattr, __pyx_k_NonCallableMock___setattr, sizeof(__pyx_k_NonCallableMock___setattr), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock___setattr___loca, __pyx_k_NonCallableMock___setattr___loca, sizeof(__pyx_k_NonCallableMock___setattr___loca), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__call_matcher, __pyx_k_NonCallableMock__call_matcher, sizeof(__pyx_k_NonCallableMock__call_matcher), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__calls_repr, __pyx_k_NonCallableMock__calls_repr, sizeof(__pyx_k_NonCallableMock__calls_repr), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__extract_mock_na, __pyx_k_NonCallableMock__extract_mock_na, sizeof(__pyx_k_NonCallableMock__extract_mock_na), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__format_mock_cal, __pyx_k_NonCallableMock__format_mock_cal, sizeof(__pyx_k_NonCallableMock__format_mock_cal), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__format_mock_fai, __pyx_k_NonCallableMock__format_mock_fai, sizeof(__pyx_k_NonCallableMock__format_mock_fai), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__get_call_signat, __pyx_k_NonCallableMock__get_call_signat, sizeof(__pyx_k_NonCallableMock__get_call_signat), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__get_child_mock, __pyx_k_NonCallableMock__get_child_mock, sizeof(__pyx_k_NonCallableMock__get_child_mock), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__get_return_val, __pyx_k_NonCallableMock__get_return_val, sizeof(__pyx_k_NonCallableMock__get_return_val), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__get_side_effec, __pyx_k_NonCallableMock__get_side_effec, sizeof(__pyx_k_NonCallableMock__get_side_effec), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__mock_add_spec, __pyx_k_NonCallableMock__mock_add_spec, sizeof(__pyx_k_NonCallableMock__mock_add_spec), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__return_value_d, __pyx_k_NonCallableMock__return_value_d, sizeof(__pyx_k_NonCallableMock__return_value_d), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__set_return_val, __pyx_k_NonCallableMock__set_return_val, sizeof(__pyx_k_NonCallableMock__set_return_val), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock__set_side_effec, __pyx_k_NonCallableMock__set_side_effec, sizeof(__pyx_k_NonCallableMock__set_side_effec), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_any_call, __pyx_k_NonCallableMock_assert_any_call, sizeof(__pyx_k_NonCallableMock_assert_any_call), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_called, __pyx_k_NonCallableMock_assert_called, sizeof(__pyx_k_NonCallableMock_assert_called), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_called_on, __pyx_k_NonCallableMock_assert_called_on, sizeof(__pyx_k_NonCallableMock_assert_called_on), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_called_on_2, __pyx_k_NonCallableMock_assert_called_on_2, sizeof(__pyx_k_NonCallableMock_assert_called_on_2), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_called_wi, __pyx_k_NonCallableMock_assert_called_wi, sizeof(__pyx_k_NonCallableMock_assert_called_wi), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_called_wi_2, __pyx_k_NonCallableMock_assert_called_wi_2, sizeof(__pyx_k_NonCallableMock_assert_called_wi_2), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_has_calls, __pyx_k_NonCallableMock_assert_has_calls, sizeof(__pyx_k_NonCallableMock_assert_has_calls), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_has_calls_2, __pyx_k_NonCallableMock_assert_has_calls_2, sizeof(__pyx_k_NonCallableMock_assert_has_calls_2), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_assert_not_calle, __pyx_k_NonCallableMock_assert_not_calle, sizeof(__pyx_k_NonCallableMock_assert_not_calle), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_attach_mock, __pyx_k_NonCallableMock_attach_mock, sizeof(__pyx_k_NonCallableMock_attach_mock), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_configure_mock, __pyx_k_NonCallableMock_configure_mock, sizeof(__pyx_k_NonCallableMock_configure_mock), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_configure_mock_l, __pyx_k_NonCallableMock_configure_mock_l, sizeof(__pyx_k_NonCallableMock_configure_mock_l), 0, 0, 1, 1},
  {&__pyx_kp_u_NonCallableMock_configure_mock_l_2, __pyx_k_NonCallableMock_configure_mock_l_2, sizeof(__pyx_k_NonCallableMock_configure_mock_l_2), 0, 1, 0, 0},
  {&__pyx_n_s_NonCallableMock_mock_add_spec, __pyx_k_NonCallableMock_mock_add_spec, sizeof(__pyx_k_NonCallableMock_mock_add_spec), 0, 0, 1, 1},
  {&__pyx_n_s_NonCallableMock_reset_mock, __pyx_k_NonCallableMock_reset_mock, sizeof(__pyx_k_NonCallableMock_reset_mock), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
  {&__pyx_kp_u_Not_awaited, __pyx_k_Not_awaited, sizeof(__pyx_k_Not_awaited), 0, 1, 0, 0},
  {&__pyx_kp_s_Patch_a_dictionary_or_dictionar, __pyx_k_Patch_a_dictionary_or_dictionar, sizeof(__pyx_k_Patch_a_dictionary_or_dictionar), 0, 0, 1, 0},
  {&__pyx_n_s_PropertyMock, __pyx_k_PropertyMock, sizeof(__pyx_k_PropertyMock), 0, 0, 1, 1},
  {&__pyx_n_u_PropertyMock, __pyx_k_PropertyMock, sizeof(__pyx_k_PropertyMock), 0, 1, 0, 1},
  {&__pyx_n_s_PropertyMock___get, __pyx_k_PropertyMock___get, sizeof(__pyx_k_PropertyMock___get), 0, 0, 1, 1},
  {&__pyx_n_s_PropertyMock___set, __pyx_k_PropertyMock___set, sizeof(__pyx_k_PropertyMock___set), 0, 0, 1, 1},
  {&__pyx_n_s_PropertyMock__get_child_mock, __pyx_k_PropertyMock__get_child_mock, sizeof(__pyx_k_PropertyMock__get_child_mock), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_Sentinel, __pyx_k_Sentinel, sizeof(__pyx_k_Sentinel), 0, 0, 1, 1},
  {&__pyx_n_s_SentinelObject, __pyx_k_SentinelObject, sizeof(__pyx_k_SentinelObject), 0, 0, 1, 1},
  {&__pyx_n_s_SentinelObject___init, __pyx_k_SentinelObject___init, sizeof(__pyx_k_SentinelObject___init), 0, 0, 1, 1},
  {&__pyx_n_s_SentinelObject___reduce, __pyx_k_SentinelObject___reduce, sizeof(__pyx_k_SentinelObject___reduce), 0, 0, 1, 1},
  {&__pyx_n_s_SentinelObject___repr, __pyx_k_SentinelObject___repr, sizeof(__pyx_k_SentinelObject___repr), 0, 0, 1, 1},
  {&__pyx_n_s_Sentinel___getattr, __pyx_k_Sentinel___getattr, sizeof(__pyx_k_Sentinel___getattr), 0, 0, 1, 1},
  {&__pyx_n_s_Sentinel___init, __pyx_k_Sentinel___init, sizeof(__pyx_k_Sentinel___init), 0, 0, 1, 1},
  {&__pyx_n_s_Sentinel___reduce, __pyx_k_Sentinel___reduce, sizeof(__pyx_k_Sentinel___reduce), 0, 0, 1, 1},
  {&__pyx_kp_u_Set_attributes_on_the_mock_throu, __pyx_k_Set_attributes_on_the_mock_throu, sizeof(__pyx_k_Set_attributes_on_the_mock_throu), 0, 1, 0, 0},
  {&__pyx_n_s_SpecState, __pyx_k_SpecState, sizeof(__pyx_k_SpecState), 0, 0, 1, 1},
  {&__pyx_n_s_SpecState___init, __pyx_k_SpecState___init, sizeof(__pyx_k_SpecState___init), 0, 0, 1, 1},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 0, 0, 1, 1},
  {&__pyx_n_s_TEST_PREFIX, __pyx_k_TEST_PREFIX, sizeof(__pyx_k_TEST_PREFIX), 0, 0, 1, 1},
  {&__pyx_n_s_TextIOWrapper, __pyx_k_TextIOWrapper, sizeof(__pyx_k_TextIOWrapper), 0, 0, 1, 1},
  {&__pyx_kp_u_The_value_to_be_returned_when_th, __pyx_k_The_value_to_be_returned_when_th, sizeof(__pyx_k_The_value_to_be_returned_when_th), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s_Wraps_an_iterator_in_an_asynchr, __pyx_k_Wraps_an_iterator_in_an_asynchr, sizeof(__pyx_k_Wraps_an_iterator_in_an_asynchr), 0, 0, 1, 0},
  {&__pyx_kp_u__294, __pyx_k__294, sizeof(__pyx_k__294), 0, 1, 0, 0},
  {&__pyx_kp_u__31, __pyx_k__31, sizeof(__pyx_k__31), 0, 1, 0, 0},
  {&__pyx_kp_u__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 1, 0, 0},
  {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
  {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0},
  {&__pyx_kp_u__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 1, 0, 0},
  {&__pyx_kp_u__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 1, 0, 0},
  {&__pyx_n_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 1},
  {&__pyx_kp_u__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 1, 0, 0},
  {&__pyx_kp_u__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 1, 0, 0},
  {&__pyx_kp_u__77, __pyx_k__77, sizeof(__pyx_k__77), 0, 1, 0, 0},
  {&__pyx_kp_u__78, __pyx_k__78, sizeof(__pyx_k__78), 0, 1, 0, 0},
  {&__pyx_n_s_action, __pyx_k_action, sizeof(__pyx_k_action), 0, 0, 1, 1},
  {&__pyx_n_s_active_patches, __pyx_k_active_patches, sizeof(__pyx_k_active_patches), 0, 0, 1, 1},
  {&__pyx_n_s_actual, __pyx_k_actual, sizeof(__pyx_k_actual), 0, 0, 1, 1},
  {&__pyx_n_s_actual_string, __pyx_k_actual_string, sizeof(__pyx_k_actual_string), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_kp_u_add_sub_mul_matmul_div_floordiv, __pyx_k_add_sub_mul_matmul_div_floordiv, sizeof(__pyx_k_add_sub_mul_matmul_div_floordiv), 0, 1, 0, 0},
  {&__pyx_n_s_additional_patchers, __pyx_k_additional_patchers, sizeof(__pyx_k_additional_patchers), 0, 0, 1, 1},
  {&__pyx_n_u_aenter, __pyx_k_aenter, sizeof(__pyx_k_aenter), 0, 1, 0, 1},
  {&__pyx_n_u_aexit, __pyx_k_aexit, sizeof(__pyx_k_aexit), 0, 1, 0, 1},
  {&__pyx_n_s_aiter, __pyx_k_aiter, sizeof(__pyx_k_aiter), 0, 0, 1, 1},
  {&__pyx_n_u_aiter, __pyx_k_aiter, sizeof(__pyx_k_aiter), 0, 1, 0, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_all_awaits, __pyx_k_all_awaits, sizeof(__pyx_k_all_awaits), 0, 0, 1, 1},
  {&__pyx_n_s_all_calls, __pyx_k_all_calls, sizeof(__pyx_k_all_calls), 0, 0, 1, 1},
  {&__pyx_n_s_all_magics, __pyx_k_all_magics, sizeof(__pyx_k_all_magics), 0, 0, 1, 1},
  {&__pyx_n_s_all_sync_magics, __pyx_k_all_sync_magics, sizeof(__pyx_k_all_sync_magics), 0, 0, 1, 1},
  {&__pyx_n_s_allowed_names, __pyx_k_allowed_names, sizeof(__pyx_k_allowed_names), 0, 0, 1, 1},
  {&__pyx_n_s_anext, __pyx_k_anext, sizeof(__pyx_k_anext), 0, 0, 1, 1},
  {&__pyx_n_u_anext, __pyx_k_anext, sizeof(__pyx_k_anext), 0, 1, 0, 1},
  {&__pyx_n_u_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 1, 0, 1},
  {&__pyx_n_s_any_order, __pyx_k_any_order, sizeof(__pyx_k_any_order), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_args_string, __pyx_k_args_string, sizeof(__pyx_k_args_string), 0, 0, 1, 1},
  {&__pyx_n_s_arguments, __pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 0, 1, 1},
  {&__pyx_n_s_as_instance, __pyx_k_as_instance, sizeof(__pyx_k_as_instance), 0, 0, 1, 1},
  {&__pyx_n_u_assert, __pyx_k_assert, sizeof(__pyx_k_assert), 0, 1, 0, 1},
  {&__pyx_n_s_assert_any_await, __pyx_k_assert_any_await, sizeof(__pyx_k_assert_any_await), 0, 0, 1, 1},
  {&__pyx_n_u_assert_any_await, __pyx_k_assert_any_await, sizeof(__pyx_k_assert_any_await), 0, 1, 0, 1},
  {&__pyx_n_s_assert_any_call, __pyx_k_assert_any_call, sizeof(__pyx_k_assert_any_call), 0, 0, 1, 1},
  {&__pyx_n_s_assert_awaited, __pyx_k_assert_awaited, sizeof(__pyx_k_assert_awaited), 0, 0, 1, 1},
  {&__pyx_n_u_assert_awaited, __pyx_k_assert_awaited, sizeof(__pyx_k_assert_awaited), 0, 1, 0, 1},
  {&__pyx_n_s_assert_awaited_once, __pyx_k_assert_awaited_once, sizeof(__pyx_k_assert_awaited_once), 0, 0, 1, 1},
  {&__pyx_n_u_assert_awaited_once, __pyx_k_assert_awaited_once, sizeof(__pyx_k_assert_awaited_once), 0, 1, 0, 1},
  {&__pyx_n_s_assert_awaited_once_with, __pyx_k_assert_awaited_once_with, sizeof(__pyx_k_assert_awaited_once_with), 0, 0, 1, 1},
  {&__pyx_n_u_assert_awaited_once_with, __pyx_k_assert_awaited_once_with, sizeof(__pyx_k_assert_awaited_once_with), 0, 1, 0, 1},
  {&__pyx_n_s_assert_awaited_with, __pyx_k_assert_awaited_with, sizeof(__pyx_k_assert_awaited_with), 0, 0, 1, 1},
  {&__pyx_n_u_assert_awaited_with, __pyx_k_assert_awaited_with, sizeof(__pyx_k_assert_awaited_with), 0, 1, 0, 1},
  {&__pyx_n_s_assert_called, __pyx_k_assert_called, sizeof(__pyx_k_assert_called), 0, 0, 1, 1},
  {&__pyx_n_s_assert_called_once, __pyx_k_assert_called_once, sizeof(__pyx_k_assert_called_once), 0, 0, 1, 1},
  {&__pyx_n_s_assert_called_once_with, __pyx_k_assert_called_once_with, sizeof(__pyx_k_assert_called_once_with), 0, 0, 1, 1},
  {&__pyx_n_s_assert_called_with, __pyx_k_assert_called_with, sizeof(__pyx_k_assert_called_with), 0, 0, 1, 1},
  {&__pyx_n_s_assert_has_awaits, __pyx_k_assert_has_awaits, sizeof(__pyx_k_assert_has_awaits), 0, 0, 1, 1},
  {&__pyx_n_u_assert_has_awaits, __pyx_k_assert_has_awaits, sizeof(__pyx_k_assert_has_awaits), 0, 1, 0, 1},
  {&__pyx_n_s_assert_has_calls, __pyx_k_assert_has_calls, sizeof(__pyx_k_assert_has_calls), 0, 0, 1, 1},
  {&__pyx_n_s_assert_not_awaited, __pyx_k_assert_not_awaited, sizeof(__pyx_k_assert_not_awaited), 0, 0, 1, 1},
  {&__pyx_n_u_assert_not_awaited, __pyx_k_assert_not_awaited, sizeof(__pyx_k_assert_not_awaited), 0, 1, 0, 1},
  {&__pyx_n_s_assert_not_called, __pyx_k_assert_not_called, sizeof(__pyx_k_assert_not_called), 0, 0, 1, 1},
  {&__pyx_n_u_assret, __pyx_k_assret, sizeof(__pyx_k_assret), 0, 1, 0, 1},
  {&__pyx_n_s_async_magics, __pyx_k_async_magics, sizeof(__pyx_k_async_magics), 0, 0, 1, 1},
  {&__pyx_n_s_async_method_magics, __pyx_k_async_method_magics, sizeof(__pyx_k_async_method_magics), 0, 0, 1, 1},
  {&__pyx_n_s_asyncio, __pyx_k_asyncio, sizeof(__pyx_k_asyncio), 0, 0, 1, 1},
  {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
  {&__pyx_n_s_asyncio_tasks, __pyx_k_asyncio_tasks, sizeof(__pyx_k_asyncio_tasks), 0, 0, 1, 1},
  {&__pyx_n_s_attach_mock, __pyx_k_attach_mock, sizeof(__pyx_k_attach_mock), 0, 0, 1, 1},
  {&__pyx_n_s_attr, __pyx_k_attr, sizeof(__pyx_k_attr), 0, 0, 1, 1},
  {&__pyx_n_s_attr_value, __pyx_k_attr_value, sizeof(__pyx_k_attr_value), 0, 0, 1, 1},
  {&__pyx_n_s_attribute, __pyx_k_attribute, sizeof(__pyx_k_attribute), 0, 0, 1, 1},
  {&__pyx_n_s_attribute_name, __pyx_k_attribute_name, sizeof(__pyx_k_attribute_name), 0, 0, 1, 1},
  {&__pyx_n_s_autospec, __pyx_k_autospec, sizeof(__pyx_k_autospec), 0, 0, 1, 1},
  {&__pyx_kp_u_autospec_creates_the_mock_for_yo, __pyx_k_autospec_creates_the_mock_for_yo, sizeof(__pyx_k_autospec_creates_the_mock_for_yo), 0, 1, 0, 0},
  {&__pyx_n_s_await, __pyx_k_await, sizeof(__pyx_k_await), 0, 0, 1, 1},
  {&__pyx_n_u_await_2, __pyx_k_await_2, sizeof(__pyx_k_await_2), 0, 1, 0, 1},
  {&__pyx_n_s_await_args, __pyx_k_await_args, sizeof(__pyx_k_await_args), 0, 0, 1, 1},
  {&__pyx_n_u_await_args, __pyx_k_await_args, sizeof(__pyx_k_await_args), 0, 1, 0, 1},
  {&__pyx_n_s_await_args_list, __pyx_k_await_args_list, sizeof(__pyx_k_await_args_list), 0, 0, 1, 1},
  {&__pyx_n_u_await_args_list, __pyx_k_await_args_list, sizeof(__pyx_k_await_args_list), 0, 1, 0, 1},
  {&__pyx_n_s_await_count, __pyx_k_await_count, sizeof(__pyx_k_await_count), 0, 0, 1, 1},
  {&__pyx_n_u_await_count, __pyx_k_await_count, sizeof(__pyx_k_await_count), 0, 1, 0, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_u_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 1, 0, 1},
  {&__pyx_n_s_bases_2, __pyx_k_bases_2, sizeof(__pyx_k_bases_2), 0, 0, 1, 1},
  {&__pyx_n_s_bind, __pyx_k_bind, sizeof(__pyx_k_bind), 0, 0, 1, 1},
  {&__pyx_n_s_bind_partial, __pyx_k_bind_partial, sizeof(__pyx_k_bind_partial), 0, 0, 1, 1},
  {&__pyx_n_u_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 0, 1},
  {&__pyx_n_s_bound_args, __pyx_k_bound_args, sizeof(__pyx_k_bound_args), 0, 0, 1, 1},
  {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1},
  {&__pyx_n_s_builtins_2, __pyx_k_builtins_2, sizeof(__pyx_k_builtins_2), 0, 0, 1, 1},
  {&__pyx_n_s_builtins_3, __pyx_k_builtins_3, sizeof(__pyx_k_builtins_3), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_calculate_return_value, __pyx_k_calculate_return_value, sizeof(__pyx_k_calculate_return_value), 0, 0, 1, 1},
  {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
  {&__pyx_n_u_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 1, 0, 1},
  {&__pyx_n_s_call_2, __pyx_k_call_2, sizeof(__pyx_k_call_2), 0, 0, 1, 1},
  {&__pyx_n_u_call_2, __pyx_k_call_2, sizeof(__pyx_k_call_2), 0, 1, 0, 1},
  {&__pyx_n_s_call_3, __pyx_k_call_3, sizeof(__pyx_k_call_3), 0, 0, 1, 1},
  {&__pyx_n_s_call_args, __pyx_k_call_args, sizeof(__pyx_k_call_args), 0, 0, 1, 1},
  {&__pyx_n_u_call_args, __pyx_k_call_args, sizeof(__pyx_k_call_args), 0, 1, 0, 1},
  {&__pyx_n_s_call_args_list, __pyx_k_call_args_list, sizeof(__pyx_k_call_args_list), 0, 0, 1, 1},
  {&__pyx_n_u_call_args_list, __pyx_k_call_args_list, sizeof(__pyx_k_call_args_list), 0, 1, 0, 1},
  {&__pyx_n_s_call_count, __pyx_k_call_count, sizeof(__pyx_k_call_count), 0, 0, 1, 1},
  {&__pyx_n_u_call_count, __pyx_k_call_count, sizeof(__pyx_k_call_count), 0, 1, 0, 1},
  {&__pyx_n_s_call_list, __pyx_k_call_list, sizeof(__pyx_k_call_list), 0, 0, 1, 1},
  {&__pyx_n_s_call_matcher, __pyx_k_call_matcher, sizeof(__pyx_k_call_matcher), 0, 0, 1, 1},
  {&__pyx_kp_u_call_s, __pyx_k_call_s, sizeof(__pyx_k_call_s), 0, 1, 0, 0},
  {&__pyx_kp_u_call_s_2, __pyx_k_call_s_2, sizeof(__pyx_k_call_s_2), 0, 1, 0, 0},
  {&__pyx_n_s_callable, __pyx_k_callable, sizeof(__pyx_k_callable), 0, 0, 1, 1},
  {&__pyx_n_s_called, __pyx_k_called, sizeof(__pyx_k_called), 0, 0, 1, 1},
  {&__pyx_n_u_called, __pyx_k_called, sizeof(__pyx_k_called), 0, 1, 0, 1},
  {&__pyx_n_s_calls, __pyx_k_calls, sizeof(__pyx_k_calls), 0, 0, 1, 1},
  {&__pyx_n_s_calls_repr, __pyx_k_calls_repr, sizeof(__pyx_k_calls_repr), 0, 0, 1, 1},
  {&__pyx_n_s_cause, __pyx_k_cause, sizeof(__pyx_k_cause), 0, 0, 1, 1},
  {&__pyx_n_s_check_and_set_parent, __pyx_k_check_and_set_parent, sizeof(__pyx_k_check_and_set_parent), 0, 0, 1, 1},
  {&__pyx_n_s_check_signature, __pyx_k_check_signature, sizeof(__pyx_k_check_signature), 0, 0, 1, 1},
  {&__pyx_n_s_check_signature_locals_checksig, __pyx_k_check_signature_locals_checksig, sizeof(__pyx_k_check_signature_locals_checksig), 0, 0, 1, 1},
  {&__pyx_n_s_checksig, __pyx_k_checksig, sizeof(__pyx_k_checksig), 0, 0, 1, 1},
  {&__pyx_n_u_checksig_2, __pyx_k_checksig_2, sizeof(__pyx_k_checksig_2), 0, 1, 0, 1},
  {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1},
  {&__pyx_n_s_child_klass, __pyx_k_child_klass, sizeof(__pyx_k_child_klass), 0, 0, 1, 1},
  {&__pyx_n_s_children, __pyx_k_children, sizeof(__pyx_k_children), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_u_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 1, 0, 1},
  {&__pyx_n_s_classmethod, __pyx_k_classmethod, sizeof(__pyx_k_classmethod), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_clear_dict, __pyx_k_clear_dict, sizeof(__pyx_k_clear_dict), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_n_s_co_flags, __pyx_k_co_flags, sizeof(__pyx_k_co_flags), 0, 0, 1, 1},
  {&__pyx_n_u_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 1, 0, 1},
  {&__pyx_n_s_code_mock, __pyx_k_code_mock, sizeof(__pyx_k_code_mock), 0, 0, 1, 1},
  {&__pyx_n_s_comp, __pyx_k_comp, sizeof(__pyx_k_comp), 0, 0, 1, 1},
  {&__pyx_n_u_complex, __pyx_k_complex, sizeof(__pyx_k_complex), 0, 1, 0, 1},
  {&__pyx_n_s_components, __pyx_k_components, sizeof(__pyx_k_components), 0, 0, 1, 1},
  {&__pyx_n_s_configure_mock, __pyx_k_configure_mock, sizeof(__pyx_k_configure_mock), 0, 0, 1, 1},
  {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
  {&__pyx_n_u_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 1, 0, 1},
  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
  {&__pyx_n_s_contextlib, __pyx_k_contextlib, sizeof(__pyx_k_contextlib), 0, 0, 1, 1},
  {&__pyx_n_s_contextmanager, __pyx_k_contextmanager, sizeof(__pyx_k_contextmanager), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_copy_func_details, __pyx_k_copy_func_details, sizeof(__pyx_k_copy_func_details), 0, 0, 1, 1},
  {&__pyx_n_s_coroutines, __pyx_k_coroutines, sizeof(__pyx_k_coroutines), 0, 0, 1, 1},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_u_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 1, 0, 1},
  {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
  {&__pyx_n_s_create_autospec, __pyx_k_create_autospec, sizeof(__pyx_k_create_autospec), 0, 0, 1, 1},
  {&__pyx_n_u_create_autospec, __pyx_k_create_autospec, sizeof(__pyx_k_create_autospec), 0, 1, 0, 1},
  {&__pyx_n_s_create_mock, __pyx_k_create_mock, sizeof(__pyx_k_create_mock), 0, 0, 1, 1},
  {&__pyx_n_s_cymock, __pyx_k_cymock, sizeof(__pyx_k_cymock), 0, 0, 1, 1},
  {&__pyx_kp_s_cymock_pyx, __pyx_k_cymock_pyx, sizeof(__pyx_k_cymock_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_decorate_async_callable, __pyx_k_decorate_async_callable, sizeof(__pyx_k_decorate_async_callable), 0, 0, 1, 1},
  {&__pyx_n_s_decorate_callable, __pyx_k_decorate_callable, sizeof(__pyx_k_decorate_callable), 0, 0, 1, 1},
  {&__pyx_n_s_decorate_class, __pyx_k_decorate_class, sizeof(__pyx_k_decorate_class), 0, 0, 1, 1},
  {&__pyx_n_s_decorated, __pyx_k_decorated, sizeof(__pyx_k_decorated), 0, 0, 1, 1},
  {&__pyx_n_s_decoration_helper, __pyx_k_decoration_helper, sizeof(__pyx_k_decoration_helper), 0, 0, 1, 1},
  {&__pyx_n_s_decorator, __pyx_k_decorator, sizeof(__pyx_k_decorator), 0, 0, 1, 1},
  {&__pyx_kp_u_def_s_args_kwargs__checksig__arg, __pyx_k_def_s_args_kwargs__checksig__arg, sizeof(__pyx_k_def_s_args_kwargs__checksig__arg), 0, 1, 0, 0},
  {&__pyx_n_u_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 1, 0, 1},
  {&__pyx_n_u_del, __pyx_k_del, sizeof(__pyx_k_del), 0, 1, 0, 1},
  {&__pyx_n_s_delattr, __pyx_k_delattr, sizeof(__pyx_k_delattr), 0, 0, 1, 1},
  {&__pyx_n_s_delegated, __pyx_k_delegated, sizeof(__pyx_k_delegated), 0, 0, 1, 1},
  {&__pyx_n_s_delegating_property, __pyx_k_delegating_property, sizeof(__pyx_k_delegating_property), 0, 0, 1, 1},
  {&__pyx_n_s_delegating_property_locals__get, __pyx_k_delegating_property_locals__get, sizeof(__pyx_k_delegating_property_locals__get), 0, 0, 1, 1},
  {&__pyx_n_s_delegating_property_locals__set, __pyx_k_delegating_property_locals__set, sizeof(__pyx_k_delegating_property_locals__set), 0, 0, 1, 1},
  {&__pyx_n_u_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 1, 0, 1},
  {&__pyx_n_s_deleted, __pyx_k_deleted, sizeof(__pyx_k_deleted), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_u_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 0, 1},
  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
  {&__pyx_n_s_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 0, 0, 1, 1},
  {&__pyx_n_u_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 0, 1, 0, 1},
  {&__pyx_n_s_do_method_calls, __pyx_k_do_method_calls, sizeof(__pyx_k_do_method_calls), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_u_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 0, 1},
  {&__pyx_kp_u_does_not_contain_all_of, __pyx_k_does_not_contain_all_of, sizeof(__pyx_k_does_not_contain_all_of), 0, 1, 0, 0},
  {&__pyx_kp_u_does_not_have_the_attribute, __pyx_k_does_not_have_the_attribute, sizeof(__pyx_k_does_not_have_the_attribute), 0, 1, 0, 0},
  {&__pyx_n_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 1},
  {&__pyx_n_s_dot_lookup, __pyx_k_dot_lookup, sizeof(__pyx_k_dot_lookup), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_eat_self, __pyx_k_eat_self, sizeof(__pyx_k_eat_self), 0, 0, 1, 1},
  {&__pyx_n_s_eat_self_2, __pyx_k_eat_self_2, sizeof(__pyx_k_eat_self_2), 0, 0, 1, 1},
  {&__pyx_n_u_eat_self_2, __pyx_k_eat_self_2, sizeof(__pyx_k_eat_self_2), 0, 1, 0, 1},
  {&__pyx_n_s_effect, __pyx_k_effect, sizeof(__pyx_k_effect), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_entered_patchers, __pyx_k_entered_patchers, sizeof(__pyx_k_entered_patchers), 0, 0, 1, 1},
  {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1},
  {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1},
  {&__pyx_n_u_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 1, 0, 1},
  {&__pyx_n_s_error_message, __pyx_k_error_message, sizeof(__pyx_k_error_message), 0, 0, 1, 1},
  {&__pyx_n_s_error_message_2, __pyx_k_error_message_2, sizeof(__pyx_k_error_message_2), 0, 0, 1, 1},
  {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
  {&__pyx_n_s_execute_mock_call, __pyx_k_execute_mock_call, sizeof(__pyx_k_execute_mock_call), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_u_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 1, 0, 1},
  {&__pyx_n_s_expected, __pyx_k_expected, sizeof(__pyx_k_expected), 0, 0, 1, 1},
  {&__pyx_kp_u_expected_call_not_found_Expected, __pyx_k_expected_call_not_found_Expected, sizeof(__pyx_k_expected_call_not_found_Expected), 0, 1, 0, 0},
  {&__pyx_kp_u_expected_s_not_found_Expected_s, __pyx_k_expected_s_not_found_Expected_s, sizeof(__pyx_k_expected_s_not_found_Expected_s), 0, 1, 0, 0},
  {&__pyx_n_s_expected_string, __pyx_k_expected_string, sizeof(__pyx_k_expected_string), 0, 0, 1, 1},
  {&__pyx_n_s_extra_args, __pyx_k_extra_args, sizeof(__pyx_k_extra_args), 0, 0, 1, 1},
  {&__pyx_n_s_extract_mock, __pyx_k_extract_mock, sizeof(__pyx_k_extract_mock), 0, 0, 1, 1},
  {&__pyx_n_s_extract_mock_name, __pyx_k_extract_mock_name, sizeof(__pyx_k_extract_mock_name), 0, 0, 1, 1},
  {&__pyx_n_s_extras, __pyx_k_extras, sizeof(__pyx_k_extras), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_s_file_spec, __pyx_k_file_spec, sizeof(__pyx_k_file_spec), 0, 0, 1, 1},
  {&__pyx_n_s_final, __pyx_k_final, sizeof(__pyx_k_final), 0, 0, 1, 1},
  {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1},
  {&__pyx_n_s_first_2, __pyx_k_first_2, sizeof(__pyx_k_first_2), 0, 0, 1, 1},
  {&__pyx_n_s_fixed, __pyx_k_fixed, sizeof(__pyx_k_fixed), 0, 0, 1, 1},
  {&__pyx_n_u_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 1, 0, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_u_format_2, __pyx_k_format_2, sizeof(__pyx_k_format_2), 0, 1, 0, 1},
  {&__pyx_n_s_format_call_signature, __pyx_k_format_call_signature, sizeof(__pyx_k_format_call_signature), 0, 0, 1, 1},
  {&__pyx_n_s_format_mock_call_signature, __pyx_k_format_mock_call_signature, sizeof(__pyx_k_format_mock_call_signature), 0, 0, 1, 1},
  {&__pyx_n_s_format_mock_failure_message, __pyx_k_format_mock_failure_message, sizeof(__pyx_k_format_mock_failure_message), 0, 0, 1, 1},
  {&__pyx_n_s_formatted_args, __pyx_k_formatted_args, sizeof(__pyx_k_formatted_args), 0, 0, 1, 1},
  {&__pyx_n_s_from_child_mocks, __pyx_k_from_child_mocks, sizeof(__pyx_k_from_child_mocks), 0, 0, 1, 1},
  {&__pyx_n_s_from_dict, __pyx_k_from_dict, sizeof(__pyx_k_from_dict), 0, 0, 1, 1},
  {&__pyx_n_s_from_kall, __pyx_k_from_kall, sizeof(__pyx_k_from_kall), 0, 0, 1, 1},
  {&__pyx_n_s_from_type, __pyx_k_from_type, sizeof(__pyx_k_from_type), 0, 0, 1, 1},
  {&__pyx_n_u_fspath, __pyx_k_fspath, sizeof(__pyx_k_fspath), 0, 1, 0, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_u_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 1, 0, 1},
  {&__pyx_n_s_func_2, __pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 0, 1, 1},
  {&__pyx_n_s_funcopy, __pyx_k_funcopy, sizeof(__pyx_k_funcopy), 0, 0, 1, 1},
  {&__pyx_n_u_funcopy, __pyx_k_funcopy, sizeof(__pyx_k_funcopy), 0, 1, 0, 1},
  {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
  {&__pyx_n_u_ge, __pyx_k_ge, sizeof(__pyx_k_ge), 0, 1, 0, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1},
  {&__pyx_n_s_get_3, __pyx_k_get_3, sizeof(__pyx_k_get_3), 0, 0, 1, 1},
  {&__pyx_n_u_get_3, __pyx_k_get_3, sizeof(__pyx_k_get_3), 0, 1, 0, 1},
  {&__pyx_n_s_get_async_iter, __pyx_k_get_async_iter, sizeof(__pyx_k_get_async_iter), 0, 0, 1, 1},
  {&__pyx_n_s_get_async_iter_locals___aiter, __pyx_k_get_async_iter_locals___aiter, sizeof(__pyx_k_get_async_iter_locals___aiter), 0, 0, 1, 1},
  {&__pyx_n_s_get_call_arguments, __pyx_k_get_call_arguments, sizeof(__pyx_k_get_call_arguments), 0, 0, 1, 1},
  {&__pyx_n_s_get_call_signature_from_name, __pyx_k_get_call_signature_from_name, sizeof(__pyx_k_get_call_signature_from_name), 0, 0, 1, 1},
  {&__pyx_n_s_get_child_mock, __pyx_k_get_child_mock, sizeof(__pyx_k_get_child_mock), 0, 0, 1, 1},
  {&__pyx_n_s_get_eq, __pyx_k_get_eq, sizeof(__pyx_k_get_eq), 0, 0, 1, 1},
  {&__pyx_n_s_get_eq_locals___eq, __pyx_k_get_eq_locals___eq, sizeof(__pyx_k_get_eq_locals___eq), 0, 0, 1, 1},
  {&__pyx_n_s_get_iter, __pyx_k_get_iter, sizeof(__pyx_k_get_iter), 0, 0, 1, 1},
  {&__pyx_n_s_get_iter_locals___iter, __pyx_k_get_iter_locals___iter, sizeof(__pyx_k_get_iter_locals___iter), 0, 0, 1, 1},
  {&__pyx_n_s_get_method, __pyx_k_get_method, sizeof(__pyx_k_get_method), 0, 0, 1, 1},
  {&__pyx_n_s_get_method_locals_method, __pyx_k_get_method_locals_method, sizeof(__pyx_k_get_method_locals_method), 0, 0, 1, 1},
  {&__pyx_n_s_get_ne, __pyx_k_get_ne, sizeof(__pyx_k_get_ne), 0, 0, 1, 1},
  {&__pyx_n_s_get_ne_locals___ne, __pyx_k_get_ne_locals___ne, sizeof(__pyx_k_get_ne_locals___ne), 0, 0, 1, 1},
  {&__pyx_n_s_get_original, __pyx_k_get_original, sizeof(__pyx_k_get_original), 0, 0, 1, 1},
  {&__pyx_n_s_get_return_value, __pyx_k_get_return_value, sizeof(__pyx_k_get_return_value), 0, 0, 1, 1},
  {&__pyx_n_s_get_side_effect, __pyx_k_get_side_effect, sizeof(__pyx_k_get_side_effect), 0, 0, 1, 1},
  {&__pyx_n_s_get_signature_object, __pyx_k_get_signature_object, sizeof(__pyx_k_get_signature_object), 0, 0, 1, 1},
  {&__pyx_n_s_get_target, __pyx_k_get_target, sizeof(__pyx_k_get_target), 0, 0, 1, 1},
  {&__pyx_n_s_get_target_locals_lambda, __pyx_k_get_target_locals_lambda, sizeof(__pyx_k_get_target_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
  {&__pyx_n_u_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 1, 0, 1},
  {&__pyx_n_s_getattribute, __pyx_k_getattribute, sizeof(__pyx_k_getattribute), 0, 0, 1, 1},
  {&__pyx_n_u_getformat, __pyx_k_getformat, sizeof(__pyx_k_getformat), 0, 1, 0, 1},
  {&__pyx_n_u_getinitargs, __pyx_k_getinitargs, sizeof(__pyx_k_getinitargs), 0, 1, 0, 1},
  {&__pyx_n_u_getnewargs, __pyx_k_getnewargs, sizeof(__pyx_k_getnewargs), 0, 1, 0, 1},
  {&__pyx_n_u_getnewargs_ex, __pyx_k_getnewargs_ex, sizeof(__pyx_k_getnewargs_ex), 0, 1, 0, 1},
  {&__pyx_n_u_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 1, 0, 1},
  {&__pyx_n_s_getter, __pyx_k_getter, sizeof(__pyx_k_getter), 0, 0, 1, 1},
  {&__pyx_n_u_gt, __pyx_k_gt, sizeof(__pyx_k_gt), 0, 1, 0, 1},
  {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1},
  {&__pyx_n_s_has_local, __pyx_k_has_local, sizeof(__pyx_k_has_local), 0, 0, 1, 1},
  {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1},
  {&__pyx_n_u_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 1, 0, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_kp_u_i_s, __pyx_k_i_s, sizeof(__pyx_k_i_s), 0, 1, 0, 0},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_kp_u_id_2, __pyx_k_id_2, sizeof(__pyx_k_id_2), 0, 1, 0, 0},
  {&__pyx_n_s_ids, __pyx_k_ids, sizeof(__pyx_k_ids), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_import_path, __pyx_k_import_path, sizeof(__pyx_k_import_path), 0, 0, 1, 1},
  {&__pyx_n_s_importer, __pyx_k_importer, sizeof(__pyx_k_importer), 0, 0, 1, 1},
  {&__pyx_n_s_in_dict, __pyx_k_in_dict, sizeof(__pyx_k_in_dict), 0, 0, 1, 1},
  {&__pyx_kp_u_in_its_call_list_found, __pyx_k_in_its_call_list_found, sizeof(__pyx_k_in_its_call_list_found), 0, 1, 0, 0},
  {&__pyx_n_s_increment_mock_call, __pyx_k_increment_mock_call, sizeof(__pyx_k_increment_mock_call), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_u_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 1, 0, 1},
  {&__pyx_n_u_index_2, __pyx_k_index_2, sizeof(__pyx_k_index_2), 0, 1, 0, 1},
  {&__pyx_n_s_inherit, __pyx_k_inherit, sizeof(__pyx_k_inherit), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_u_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 1, 0, 1},
  {&__pyx_n_s_inner, __pyx_k_inner, sizeof(__pyx_k_inner), 0, 0, 1, 1},
  {&__pyx_n_s_inner_mock, __pyx_k_inner_mock, sizeof(__pyx_k_inner_mock), 0, 0, 1, 1},
  {&__pyx_n_s_inplace, __pyx_k_inplace, sizeof(__pyx_k_inplace), 0, 0, 1, 1},
  {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1},
  {&__pyx_n_s_instance, __pyx_k_instance, sizeof(__pyx_k_instance), 0, 0, 1, 1},
  {&__pyx_n_s_instance_callable, __pyx_k_instance_callable, sizeof(__pyx_k_instance_callable), 0, 0, 1, 1},
  {&__pyx_n_u_instancecheck, __pyx_k_instancecheck, sizeof(__pyx_k_instancecheck), 0, 1, 0, 1},
  {&__pyx_kp_u_instead, __pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0, 0},
  {&__pyx_n_u_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 1, 0, 1},
  {&__pyx_n_s_intersection, __pyx_k_intersection, sizeof(__pyx_k_intersection), 0, 0, 1, 1},
  {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
  {&__pyx_n_s_io_2, __pyx_k_io_2, sizeof(__pyx_k_io_2), 0, 0, 1, 1},
  {&__pyx_n_s_is_a_call, __pyx_k_is_a_call, sizeof(__pyx_k_is_a_call), 0, 0, 1, 1},
  {&__pyx_n_s_is_async_func, __pyx_k_is_async_func, sizeof(__pyx_k_is_async_func), 0, 0, 1, 1},
  {&__pyx_n_s_is_async_func_2, __pyx_k_is_async_func_2, sizeof(__pyx_k_is_async_func_2), 0, 0, 1, 1},
  {&__pyx_n_s_is_async_obj, __pyx_k_is_async_obj, sizeof(__pyx_k_is_async_obj), 0, 0, 1, 1},
  {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
  {&__pyx_n_u_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 0, 1},
  {&__pyx_n_s_is_exception, __pyx_k_is_exception, sizeof(__pyx_k_is_exception), 0, 0, 1, 1},
  {&__pyx_n_s_is_instance_mock, __pyx_k_is_instance_mock, sizeof(__pyx_k_is_instance_mock), 0, 0, 1, 1},
  {&__pyx_n_s_is_list, __pyx_k_is_list, sizeof(__pyx_k_is_list), 0, 0, 1, 1},
  {&__pyx_n_s_is_local, __pyx_k_is_local, sizeof(__pyx_k_is_local), 0, 0, 1, 1},
  {&__pyx_n_u_is_local, __pyx_k_is_local, sizeof(__pyx_k_is_local), 0, 1, 0, 1},
  {&__pyx_n_s_is_magic, __pyx_k_is_magic, sizeof(__pyx_k_is_magic), 0, 0, 1, 1},
  {&__pyx_n_s_is_started, __pyx_k_is_started, sizeof(__pyx_k_is_started), 0, 0, 1, 1},
  {&__pyx_n_s_is_type, __pyx_k_is_type, sizeof(__pyx_k_is_type), 0, 0, 1, 1},
  {&__pyx_n_s_isawaitable, __pyx_k_isawaitable, sizeof(__pyx_k_isawaitable), 0, 0, 1, 1},
  {&__pyx_n_s_iscoroutinefunction, __pyx_k_iscoroutinefunction, sizeof(__pyx_k_iscoroutinefunction), 0, 0, 1, 1},
  {&__pyx_n_s_isdatadescriptor, __pyx_k_isdatadescriptor, sizeof(__pyx_k_isdatadescriptor), 0, 0, 1, 1},
  {&__pyx_n_s_isidentifier, __pyx_k_isidentifier, sizeof(__pyx_k_isidentifier), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  {&__pyx_n_u_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 1, 0, 1},
  {&__pyx_n_s_iter_side_effect, __pyx_k_iter_side_effect, sizeof(__pyx_k_iter_side_effect), 0, 0, 1, 1},
  {&__pyx_n_s_iterator, __pyx_k_iterator, sizeof(__pyx_k_iterator), 0, 0, 1, 1},
  {&__pyx_n_s_kall, __pyx_k_kall, sizeof(__pyx_k_kall), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_keywargs, __pyx_k_keywargs, sizeof(__pyx_k_keywargs), 0, 0, 1, 1},
  {&__pyx_n_s_klass, __pyx_k_klass, sizeof(__pyx_k_klass), 0, 0, 1, 1},
  {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs_2, __pyx_k_kwargs_2, sizeof(__pyx_k_kwargs_2), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs_string, __pyx_k_kwargs_string, sizeof(__pyx_k_kwargs_string), 0, 0, 1, 1},
  {&__pyx_n_u_kwdefaults, __pyx_k_kwdefaults, sizeof(__pyx_k_kwdefaults), 0, 1, 0, 1},
  {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1},
  {&__pyx_n_u_le, __pyx_k_le, sizeof(__pyx_k_le), 0, 1, 0, 1},
  {&__pyx_n_u_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 1, 0, 1},
  {&__pyx_n_s_len_2, __pyx_k_len_2, sizeof(__pyx_k_len_2), 0, 0, 1, 1},
  {&__pyx_n_s_len_other, __pyx_k_len_other, sizeof(__pyx_k_len_other), 0, 0, 1, 1},
  {&__pyx_n_s_len_self, __pyx_k_len_self, sizeof(__pyx_k_len_self), 0, 0, 1, 1},
  {&__pyx_n_s_len_value, __pyx_k_len_value, sizeof(__pyx_k_len_value), 0, 0, 1, 1},
  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
  {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1},
  {&__pyx_n_u_lt, __pyx_k_lt, sizeof(__pyx_k_lt), 0, 1, 0, 1},
  {&__pyx_kp_u_lt_le_gt_ge_eq_ne_getitem_setite, __pyx_k_lt_le_gt_ge_eq_ne_getitem_setite, sizeof(__pyx_k_lt_le_gt_ge_eq_ne_getitem_setite), 0, 1, 0, 0},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_m_name, __pyx_k_m_name, sizeof(__pyx_k_m_name), 0, 0, 1, 1},
  {&__pyx_n_s_m_value, __pyx_k_m_value, sizeof(__pyx_k_m_value), 0, 0, 1, 1},
  {&__pyx_n_s_magic_methods, __pyx_k_magic_methods, sizeof(__pyx_k_magic_methods), 0, 0, 1, 1},
  {&__pyx_n_s_magics, __pyx_k_magics, sizeof(__pyx_k_magics), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  {&__pyx_n_s_method_call_name, __pyx_k_method_call_name, sizeof(__pyx_k_method_call_name), 0, 0, 1, 1},
  {&__pyx_n_s_method_calls, __pyx_k_method_calls, sizeof(__pyx_k_method_calls), 0, 0, 1, 1},
  {&__pyx_n_u_method_calls, __pyx_k_method_calls, sizeof(__pyx_k_method_calls), 0, 1, 0, 1},
  {&__pyx_n_s_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 0, 1, 1},
  {&__pyx_n_u_missing_2, __pyx_k_missing_2, sizeof(__pyx_k_missing_2), 0, 1, 0, 1},
  {&__pyx_n_s_mock, __pyx_k_mock, sizeof(__pyx_k_mock), 0, 0, 1, 1},
  {&__pyx_n_u_mock, __pyx_k_mock, sizeof(__pyx_k_mock), 0, 1, 0, 1},
  {&__pyx_n_u_mock_2, __pyx_k_mock_2, sizeof(__pyx_k_mock_2), 0, 1, 0, 1},
  {&__pyx_kp_u_mock_3, __pyx_k_mock_3, sizeof(__pyx_k_mock_3), 0, 1, 0, 0},
  {&__pyx_n_s_mock_add_spec, __pyx_k_mock_add_spec, sizeof(__pyx_k_mock_add_spec), 0, 0, 1, 1},
  {&__pyx_n_s_mock_add_spec_2, __pyx_k_mock_add_spec_2, sizeof(__pyx_k_mock_add_spec_2), 0, 0, 1, 1},
  {&__pyx_n_u_mock_await_args, __pyx_k_mock_await_args, sizeof(__pyx_k_mock_await_args), 0, 1, 0, 1},
  {&__pyx_n_u_mock_await_args_list, __pyx_k_mock_await_args_list, sizeof(__pyx_k_mock_await_args_list), 0, 1, 0, 1},
  {&__pyx_n_u_mock_await_count, __pyx_k_mock_await_count, sizeof(__pyx_k_mock_await_count), 0, 1, 0, 1},
  {&__pyx_n_s_mock_call, __pyx_k_mock_call, sizeof(__pyx_k_mock_call), 0, 0, 1, 1},
  {&__pyx_n_u_mock_call_args, __pyx_k_mock_call_args, sizeof(__pyx_k_mock_call_args), 0, 1, 0, 1},
  {&__pyx_n_u_mock_call_args_list, __pyx_k_mock_call_args_list, sizeof(__pyx_k_mock_call_args_list), 0, 1, 0, 1},
  {&__pyx_n_u_mock_call_count, __pyx_k_mock_call_count, sizeof(__pyx_k_mock_call_count), 0, 1, 0, 1},
  {&__pyx_n_s_mock_call_name, __pyx_k_mock_call_name, sizeof(__pyx_k_mock_call_name), 0, 0, 1, 1},
  {&__pyx_n_u_mock_called, __pyx_k_mock_called, sizeof(__pyx_k_mock_called), 0, 1, 0, 1},
  {&__pyx_n_s_mock_calls, __pyx_k_mock_calls, sizeof(__pyx_k_mock_calls), 0, 0, 1, 1},
  {&__pyx_n_u_mock_calls, __pyx_k_mock_calls, sizeof(__pyx_k_mock_calls), 0, 1, 0, 1},
  {&__pyx_n_s_mock_check_sig, __pyx_k_mock_check_sig, sizeof(__pyx_k_mock_check_sig), 0, 0, 1, 1},
  {&__pyx_n_s_mock_children, __pyx_k_mock_children, sizeof(__pyx_k_mock_children), 0, 0, 1, 1},
  {&__pyx_n_u_mock_children, __pyx_k_mock_children, sizeof(__pyx_k_mock_children), 0, 1, 0, 1},
  {&__pyx_n_s_mock_delegate, __pyx_k_mock_delegate, sizeof(__pyx_k_mock_delegate), 0, 0, 1, 1},
  {&__pyx_n_u_mock_delegate, __pyx_k_mock_delegate, sizeof(__pyx_k_mock_delegate), 0, 1, 0, 1},
  {&__pyx_n_s_mock_from_kall, __pyx_k_mock_from_kall, sizeof(__pyx_k_mock_from_kall), 0, 0, 1, 1},
  {&__pyx_n_s_mock_methods, __pyx_k_mock_methods, sizeof(__pyx_k_mock_methods), 0, 0, 1, 1},
  {&__pyx_n_u_mock_methods, __pyx_k_mock_methods, sizeof(__pyx_k_mock_methods), 0, 1, 0, 1},
  {&__pyx_n_u_mock_mock_calls, __pyx_k_mock_mock_calls, sizeof(__pyx_k_mock_mock_calls), 0, 1, 0, 1},
  {&__pyx_n_s_mock_name, __pyx_k_mock_name, sizeof(__pyx_k_mock_name), 0, 0, 1, 1},
  {&__pyx_n_u_mock_name, __pyx_k_mock_name, sizeof(__pyx_k_mock_name), 0, 1, 0, 1},
  {&__pyx_n_s_mock_name_2, __pyx_k_mock_name_2, sizeof(__pyx_k_mock_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_mock_new_name, __pyx_k_mock_new_name, sizeof(__pyx_k_mock_new_name), 0, 0, 1, 1},
  {&__pyx_n_u_mock_new_name, __pyx_k_mock_new_name, sizeof(__pyx_k_mock_new_name), 0, 1, 0, 1},
  {&__pyx_n_s_mock_new_parent, __pyx_k_mock_new_parent, sizeof(__pyx_k_mock_new_parent), 0, 0, 1, 1},
  {&__pyx_n_u_mock_new_parent, __pyx_k_mock_new_parent, sizeof(__pyx_k_mock_new_parent), 0, 1, 0, 1},
  {&__pyx_n_s_mock_open, __pyx_k_mock_open, sizeof(__pyx_k_mock_open), 0, 0, 1, 1},
  {&__pyx_n_u_mock_open, __pyx_k_mock_open, sizeof(__pyx_k_mock_open), 0, 1, 0, 1},
  {&__pyx_n_s_mock_open_locals__iter_side_effe, __pyx_k_mock_open_locals__iter_side_effe, sizeof(__pyx_k_mock_open_locals__iter_side_effe), 0, 0, 1, 1},
  {&__pyx_n_s_mock_open_locals__next_side_effe, __pyx_k_mock_open_locals__next_side_effe, sizeof(__pyx_k_mock_open_locals__next_side_effe), 0, 0, 1, 1},
  {&__pyx_n_s_mock_open_locals__read_side_effe, __pyx_k_mock_open_locals__read_side_effe, sizeof(__pyx_k_mock_open_locals__read_side_effe), 0, 0, 1, 1},
  {&__pyx_n_s_mock_open_locals__readline_side, __pyx_k_mock_open_locals__readline_side, sizeof(__pyx_k_mock_open_locals__readline_side), 0, 0, 1, 1},
  {&__pyx_n_s_mock_open_locals__readlines_side, __pyx_k_mock_open_locals__readlines_side, sizeof(__pyx_k_mock_open_locals__readlines_side), 0, 0, 1, 1},
  {&__pyx_n_s_mock_open_locals_reset_data, __pyx_k_mock_open_locals_reset_data, sizeof(__pyx_k_mock_open_locals_reset_data), 0, 0, 1, 1},
  {&__pyx_n_s_mock_parent, __pyx_k_mock_parent, sizeof(__pyx_k_mock_parent), 0, 0, 1, 1},
  {&__pyx_n_u_mock_parent, __pyx_k_mock_parent, sizeof(__pyx_k_mock_parent), 0, 1, 0, 1},
  {&__pyx_n_s_mock_return_value, __pyx_k_mock_return_value, sizeof(__pyx_k_mock_return_value), 0, 0, 1, 1},
  {&__pyx_n_u_mock_return_value, __pyx_k_mock_return_value, sizeof(__pyx_k_mock_return_value), 0, 1, 0, 1},
  {&__pyx_n_s_mock_sealed, __pyx_k_mock_sealed, sizeof(__pyx_k_mock_sealed), 0, 0, 1, 1},
  {&__pyx_n_u_mock_sealed, __pyx_k_mock_sealed, sizeof(__pyx_k_mock_sealed), 0, 1, 0, 1},
  {&__pyx_n_s_mock_set_magics, __pyx_k_mock_set_magics, sizeof(__pyx_k_mock_set_magics), 0, 0, 1, 1},
  {&__pyx_n_s_mock_side_effect, __pyx_k_mock_side_effect, sizeof(__pyx_k_mock_side_effect), 0, 0, 1, 1},
  {&__pyx_n_u_mock_side_effect, __pyx_k_mock_side_effect, sizeof(__pyx_k_mock_side_effect), 0, 1, 0, 1},
  {&__pyx_n_s_mock_unsafe, __pyx_k_mock_unsafe, sizeof(__pyx_k_mock_unsafe), 0, 0, 1, 1},
  {&__pyx_n_u_mock_unsafe, __pyx_k_mock_unsafe, sizeof(__pyx_k_mock_unsafe), 0, 1, 0, 1},
  {&__pyx_n_s_mock_wraps, __pyx_k_mock_wraps, sizeof(__pyx_k_mock_wraps), 0, 0, 1, 1},
  {&__pyx_n_u_mock_wraps, __pyx_k_mock_wraps, sizeof(__pyx_k_mock_wraps), 0, 1, 0, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_u_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 1, 0, 1},
  {&__pyx_n_s_mro, __pyx_k_mro, sizeof(__pyx_k_mro), 0, 0, 1, 1},
  {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
  {&__pyx_n_s_multiple, __pyx_k_multiple, sizeof(__pyx_k_multiple), 0, 0, 1, 1},
  {&__pyx_kp_u_must_be_the_actual_object_to_be, __pyx_k_must_be_the_actual_object_to_be, sizeof(__pyx_k_must_be_the_actual_object_to_be), 0, 1, 0, 0},
  {&__pyx_n_s_must_skip, __pyx_k_must_skip, sizeof(__pyx_k_must_skip), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 1},
  {&__pyx_n_s_name_3, __pyx_k_name_3, sizeof(__pyx_k_name_3), 0, 0, 1, 1},
  {&__pyx_n_s_name_list, __pyx_k_name_list, sizeof(__pyx_k_name_list), 0, 0, 1, 1},
  {&__pyx_kp_u_name_r, __pyx_k_name_r, sizeof(__pyx_k_name_r), 0, 1, 0, 0},
  {&__pyx_n_s_name_string, __pyx_k_name_string, sizeof(__pyx_k_name_string), 0, 0, 1, 1},
  {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
  {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1},
  {&__pyx_n_u_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 1, 0, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_u_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 1, 0, 1},
  {&__pyx_n_s_new_2, __pyx_k_new_2, sizeof(__pyx_k_new_2), 0, 0, 1, 1},
  {&__pyx_n_s_new_attr, __pyx_k_new_attr, sizeof(__pyx_k_new_attr), 0, 0, 1, 1},
  {&__pyx_n_s_new_callable, __pyx_k_new_callable, sizeof(__pyx_k_new_callable), 0, 0, 1, 1},
  {&__pyx_n_s_new_name, __pyx_k_new_name, sizeof(__pyx_k_new_name), 0, 0, 1, 1},
  {&__pyx_n_s_new_name_2, __pyx_k_new_name_2, sizeof(__pyx_k_new_name_2), 0, 0, 1, 1},
  {&__pyx_n_u_new_name_2, __pyx_k_new_name_2, sizeof(__pyx_k_new_name_2), 0, 1, 0, 1},
  {&__pyx_n_s_new_parent, __pyx_k_new_parent, sizeof(__pyx_k_new_parent), 0, 0, 1, 1},
  {&__pyx_n_s_newargs, __pyx_k_newargs, sizeof(__pyx_k_newargs), 0, 0, 1, 1},
  {&__pyx_n_s_newkeywargs, __pyx_k_newkeywargs, sizeof(__pyx_k_newkeywargs), 0, 0, 1, 1},
  {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
  {&__pyx_n_s_next_side_effect, __pyx_k_next_side_effect, sizeof(__pyx_k_next_side_effect), 0, 0, 1, 1},
  {&__pyx_n_s_non_defaults, __pyx_k_non_defaults, sizeof(__pyx_k_non_defaults), 0, 0, 1, 1},
  {&__pyx_kp_u_not_all_found_in_await_list, __pyx_k_not_all_found_in_await_list, sizeof(__pyx_k_not_all_found_in_await_list), 0, 1, 0, 0},
  {&__pyx_n_s_not_callable, __pyx_k_not_callable, sizeof(__pyx_k_not_callable), 0, 0, 1, 1},
  {&__pyx_kp_u_not_called, __pyx_k_not_called, sizeof(__pyx_k_not_called), 0, 1, 0, 0},
  {&__pyx_n_s_not_found, __pyx_k_not_found, sizeof(__pyx_k_not_found), 0, 0, 1, 1},
  {&__pyx_n_s_numerics, __pyx_k_numerics, sizeof(__pyx_k_numerics), 0, 0, 1, 1},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_obj_type, __pyx_k_obj_type, sizeof(__pyx_k_obj_type), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_u_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 1, 0, 1},
  {&__pyx_n_s_orig_magics, __pyx_k_orig_magics, sizeof(__pyx_k_orig_magics), 0, 0, 1, 1},
  {&__pyx_n_s_original, __pyx_k_original, sizeof(__pyx_k_original), 0, 0, 1, 1},
  {&__pyx_n_s_original_2, __pyx_k_original_2, sizeof(__pyx_k_original_2), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_other_args, __pyx_k_other_args, sizeof(__pyx_k_other_args), 0, 0, 1, 1},
  {&__pyx_n_s_other_kwargs, __pyx_k_other_kwargs, sizeof(__pyx_k_other_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_other_name, __pyx_k_other_name, sizeof(__pyx_k_other_name), 0, 0, 1, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
  {&__pyx_n_s_parent_2, __pyx_k_parent_2, sizeof(__pyx_k_parent_2), 0, 0, 1, 1},
  {&__pyx_n_s_partial, __pyx_k_partial, sizeof(__pyx_k_partial), 0, 0, 1, 1},
  {&__pyx_n_s_patch, __pyx_k_patch, sizeof(__pyx_k_patch), 0, 0, 1, 1},
  {&__pyx_n_s_patch_2, __pyx_k_patch_2, sizeof(__pyx_k_patch_2), 0, 0, 1, 1},
  {&__pyx_n_u_patch_2, __pyx_k_patch_2, sizeof(__pyx_k_patch_2), 0, 1, 0, 1},
  {&__pyx_n_s_patch___call, __pyx_k_patch___call, sizeof(__pyx_k_patch___call), 0, 0, 1, 1},
  {&__pyx_n_s_patch___enter, __pyx_k_patch___enter, sizeof(__pyx_k_patch___enter), 0, 0, 1, 1},
  {&__pyx_n_s_patch___exit, __pyx_k_patch___exit, sizeof(__pyx_k_patch___exit), 0, 0, 1, 1},
  {&__pyx_n_s_patch___init, __pyx_k_patch___init, sizeof(__pyx_k_patch___init), 0, 0, 1, 1},
  {&__pyx_n_s_patch___new, __pyx_k_patch___new, sizeof(__pyx_k_patch___new), 0, 0, 1, 1},
  {&__pyx_n_s_patch_copy, __pyx_k_patch_copy, sizeof(__pyx_k_patch_copy), 0, 0, 1, 1},
  {&__pyx_n_s_patch_decorate_async_callable, __pyx_k_patch_decorate_async_callable, sizeof(__pyx_k_patch_decorate_async_callable), 0, 0, 1, 1},
  {&__pyx_n_s_patch_decorate_async_callable_l, __pyx_k_patch_decorate_async_callable_l, sizeof(__pyx_k_patch_decorate_async_callable_l), 0, 0, 1, 1},
  {&__pyx_n_s_patch_decorate_callable, __pyx_k_patch_decorate_callable, sizeof(__pyx_k_patch_decorate_callable), 0, 0, 1, 1},
  {&__pyx_n_s_patch_decorate_callable_locals, __pyx_k_patch_decorate_callable_locals, sizeof(__pyx_k_patch_decorate_callable_locals), 0, 0, 1, 1},
  {&__pyx_n_s_patch_decorate_class, __pyx_k_patch_decorate_class, sizeof(__pyx_k_patch_decorate_class), 0, 0, 1, 1},
  {&__pyx_n_s_patch_decoration_helper, __pyx_k_patch_decoration_helper, sizeof(__pyx_k_patch_decoration_helper), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict, __pyx_k_patch_dict, sizeof(__pyx_k_patch_dict), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict___call, __pyx_k_patch_dict___call, sizeof(__pyx_k_patch_dict___call), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict___call___locals__inn, __pyx_k_patch_dict___call___locals__inn, sizeof(__pyx_k_patch_dict___call___locals__inn), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict___enter, __pyx_k_patch_dict___enter, sizeof(__pyx_k_patch_dict___enter), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict___exit, __pyx_k_patch_dict___exit, sizeof(__pyx_k_patch_dict___exit), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict___init, __pyx_k_patch_dict___init, sizeof(__pyx_k_patch_dict___init), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict__patch_dict, __pyx_k_patch_dict__patch_dict, sizeof(__pyx_k_patch_dict__patch_dict), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict__unpatch_dict, __pyx_k_patch_dict__unpatch_dict, sizeof(__pyx_k_patch_dict__unpatch_dict), 0, 0, 1, 1},
  {&__pyx_n_s_patch_dict_decorate_class, __pyx_k_patch_dict_decorate_class, sizeof(__pyx_k_patch_dict_decorate_class), 0, 0, 1, 1},
  {&__pyx_n_s_patch_get_original, __pyx_k_patch_get_original, sizeof(__pyx_k_patch_get_original), 0, 0, 1, 1},
  {&__pyx_n_s_patch_multiple, __pyx_k_patch_multiple, sizeof(__pyx_k_patch_multiple), 0, 0, 1, 1},
  {&__pyx_n_s_patch_multiple_locals_lambda, __pyx_k_patch_multiple_locals_lambda, sizeof(__pyx_k_patch_multiple_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_patch_object, __pyx_k_patch_object, sizeof(__pyx_k_patch_object), 0, 0, 1, 1},
  {&__pyx_n_s_patch_object_locals_lambda, __pyx_k_patch_object_locals_lambda, sizeof(__pyx_k_patch_object_locals_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_patch_start, __pyx_k_patch_start, sizeof(__pyx_k_patch_start), 0, 0, 1, 1},
  {&__pyx_n_s_patch_stop, __pyx_k_patch_stop, sizeof(__pyx_k_patch_stop), 0, 0, 1, 1},
  {&__pyx_n_s_patch_stopall, __pyx_k_patch_stopall, sizeof(__pyx_k_patch_stopall), 0, 0, 1, 1},
  {&__pyx_n_s_patched, __pyx_k_patched, sizeof(__pyx_k_patched), 0, 0, 1, 1},
  {&__pyx_n_s_patcher, __pyx_k_patcher, sizeof(__pyx_k_patcher), 0, 0, 1, 1},
  {&__pyx_n_s_patching, __pyx_k_patching, sizeof(__pyx_k_patching), 0, 0, 1, 1},
  {&__pyx_n_s_patchings, __pyx_k_patchings, sizeof(__pyx_k_patchings), 0, 0, 1, 1},
  {&__pyx_n_u_patchings, __pyx_k_patchings, sizeof(__pyx_k_patchings), 0, 1, 0, 1},
  {&__pyx_n_s_pformat, __pyx_k_pformat, sizeof(__pyx_k_pformat), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_pprint, __pyx_k_pprint, sizeof(__pyx_k_pprint), 0, 0, 1, 1},
  {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_u_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 0, 1},
  {&__pyx_n_s_problem, __pyx_k_problem, sizeof(__pyx_k_problem), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_kp_u_r_s, __pyx_k_r_s, sizeof(__pyx_k_r_s), 0, 1, 0, 0},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_read_data, __pyx_k_read_data, sizeof(__pyx_k_read_data), 0, 0, 1, 1},
  {&__pyx_n_s_read_data_2, __pyx_k_read_data_2, sizeof(__pyx_k_read_data_2), 0, 0, 1, 1},
  {&__pyx_n_s_read_side_effect, __pyx_k_read_side_effect, sizeof(__pyx_k_read_side_effect), 0, 0, 1, 1},
  {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1},
  {&__pyx_n_s_readline_side_effect, __pyx_k_readline_side_effect, sizeof(__pyx_k_readline_side_effect), 0, 0, 1, 1},
  {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1},
  {&__pyx_n_s_readlines_side_effect, __pyx_k_readlines_side_effect, sizeof(__pyx_k_readlines_side_effect), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_u_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 1, 0, 1},
  {&__pyx_n_u_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 1, 0, 1},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_remove_magics, __pyx_k_remove_magics, sizeof(__pyx_k_remove_magics), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_u_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 1, 0, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_reset_data, __pyx_k_reset_data, sizeof(__pyx_k_reset_data), 0, 0, 1, 1},
  {&__pyx_n_s_reset_mock, __pyx_k_reset_mock, sizeof(__pyx_k_reset_mock), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
  {&__pyx_n_s_ret_val, __pyx_k_ret_val, sizeof(__pyx_k_ret_val), 0, 0, 1, 1},
  {&__pyx_n_s_return_calculator, __pyx_k_return_calculator, sizeof(__pyx_k_return_calculator), 0, 0, 1, 1},
  {&__pyx_n_s_return_value, __pyx_k_return_value, sizeof(__pyx_k_return_value), 0, 0, 1, 1},
  {&__pyx_n_u_return_value, __pyx_k_return_value, sizeof(__pyx_k_return_value), 0, 1, 0, 1},
  {&__pyx_n_s_return_values, __pyx_k_return_values, sizeof(__pyx_k_return_values), 0, 0, 1, 1},
  {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1},
  {&__pyx_n_u_reversed_2, __pyx_k_reversed_2, sizeof(__pyx_k_reversed_2), 0, 1, 0, 1},
  {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1},
  {&__pyx_n_s_rsplit, __pyx_k_rsplit, sizeof(__pyx_k_rsplit), 0, 0, 1, 1},
  {&__pyx_n_s_rstrip, __pyx_k_rstrip, sizeof(__pyx_k_rstrip), 0, 0, 1, 1},
  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
  {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
  {&__pyx_kp_u_s_await_not_found, __pyx_k_s_await_not_found, sizeof(__pyx_k_s_await_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_s_call_not_found, __pyx_k_s_call_not_found, sizeof(__pyx_k_s_call_not_found), 0, 1, 0, 0},
  {&__pyx_kp_u_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 1, 0, 0},
  {&__pyx_n_s_safe_repr, __pyx_k_safe_repr, sizeof(__pyx_k_safe_repr), 0, 0, 1, 1},
  {&__pyx_n_s_safe_super, __pyx_k_safe_super, sizeof(__pyx_k_safe_super), 0, 0, 1, 1},
  {&__pyx_n_s_seal, __pyx_k_seal, sizeof(__pyx_k_seal), 0, 0, 1, 1},
  {&__pyx_n_u_seal, __pyx_k_seal, sizeof(__pyx_k_seal), 0, 1, 0, 1},
  {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_self_args, __pyx_k_self_args, sizeof(__pyx_k_self_args), 0, 0, 1, 1},
  {&__pyx_n_s_self_kwargs, __pyx_k_self_kwargs, sizeof(__pyx_k_self_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_self_name, __pyx_k_self_name, sizeof(__pyx_k_self_name), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_sentinel, __pyx_k_sentinel, sizeof(__pyx_k_sentinel), 0, 0, 1, 1},
  {&__pyx_n_u_sentinel, __pyx_k_sentinel, sizeof(__pyx_k_sentinel), 0, 1, 0, 1},
  {&__pyx_kp_u_sentinel_s, __pyx_k_sentinel_s, sizeof(__pyx_k_sentinel_s), 0, 1, 0, 0},
  {&__pyx_n_s_sentinels, __pyx_k_sentinels, sizeof(__pyx_k_sentinels), 0, 0, 1, 1},
  {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
  {&__pyx_n_s_set_2, __pyx_k_set_2, sizeof(__pyx_k_set_2), 0, 0, 1, 1},
  {&__pyx_n_u_set_2, __pyx_k_set_2, sizeof(__pyx_k_set_2), 0, 1, 0, 1},
  {&__pyx_n_s_set_return_value, __pyx_k_set_return_value, sizeof(__pyx_k_set_return_value), 0, 0, 1, 1},
  {&__pyx_n_s_set_return_value_2, __pyx_k_set_return_value_2, sizeof(__pyx_k_set_return_value_2), 0, 0, 1, 1},
  {&__pyx_n_s_set_side_effect, __pyx_k_set_side_effect, sizeof(__pyx_k_set_side_effect), 0, 0, 1, 1},
  {&__pyx_n_s_set_signature, __pyx_k_set_signature, sizeof(__pyx_k_set_signature), 0, 0, 1, 1},
  {&__pyx_n_s_set_signature_locals_checksig, __pyx_k_set_signature_locals_checksig, sizeof(__pyx_k_set_signature_locals_checksig), 0, 0, 1, 1},
  {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1},
  {&__pyx_n_u_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 1, 0, 1},
  {&__pyx_n_s_setdefault, __pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 0, 1, 1},
  {&__pyx_n_u_setformat, __pyx_k_setformat, sizeof(__pyx_k_setformat), 0, 1, 0, 1},
  {&__pyx_n_u_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 1, 0, 1},
  {&__pyx_n_s_setup_async_mock, __pyx_k_setup_async_mock, sizeof(__pyx_k_setup_async_mock), 0, 0, 1, 1},
  {&__pyx_n_s_setup_async_mock_locals_wrapper, __pyx_k_setup_async_mock_locals_wrapper, sizeof(__pyx_k_setup_async_mock_locals_wrapper), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func, __pyx_k_setup_func, sizeof(__pyx_k_setup_func), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func_locals_assert_any_ca, __pyx_k_setup_func_locals_assert_any_ca, sizeof(__pyx_k_setup_func_locals_assert_any_ca), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func_locals_assert_called, __pyx_k_setup_func_locals_assert_called, sizeof(__pyx_k_setup_func_locals_assert_called), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func_locals_assert_called_2, __pyx_k_setup_func_locals_assert_called_2, sizeof(__pyx_k_setup_func_locals_assert_called_2), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func_locals_assert_called_3, __pyx_k_setup_func_locals_assert_called_3, sizeof(__pyx_k_setup_func_locals_assert_called_3), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func_locals_assert_called_4, __pyx_k_setup_func_locals_assert_called_4, sizeof(__pyx_k_setup_func_locals_assert_called_4), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func_locals_assert_has_ca, __pyx_k_setup_func_locals_assert_has_ca, sizeof(__pyx_k_setup_func_locals_assert_has_ca), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func_locals_assert_not_ca, __pyx_k_setup_func_locals_assert_not_ca, sizeof(__pyx_k_setup_func_locals_assert_not_ca), 0, 0, 1, 1},
  {&__pyx_n_s_setup_func_locals_reset_mock, __pyx_k_setup_func_locals_reset_mock, sizeof(__pyx_k_setup_func_locals_reset_mock), 0, 0, 1, 1},
  {&__pyx_n_s_sf, __pyx_k_sf, sizeof(__pyx_k_sf), 0, 0, 1, 1},
  {&__pyx_n_s_side_effect, __pyx_k_side_effect, sizeof(__pyx_k_side_effect), 0, 0, 1, 1},
  {&__pyx_n_u_side_effect, __pyx_k_side_effect, sizeof(__pyx_k_side_effect), 0, 1, 0, 1},
  {&__pyx_n_s_side_effect_methods, __pyx_k_side_effect_methods, sizeof(__pyx_k_side_effect_methods), 0, 0, 1, 1},
  {&__pyx_n_s_side_effector, __pyx_k_side_effector, sizeof(__pyx_k_side_effector), 0, 0, 1, 1},
  {&__pyx_n_s_sig, __pyx_k_sig, sizeof(__pyx_k_sig), 0, 0, 1, 1},
  {&__pyx_n_s_sig_func, __pyx_k_sig_func, sizeof(__pyx_k_sig_func), 0, 0, 1, 1},
  {&__pyx_n_s_signature, __pyx_k_signature, sizeof(__pyx_k_signature), 0, 0, 1, 1},
  {&__pyx_n_s_signature_2, __pyx_k_signature_2, sizeof(__pyx_k_signature_2), 0, 0, 1, 1},
  {&__pyx_n_s_sizeof, __pyx_k_sizeof, sizeof(__pyx_k_sizeof), 0, 0, 1, 1},
  {&__pyx_n_u_sizeof, __pyx_k_sizeof, sizeof(__pyx_k_sizeof), 0, 1, 0, 1},
  {&__pyx_n_s_skipfirst, __pyx_k_skipfirst, sizeof(__pyx_k_skipfirst), 0, 0, 1, 1},
  {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1},
  {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
  {&__pyx_n_u_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 0, 1},
  {&__pyx_n_s_spec_arg, __pyx_k_spec_arg, sizeof(__pyx_k_spec_arg), 0, 0, 1, 1},
  {&__pyx_n_s_spec_as_instance, __pyx_k_spec_as_instance, sizeof(__pyx_k_spec_as_instance), 0, 0, 1, 1},
  {&__pyx_n_u_spec_as_instance, __pyx_k_spec_as_instance, sizeof(__pyx_k_spec_as_instance), 0, 1, 0, 1},
  {&__pyx_n_s_spec_asyncs, __pyx_k_spec_asyncs, sizeof(__pyx_k_spec_asyncs), 0, 0, 1, 1},
  {&__pyx_n_u_spec_asyncs, __pyx_k_spec_asyncs, sizeof(__pyx_k_spec_asyncs), 0, 1, 0, 1},
  {&__pyx_n_s_spec_class, __pyx_k_spec_class, sizeof(__pyx_k_spec_class), 0, 0, 1, 1},
  {&__pyx_n_u_spec_class, __pyx_k_spec_class, sizeof(__pyx_k_spec_class), 0, 1, 0, 1},
  {&__pyx_kp_u_spec_r, __pyx_k_spec_r, sizeof(__pyx_k_spec_r), 0, 1, 0, 0},
  {&__pyx_n_s_spec_set, __pyx_k_spec_set, sizeof(__pyx_k_spec_set), 0, 0, 1, 1},
  {&__pyx_n_u_spec_set, __pyx_k_spec_set, sizeof(__pyx_k_spec_set), 0, 1, 0, 1},
  {&__pyx_n_s_spec_set_2, __pyx_k_spec_set_2, sizeof(__pyx_k_spec_set_2), 0, 0, 1, 1},
  {&__pyx_n_u_spec_set_2, __pyx_k_spec_set_2, sizeof(__pyx_k_spec_set_2), 0, 1, 0, 1},
  {&__pyx_kp_u_spec_set_r, __pyx_k_spec_set_r, sizeof(__pyx_k_spec_set_r), 0, 1, 0, 0},
  {&__pyx_n_s_spec_signature, __pyx_k_spec_signature, sizeof(__pyx_k_spec_signature), 0, 0, 1, 1},
  {&__pyx_n_u_spec_signature, __pyx_k_spec_signature, sizeof(__pyx_k_spec_signature), 0, 1, 0, 1},
  {&__pyx_n_s_spec_state, __pyx_k_spec_state, sizeof(__pyx_k_spec_state), 0, 0, 1, 1},
  {&__pyx_n_s_spec_string, __pyx_k_spec_string, sizeof(__pyx_k_spec_string), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_src, __pyx_k_src, sizeof(__pyx_k_src), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_stopall, __pyx_k_stopall, sizeof(__pyx_k_stopall), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_u_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 1, 0, 1},
  {&__pyx_n_s_sub_list, __pyx_k_sub_list, sizeof(__pyx_k_sub_list), 0, 0, 1, 1},
  {&__pyx_n_u_subclasscheck, __pyx_k_subclasscheck, sizeof(__pyx_k_subclasscheck), 0, 1, 0, 1},
  {&__pyx_n_u_subclasses, __pyx_k_subclasses, sizeof(__pyx_k_subclasses), 0, 1, 0, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sync_async_magics, __pyx_k_sync_async_magics, sizeof(__pyx_k_sync_async_magics), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_temp_original, __pyx_k_temp_original, sizeof(__pyx_k_temp_original), 0, 0, 1, 1},
  {&__pyx_n_u_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 1, 0, 1},
  {&__pyx_n_s_test_2, __pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 0, 1, 1},
  {&__pyx_n_u_text_signature, __pyx_k_text_signature, sizeof(__pyx_k_text_signature), 0, 1, 0, 1},
  {&__pyx_n_s_the_name, __pyx_k_the_name, sizeof(__pyx_k_the_name), 0, 0, 1, 1},
  {&__pyx_n_s_these_magics, __pyx_k_these_magics, sizeof(__pyx_k_these_magics), 0, 0, 1, 1},
  {&__pyx_n_s_thing, __pyx_k_thing, sizeof(__pyx_k_thing), 0, 0, 1, 1},
  {&__pyx_n_s_this_mock_call, __pyx_k_this_mock_call, sizeof(__pyx_k_this_mock_call), 0, 0, 1, 1},
  {&__pyx_n_s_this_patcher, __pyx_k_this_patcher, sizeof(__pyx_k_this_patcher), 0, 0, 1, 1},
  {&__pyx_n_s_this_spec, __pyx_k_this_spec, sizeof(__pyx_k_this_spec), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_kp_u_times, __pyx_k_times, sizeof(__pyx_k_times), 0, 1, 0, 0},
  {&__pyx_kp_u_to_be_called_once_Called, __pyx_k_to_be_called_once_Called, sizeof(__pyx_k_to_be_called_once_Called), 0, 1, 0, 0},
  {&__pyx_kp_u_to_have_been_awaited, __pyx_k_to_have_been_awaited, sizeof(__pyx_k_to_have_been_awaited), 0, 1, 0, 0},
  {&__pyx_kp_u_to_have_been_awaited_once_Await, __pyx_k_to_have_been_awaited_once_Await, sizeof(__pyx_k_to_have_been_awaited_once_Await), 0, 1, 0, 0},
  {&__pyx_kp_u_to_have_been_called_once_Called, __pyx_k_to_have_been_called_once_Called, sizeof(__pyx_k_to_have_been_called_once_Called), 0, 1, 0, 0},
  {&__pyx_kp_u_to_not_have_been_awaited_Awaite, __pyx_k_to_not_have_been_awaited_Awaite, sizeof(__pyx_k_to_not_have_been_awaited_Awaite), 0, 1, 0, 0},
  {&__pyx_kp_u_to_not_have_been_called_Called, __pyx_k_to_not_have_been_called_Called, sizeof(__pyx_k_to_not_have_been_called_Called), 0, 1, 0, 0},
  {&__pyx_n_s_to_stream, __pyx_k_to_stream, sizeof(__pyx_k_to_stream), 0, 0, 1, 1},
  {&__pyx_n_s_try_iter, __pyx_k_try_iter, sizeof(__pyx_k_try_iter), 0, 0, 1, 1},
  {&__pyx_n_s_two, __pyx_k_two, sizeof(__pyx_k_two), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
  {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1},
  {&__pyx_n_s_unittest_util, __pyx_k_unittest_util, sizeof(__pyx_k_unittest_util), 0, 0, 1, 1},
  {&__pyx_n_s_unpatch_dict, __pyx_k_unpatch_dict, sizeof(__pyx_k_unpatch_dict), 0, 0, 1, 1},
  {&__pyx_n_s_unsafe, __pyx_k_unsafe, sizeof(__pyx_k_unsafe), 0, 0, 1, 1},
  {&__pyx_n_s_unsupported_magics, __pyx_k_unsupported_magics, sizeof(__pyx_k_unsupported_magics), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {&__pyx_n_s_vals, __pyx_k_vals, sizeof(__pyx_k_vals), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_visited, __pyx_k_visited, sizeof(__pyx_k_visited), 0, 0, 1, 1},
  {&__pyx_n_s_with_traceback, __pyx_k_with_traceback, sizeof(__pyx_k_with_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1},
  {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 50, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 281, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 545, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 1958, __pyx_L1_error)
  __pyx_builtin_BaseException = __Pyx_GetBuiltinName(__pyx_n_s_BaseException); if (!__pyx_builtin_BaseException) __PYX_ERR(0, 75, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 105, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 113, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 146, __pyx_L1_error)
  __pyx_builtin_classmethod = __Pyx_GetBuiltinName(__pyx_n_s_classmethod); if (!__pyx_builtin_classmethod) __PYX_ERR(0, 146, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 351, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 588, __pyx_L1_error)
  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 623, __pyx_L1_error)
  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 694, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 865, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 878, __pyx_L1_error)
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 1221, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 1384, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 2164, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 2627, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 2820, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "cymock.pyx":123
 *         return
 *     func, sig = sig
 *     def checksig(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 */
  __pyx_tuple__2 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);
  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_checksig, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 123, __pyx_L1_error)

  /* "cymock.pyx":134
 *     # expose original attributes that should be mocked
 *     for attribute in (
 *         '__name__', '__doc__', '__text_signature__',             # <<<<<<<<<<<<<<
 *         '__module__', '__defaults__', '__kwdefaults__',
 *     ):
 */
  __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_u_name, __pyx_n_u_doc, __pyx_n_u_text_signature, __pyx_n_u_module, __pyx_n_u_defaults, __pyx_n_u_kwdefaults); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "cymock.pyx":184
 *         return mock
 *     func, sig = result
 *     def checksig(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         sig.bind(*args, **kwargs)
 *     _copy_func_details(func, checksig)
 */
  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);
  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_checksig, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 184, __pyx_L1_error)

  /* "cymock.pyx":204
 *     funcopy.mock = mock
 * 
 *     def assert_called_with(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):
 */
  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);
  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_called_with, 204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 204, __pyx_L1_error)

  /* "cymock.pyx":206
 *     def assert_called_with(*args, **kwargs):
 *         return mock.assert_called_with(*args, **kwargs)
 *     def assert_called(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):
 */
  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);
  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_called, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 206, __pyx_L1_error)

  /* "cymock.pyx":208
 *     def assert_called(*args, **kwargs):
 *         return mock.assert_called(*args, **kwargs)
 *     def assert_not_called(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_not_called, 208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 208, __pyx_L1_error)

  /* "cymock.pyx":210
 *     def assert_not_called(*args, **kwargs):
 *         return mock.assert_not_called(*args, **kwargs)
 *     def assert_called_once(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):
 */
  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_called_once, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 210, __pyx_L1_error)

  /* "cymock.pyx":212
 *     def assert_called_once(*args, **kwargs):
 *         return mock.assert_called_once(*args, **kwargs)
 *     def assert_called_once_with(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):
 */
  __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);
  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_called_once_with, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 212, __pyx_L1_error)

  /* "cymock.pyx":214
 *     def assert_called_once_with(*args, **kwargs):
 *         return mock.assert_called_once_with(*args, **kwargs)
 *     def assert_has_calls(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):
 */
  __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_has_calls, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 214, __pyx_L1_error)

  /* "cymock.pyx":216
 *     def assert_has_calls(*args, **kwargs):
 *         return mock.assert_has_calls(*args, **kwargs)
 *     def assert_any_call(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():
 */
  __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_any_call, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 216, __pyx_L1_error)

  /* "cymock.pyx":218
 *     def assert_any_call(*args, **kwargs):
 *         return mock.assert_any_call(*args, **kwargs)
 *     def reset_mock():             # <<<<<<<<<<<<<<
 *         funcopy.method_calls = _CallList()
 *         funcopy.mock_calls = _CallList()
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);
  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 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_cymock_pyx, __pyx_n_s_reset_mock, 218, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 218, __pyx_L1_error)

  /* "cymock.pyx":259
 *     # to a function and then the corresponding mock helper function
 *     # is called when the helper is accessed similar to _setup_func.
 *     def wrapper(attr, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return getattr(mock.mock, attr)(*args, **kwargs)
 * 
 */
  __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_attr, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);
  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_wrapper, 259, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 259, __pyx_L1_error)

  /* "cymock.pyx":262
 *         return getattr(mock.mock, attr)(*args, **kwargs)
 * 
 *     for attribute in ('assert_awaited',             # <<<<<<<<<<<<<<
 *                       'assert_awaited_once',
 *                       'assert_awaited_with',
 */
  __pyx_tuple__25 = PyTuple_Pack(7, __pyx_n_u_assert_awaited, __pyx_n_u_assert_awaited_once, __pyx_n_u_assert_awaited_with, __pyx_n_u_assert_awaited_once_with, __pyx_n_u_assert_any_await, __pyx_n_u_assert_has_awaits, __pyx_n_u_assert_not_awaited); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "cymock.pyx":278
 * 
 * def _is_magic(name):
 *     return '__%s__' % name[2:-2] == name             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__26 = PySlice_New(__pyx_int_2, __pyx_int_neg_2, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__26);
  __Pyx_GIVEREF(__pyx_slice__26);

  /* "cymock.pyx":325
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 *     def _get(self, name=name, _the_name=_the_name):             # <<<<<<<<<<<<<<
 *         sig = self._mock_delegate
 *         if sig is None:
 */
  __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_the_name, __pyx_n_s_sig); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_2, 325, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 325, __pyx_L1_error)

  /* "cymock.pyx":330
 *             return getattr(self, _the_name)
 *         return getattr(sig, name)
 *     def _set(self, value, name=name, _the_name=_the_name):             # <<<<<<<<<<<<<<
 *         sig = self._mock_delegate
 *         if sig is None:
 */
  __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_name_2, __pyx_n_s_the_name, __pyx_n_s_sig); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_set, 330, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 330, __pyx_L1_error)

  /* "cymock.pyx":645
 *             raise AttributeError(name)
 *         if not self._mock_unsafe:
 *             if name.startswith(('assert', 'assret')):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Attributes cannot start with 'assert' "
 *                                      "or 'assret'")
 */
  __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_u_assert, __pyx_n_u_assret); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "cymock.pyx":646
 *         if not self._mock_unsafe:
 *             if name.startswith(('assert', 'assret')):
 *                 raise AttributeError("Attributes cannot start with 'assert' "             # <<<<<<<<<<<<<<
 *                                      "or 'assret'")
 * 
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_Attributes_cannot_start_with_ass); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "cymock.pyx":826
 * 
 *         sig = None
 *         names = name.replace('()', '').split('.')             # <<<<<<<<<<<<<<
 *         children = self._mock_children
 * 
 */
  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_kp_u__32, __pyx_kp_u__31); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "cymock.pyx":910
 *             raise AssertionError(error_message)
 * 
 *         def _error_message():             # <<<<<<<<<<<<<<
 *             msg = self._format_mock_failure_message(args, kwargs)
 *             return msg
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);
  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_error_message, 910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 910, __pyx_L1_error)

  /* "cymock.pyx":1252
 *         if new_callable is not None:
 *             if new is not DEFAULT:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "Cannot use 'new' and 'new_callable' together"
 *                 )
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_Cannot_use_new_and_new_callable); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "cymock.pyx":1256
 *                 )
 *             if autospec is not None:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "Cannot use 'autospec' and 'new_callable' together"
 *                 )
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_Cannot_use_autospec_and_new_call); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "cymock.pyx":1349
 *         @wraps(func)
 *         def patched(*args, **keywargs):
 *             with self.decoration_helper(patched,             # <<<<<<<<<<<<<<
 *                                         args,
 *                                         keywargs) as (newargs, newkeywargs):
 */
  __pyx_tuple__48 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "cymock.pyx":1348
 * 
 *         @wraps(func)
 *         def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */
  __pyx_tuple__49 = PyTuple_Pack(4, __pyx_n_s_args, __pyx_n_s_keywargs, __pyx_n_s_newargs, __pyx_n_s_newkeywargs); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_patched, 1348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 1348, __pyx_L1_error)

  /* "cymock.pyx":1365
 * 
 *         @wraps(func)
 *         async def patched(*args, **keywargs):             # <<<<<<<<<<<<<<
 *             with self.decoration_helper(patched,
 *                                         args,
 */
  __pyx_tuple__51 = PyTuple_Pack(4, __pyx_n_s_args, __pyx_n_s_keywargs, __pyx_n_s_newargs, __pyx_n_s_newkeywargs); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_patched, 1365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 1365, __pyx_L1_error)

  /* "cymock.pyx":1415
 * 
 *         if spec is not None and autospec is not None:
 *             raise TypeError("Can't specify spec and autospec")             # <<<<<<<<<<<<<<
 *         if ((spec is not None or autospec is not None) and
 *             spec_set not in (True, None)):
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_u_Can_t_specify_spec_and_autospec); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 1415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "cymock.pyx":1418
 *         if ((spec is not None or autospec is not None) and
 *             spec_set not in (True, None)):
 *             raise TypeError("Can't provide explicit spec_set *and* spec or autospec")             # <<<<<<<<<<<<<<
 * 
 *         original, local = self.get_original()
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_u_Can_t_provide_explicit_spec_set); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "cymock.pyx":1439
 *             if spec is not None or spec_set is not None:
 *                 if original is DEFAULT:
 *                     raise TypeError("Can't use 'spec' with create=True")             # <<<<<<<<<<<<<<
 *                 if isinstance(original, type):
 *                     # If we're patching out a class and there is a spec
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_u_Can_t_use_spec_with_create_True); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "cymock.pyx":1494
 *             # is a bool?
 *             if new is not DEFAULT:
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     "autospec creates the mock for you. Can't specify "
 *                     "autospec and new."
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_u_autospec_creates_the_mock_for_yo); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 1494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "cymock.pyx":1499
 *                 )
 *             if original is DEFAULT:
 *                 raise TypeError("Can't use 'autospec' with create=True")             # <<<<<<<<<<<<<<
 *             spec_set = bool(spec_set)
 *             if autospec is True:
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_u_Can_t_use_autospec_with_create_T); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "cymock.pyx":1509
 *             # can't set keyword args when we aren't creating the mock
 *             # XXXX If new is a Mock we could call new.configure_mock(**kwargs)
 *             raise TypeError("Can't pass kwargs to a mock we aren't creating")             # <<<<<<<<<<<<<<
 * 
 *         new_attr = new
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_u_Can_t_pass_kwargs_to_a_mock_we_a); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "cymock.pyx":1574
 * def _get_target(target):
 *     try:
 *         target, attribute = target.rsplit('.', 1)             # <<<<<<<<<<<<<<
 *     except (TypeError, ValueError):
 *         raise TypeError("Need a valid target to patch. You supplied: %r" %
 */
  __pyx_tuple__59 = PyTuple_Pack(2, __pyx_kp_u__33, __pyx_int_1); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "cymock.pyx":1639
 * 
 *     if not kwargs:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             'Must supply at least one keyword argument with patch.multiple'
 *         )
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_u_Must_supply_at_least_one_keyword); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "cymock.pyx":1788
 *             return self.decorate_class(f)
 *         @wraps(f)
 *         def _inner(*args, **kw):             # <<<<<<<<<<<<<<
 *             self._patch_dict()
 *             try:
 */
  __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 1788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_inner, 1788, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 1788, __pyx_L1_error)

  /* "cymock.pyx":1923
 * def _get_method(name, func):
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         return func(self, *args, **kw)
 *     method.__name__ = name
 */
  __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_method, 1923, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 1923, __pyx_L1_error)

  /* "cymock.pyx":1975
 * 
 * def _get_eq(self):
 *     def __eq__(other):             # <<<<<<<<<<<<<<
 *         ret_val = self.__eq__._mock_return_value
 *         if ret_val is not DEFAULT:
 */
  __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_other, __pyx_n_s_ret_val); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_eq, 1975, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1975, __pyx_L1_error)

  /* "cymock.pyx":1985
 * 
 * def _get_ne(self):
 *     def __ne__(other):             # <<<<<<<<<<<<<<
 *         if self.__ne__._mock_return_value is not DEFAULT:
 *             return DEFAULT
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_other); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_ne, 1985, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1985, __pyx_L1_error)

  /* "cymock.pyx":1994
 * 
 * def _get_iter(self):
 *     def __iter__():             # <<<<<<<<<<<<<<
 *         ret_val = self.__iter__._mock_return_value
 *         if ret_val is DEFAULT:
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_ret_val); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_iter, 1994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1994, __pyx_L1_error)

  /* "cymock.pyx":2004
 * 
 * def _get_async_iter(self):
 *     def __aiter__():             # <<<<<<<<<<<<<<
 *         ret_val = self.__aiter__._mock_return_value
 *         if ret_val is DEFAULT:
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_s_ret_val); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_aiter, 2004, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 2004, __pyx_L1_error)

  /* "cymock.pyx":2213
 *             raise AssertionError(f'Expected await: {expected}\nNot awaited')
 * 
 *         def _error_message():             # <<<<<<<<<<<<<<
 *             msg = self._format_mock_failure_message(args, kwargs, action='await')
 *             return msg
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);
  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_error_message, 2213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 2213, __pyx_L1_error)

  /* "cymock.pyx":2627
 *     elif is_async_func:
 *         if instance:
 *             raise RuntimeError("Instance can not be True when create_autospec "             # <<<<<<<<<<<<<<
 *                                "is mocking an async function")
 *         Klass = AsyncMock
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_u_Instance_can_not_be_True_when_cr); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 2627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "cymock.pyx":2787
 *     _state = [_read_data, None]
 * 
 *     def _readlines_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         if handle.readlines.return_value is not None:
 *             return handle.readlines.return_value
 */
  __pyx_tuple__80 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_readlines_side_effect, 2787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 2787, __pyx_L1_error)

  /* "cymock.pyx":2792
 *         return _state[0].readlines(*args, **kwargs)
 * 
 *     def _read_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         if handle.read.return_value is not None:
 *             return handle.read.return_value
 */
  __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 2792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_read_side_effect, 2792, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 2792, __pyx_L1_error)

  /* "cymock.pyx":2797
 *         return _state[0].read(*args, **kwargs)
 * 
 *     def _readline_side_effect(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         yield from _iter_side_effect()
 *         while True:
 */
  __pyx_tuple__84 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 2797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_readline_side_effect, 2797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 2797, __pyx_L1_error)

  /* "cymock.pyx":2802
 *             yield _state[0].readline(*args, **kwargs)
 * 
 *     def _iter_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             while True:
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_line); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 2802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_iter_side_effect, 2802, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 2802, __pyx_L1_error)

  /* "cymock.pyx":2809
 *             yield line
 * 
 *     def _next_side_effect():             # <<<<<<<<<<<<<<
 *         if handle.readline.return_value is not None:
 *             return handle.readline.return_value
 */
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_next_side_effect, 2809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 2809, __pyx_L1_error)

  /* "cymock.pyx":2837
 *     handle.__next__.side_effect = _next_side_effect
 * 
 *     def reset_data(*args, **kwargs):             # <<<<<<<<<<<<<<
 *         _state[0] = _to_stream(read_data)
 *         if handle.readline.side_effect == _state[1]:
 */
  __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_reset_data, 2837, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 2837, __pyx_L1_error)

  /* "cymock.pyx":12
 * 
 * __all__ = (
 *     'Mock',             # <<<<<<<<<<<<<<
 *     'MagicMock',
 *     'patch',
 */
  __pyx_tuple__92 = PyTuple_Pack(15, __pyx_n_u_Mock, __pyx_n_u_MagicMock, __pyx_n_u_patch_2, __pyx_n_u_sentinel, __pyx_n_u_DEFAULT, __pyx_n_u_ANY_2, __pyx_n_u_call_2, __pyx_n_u_create_autospec, __pyx_n_u_AsyncMock, __pyx_n_u_FILTER_DIR, __pyx_n_u_NonCallableMock, __pyx_n_u_NonCallableMagicMock, __pyx_n_u_mock_open, __pyx_n_u_PropertyMock, __pyx_n_u_seal); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "cymock.pyx":52
 * _safe_super = super
 * 
 * def _is_async_obj(obj):             # <<<<<<<<<<<<<<
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
 *         return False
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_is_async_obj, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 52, __pyx_L1_error)

  /* "cymock.pyx":60
 * 
 * 
 * def _is_async_func(func):             # <<<<<<<<<<<<<<
 *     if getattr(func, '__code__', None):
 *         return asyncio.iscoroutinefunction(func)
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_func_2); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_is_async_func, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 60, __pyx_L1_error)

  /* "cymock.pyx":67
 * 
 * 
 * def _is_instance_mock(obj):             # <<<<<<<<<<<<<<
 *     # can't use isinstance on Mock objects because they override __class__
 *     # The base class for all mocks is NonCallableMock
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_is_instance_mock, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 67, __pyx_L1_error)

  /* "cymock.pyx":73
 * 
 * 
 * def _is_exception(obj):             # <<<<<<<<<<<<<<
 *     return (
 *         isinstance(obj, BaseException) or
 */
  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_is_exception, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 73, __pyx_L1_error)

  /* "cymock.pyx":80
 * 
 * 
 * def _extract_mock(obj):             # <<<<<<<<<<<<<<
 *     # Autospecced functions will return a FunctionType with "mock" attribute
 *     # which is the actual mock object that needs to be used.
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_extract_mock, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 80, __pyx_L1_error)

  /* "cymock.pyx":89
 * 
 * 
 * def _get_signature_object(func, as_instance, eat_self):             # <<<<<<<<<<<<<<
 *     """
 *     Given an arbitrary, possibly callable object, try to create a suitable
 */
  __pyx_tuple__103 = PyTuple_Pack(4, __pyx_n_s_func_2, __pyx_n_s_as_instance, __pyx_n_s_eat_self, __pyx_n_s_sig_func); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_signature_object, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 89, __pyx_L1_error)

  /* "cymock.pyx":118
 * 
 * 
 * def _check_signature(func, mock, skipfirst, instance=False):             # <<<<<<<<<<<<<<
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:
 */
  __pyx_tuple__105 = PyTuple_Pack(7, __pyx_n_s_func_2, __pyx_n_s_mock, __pyx_n_s_skipfirst, __pyx_n_s_instance, __pyx_n_s_sig, __pyx_n_s_checksig, __pyx_n_s_checksig); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_check_signature, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 118, __pyx_L1_error)

  /* "cymock.pyx":130
 * 
 * 
 * def _copy_func_details(func, funcopy):             # <<<<<<<<<<<<<<
 *     # we explicitly don't copy func.__dict__ into this copy as it would
 *     # expose original attributes that should be mocked
 */
  __pyx_tuple__107 = PyTuple_Pack(3, __pyx_n_s_func_2, __pyx_n_s_funcopy, __pyx_n_s_attribute); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_copy_func_details, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 130, __pyx_L1_error)

  /* "cymock.pyx":143
 * 
 * 
 * def _callable(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, type):
 *         return True
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_callable, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 143, __pyx_L1_error)

  /* "cymock.pyx":153
 * 
 * 
 * def _is_list(obj):             # <<<<<<<<<<<<<<
 *     # checks for list or tuples
 *     # XXXX badly named!
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_is_list, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 153, __pyx_L1_error)

  /* "cymock.pyx":159
 * 
 * 
 * def _instance_callable(obj):             # <<<<<<<<<<<<<<
 *     """Given an object, return True if the object is callable.
 *     For classes, return True if instances would be callable."""
 */
  __pyx_tuple__113 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_base); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_instance_callable, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 159, __pyx_L1_error)

  /* "cymock.pyx":174
 * 
 * 
 * def _set_signature(mock, original, instance=False):             # <<<<<<<<<<<<<<
 *     # creates a function with signature (*args, **kwargs) that delegates to a
 *     # mock. It still does signature checking by calling a lambda with the same
 */
  __pyx_tuple__115 = PyTuple_Pack(13, __pyx_n_s_mock, __pyx_n_s_original, __pyx_n_s_instance, __pyx_n_s_skipfirst, __pyx_n_s_result, __pyx_n_s_func_2, __pyx_n_s_sig, __pyx_n_s_checksig, __pyx_n_s_checksig, __pyx_n_s_name_2, __pyx_n_s_context, __pyx_n_s_src, __pyx_n_s_funcopy); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_set_signature, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 174, __pyx_L1_error)

  /* "cymock.pyx":201
 * 
 * 
 * def _setup_func(funcopy, mock, sig):             # <<<<<<<<<<<<<<
 *     funcopy.mock = mock
 * 
 */
  __pyx_tuple__117 = PyTuple_Pack(19, __pyx_n_s_funcopy, __pyx_n_s_mock, __pyx_n_s_sig, __pyx_n_s_assert_called_with, __pyx_n_s_assert_called_with, __pyx_n_s_assert_called, __pyx_n_s_assert_called, __pyx_n_s_assert_not_called, __pyx_n_s_assert_not_called, __pyx_n_s_assert_called_once, __pyx_n_s_assert_called_once, __pyx_n_s_assert_called_once_with, __pyx_n_s_assert_called_once_with, __pyx_n_s_assert_has_calls, __pyx_n_s_assert_has_calls, __pyx_n_s_assert_any_call, __pyx_n_s_assert_any_call, __pyx_n_s_reset_mock, __pyx_n_s_reset_mock); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(3, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_setup_func, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 201, __pyx_L1_error)

  /* "cymock.pyx":250
 * 
 * 
 * def _setup_async_mock(mock):             # <<<<<<<<<<<<<<
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine
 *     mock.await_count = 0
 */
  __pyx_tuple__119 = PyTuple_Pack(4, __pyx_n_s_mock, __pyx_n_s_wrapper, __pyx_n_s_wrapper, __pyx_n_s_attribute); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_setup_async_mock, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 250, __pyx_L1_error)

  /* "cymock.pyx":277
 * 
 * 
 * def _is_magic(name):             # <<<<<<<<<<<<<<
 *     return '__%s__' % name[2:-2] == name
 * 
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_is_magic, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 277, __pyx_L1_error)

  /* "cymock.pyx":281
 * 
 * 
 * class _SentinelObject(object):             # <<<<<<<<<<<<<<
 *     "A unique, named, sentinel object."
 *     def __init__(self, name):
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "cymock.pyx":283
 * class _SentinelObject(object):
 *     "A unique, named, sentinel object."
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 * 
 */
  __pyx_tuple__124 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 283, __pyx_L1_error)

  /* "cymock.pyx":286
 *         self.name = name
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel.%s' % self.name
 * 
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_repr, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 286, __pyx_L1_error)

  /* "cymock.pyx":289
 *         return 'sentinel.%s' % self.name
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel.%s' % self.name
 * 
 */
  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_reduce, 289, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 289, __pyx_L1_error)

  /* "cymock.pyx":293
 * 
 * 
 * class _Sentinel(object):             # <<<<<<<<<<<<<<
 *     """Access attributes to return a named object, usable as a sentinel."""
 *     def __init__(self):
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "cymock.pyx":295
 * class _Sentinel(object):
 *     """Access attributes to return a named object, usable as a sentinel."""
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._sentinels = {}
 * 
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);
  __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 295, __pyx_L1_error)

  /* "cymock.pyx":298
 *         self._sentinels = {}
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name == '__bases__':
 *             # Without this help(unittest.mock) raises an exception
 */
  __pyx_tuple__133 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_getattr, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 298, __pyx_L1_error)

  /* "cymock.pyx":304
 *         return self._sentinels.setdefault(name, _SentinelObject(name))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel'
 * 
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_reduce, 304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 304, __pyx_L1_error)

  /* "cymock.pyx":322
 * 
 * 
 * def _delegating_property(name):             # <<<<<<<<<<<<<<
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 */
  __pyx_tuple__137 = PyTuple_Pack(6, __pyx_n_s_name_2, __pyx_n_s_the_name, __pyx_n_s_get_2, __pyx_n_s_get_2, __pyx_n_s_set, __pyx_n_s_set); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_delegating_property, 322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 322, __pyx_L1_error)

  /* "cymock.pyx":343
 * class _CallList(list):
 * 
 *     def __contains__(self, value):             # <<<<<<<<<<<<<<
 *         if not isinstance(value, list):
 *             return list.__contains__(self, value)
 */
  __pyx_tuple__139 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_len_value, __pyx_n_s_len_self, __pyx_n_s_i, __pyx_n_s_sub_list); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);
  __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_contains, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 343, __pyx_L1_error)

  /* "cymock.pyx":357
 *         return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return pprint.pformat(list(self))
 * 
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_repr, 357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 357, __pyx_L1_error)

  /* "cymock.pyx":361
 * 
 * 
 * def _check_and_set_parent(parent, value, name, new_name):             # <<<<<<<<<<<<<<
 *     value = _extract_mock(value)
 * 
 */
  __pyx_tuple__143 = PyTuple_Pack(5, __pyx_n_s_parent, __pyx_n_s_value, __pyx_n_s_name_2, __pyx_n_s_new_name, __pyx_n_s_parent_2); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);
  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_check_and_set_parent, 361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 361, __pyx_L1_error)

  /* "cymock.pyx":388
 * 
 * # Internal class to identify if we wrapped an iterator object or not.
 * class _MockIter(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, obj):
 *         self.obj = iter(obj)
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "cymock.pyx":389
 * # Internal class to identify if we wrapped an iterator object or not.
 * class _MockIter(object):
 *     def __init__(self, obj):             # <<<<<<<<<<<<<<
 *         self.obj = iter(obj)
 *     def __next__(self):
 */
  __pyx_tuple__146 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);
  __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 389, __pyx_L1_error)

  /* "cymock.pyx":391
 *     def __init__(self, obj):
 *         self.obj = iter(obj)
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return next(self.obj)
 * 
 */
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);
  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_next, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 391, __pyx_L1_error)

  /* "cymock.pyx":394
 *         return next(self.obj)
 * 
 * class Base(object):             # <<<<<<<<<<<<<<
 *     _mock_return_value = DEFAULT
 *     _mock_side_effect = None
 */
  __pyx_tuple__150 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "cymock.pyx":397
 *     _mock_return_value = DEFAULT
 *     _mock_side_effect = None
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__151 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 397, __pyx_L1_error)

  /* "cymock.pyx":405
 *     """A non-callable version of `Mock`"""
 * 
 *     def __new__(cls, *args, **kw):             # <<<<<<<<<<<<<<
 *         # every instance has its own class
 *         # so we can create magic methods on the
 */
  __pyx_tuple__153 = PyTuple_Pack(10, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_bases_2, __pyx_n_s_sig, __pyx_n_s_bound_args, __pyx_n_s_spec_arg, __pyx_n_s_new_2, __pyx_n_s_instance, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_new, 405, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 405, __pyx_L1_error)

  /* "cymock.pyx":427
 * 
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, spec=None, wraps=None, name=None, spec_set=None,
 *             parent=None, _spec_state=None, _new_name='', _new_parent=None,
 */
  __pyx_tuple__155 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_spec, __pyx_n_s_wraps, __pyx_n_s_name_2, __pyx_n_s_spec_set, __pyx_n_s_parent, __pyx_n_s_spec_state, __pyx_n_s_new_name_2, __pyx_n_s_new_parent, __pyx_n_s_spec_as_instance, __pyx_n_s_eat_self_2, __pyx_n_s_unsafe, __pyx_n_s_kwargs, __pyx_n_s_dict); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(12, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 427, __pyx_L1_error)
  __pyx_tuple__157 = PyTuple_Pack(11, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_kp_u__31), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "cymock.pyx":472
 * 
 * 
 *     def attach_mock(self, mock, attribute):             # <<<<<<<<<<<<<<
 *         """
 *         Attach a mock as an attribute of this one, replacing its name and
 */
  __pyx_tuple__158 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_mock, __pyx_n_s_attribute, __pyx_n_s_inner_mock); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_attach_mock, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(0, 472, __pyx_L1_error)

  /* "cymock.pyx":487
 * 
 * 
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */
  __pyx_tuple__160 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_spec, __pyx_n_s_spec_set); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(0, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_mock_add_spec_2, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 487, __pyx_L1_error)
  __pyx_tuple__162 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "cymock.pyx":496
 * 
 * 
 *     def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,             # <<<<<<<<<<<<<<
 *                        _eat_self=False):
 *         _spec_class = None
 */
  __pyx_tuple__163 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_spec, __pyx_n_s_spec_set, __pyx_n_s_spec_as_instance, __pyx_n_s_eat_self_2, __pyx_n_s_spec_class, __pyx_n_s_spec_signature, __pyx_n_s_spec_asyncs, __pyx_n_s_attr, __pyx_n_s_res, __pyx_n_s_dict); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_mock_add_spec, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 496, __pyx_L1_error)
  __pyx_tuple__165 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "cymock.pyx":524
 *         __dict__['_spec_asyncs'] = _spec_asyncs
 * 
 *     def __get_return_value(self):             # <<<<<<<<<<<<<<
 *         ret = self._mock_return_value
 *         if self._mock_delegate is not None:
 */
  __pyx_tuple__166 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_return_value, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(0, 524, __pyx_L1_error)

  /* "cymock.pyx":537
 * 
 * 
 *     def __set_return_value(self, value):             # <<<<<<<<<<<<<<
 *         if self._mock_delegate is not None:
 *             self._mock_delegate.return_value = value
 */
  __pyx_tuple__168 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);
  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_set_return_value_2, 537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(0, 537, __pyx_L1_error)

  /* "cymock.pyx":550
 * 
 *     @property
 *     def __class__(self):             # <<<<<<<<<<<<<<
 *         if self._spec_class is None:
 *             return type(self)
 */
  __pyx_tuple__170 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_class, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 550, __pyx_L1_error)

  /* "cymock.pyx":562
 * 
 * 
 *     def __get_side_effect(self):             # <<<<<<<<<<<<<<
 *         delegated = self._mock_delegate
 *         if delegated is None:
 */
  __pyx_tuple__172 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_delegated, __pyx_n_s_sf); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_side_effect, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(0, 562, __pyx_L1_error)

  /* "cymock.pyx":573
 *         return sf
 * 
 *     def __set_side_effect(self, value):             # <<<<<<<<<<<<<<
 *         value = _try_iter(value)
 *         delegated = self._mock_delegate
 */
  __pyx_tuple__174 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_delegated); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);
  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_set_side_effect, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(0, 573, __pyx_L1_error)

  /* "cymock.pyx":584
 * 
 * 
 *     def reset_mock(self,  visited=None,*, return_value=False, side_effect=False):             # <<<<<<<<<<<<<<
 *         "Restore the mock object to its initial state."
 *         if visited is None:
 */
  __pyx_tuple__176 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_visited, __pyx_n_s_return_value, __pyx_n_s_side_effect, __pyx_n_s_child, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(2, 2, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_reset_mock, 584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 584, __pyx_L1_error)
  __pyx_tuple__178 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "cymock.pyx":614
 * 
 * 
 *     def configure_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """Set attributes on the mock through keyword arguments.
 * 
 */
  __pyx_tuple__179 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_kwargs, __pyx_n_s_arg, __pyx_n_s_val, __pyx_n_s_args, __pyx_n_s_final, __pyx_n_s_obj, __pyx_n_s_entry); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_configure_mock, 614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 614, __pyx_L1_error)

  /* "cymock.pyx":636
 * 
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name in {'_mock_methods', '_mock_unsafe'}:
 *             raise AttributeError(name)
 */
  __pyx_tuple__181 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_result, __pyx_n_s_wraps); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_getattr, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 636, __pyx_L1_error)

  /* "cymock.pyx":675
 * 
 * 
 *     def _extract_mock_name(self):             # <<<<<<<<<<<<<<
 *         _name_list = [self._mock_new_name]
 *         _parent = self._mock_new_parent
 */
  __pyx_tuple__183 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_name_list, __pyx_n_s_parent_2, __pyx_n_s_last, __pyx_n_s_dot, __pyx_n_s_first); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_extract_mock_name, 675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 675, __pyx_L1_error)

  /* "cymock.pyx":702
 *         return ''.join(_name_list)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         name = self._extract_mock_name()
 * 
 */
  __pyx_tuple__185 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_name_string, __pyx_n_s_spec_string); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_repr, 702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 702, __pyx_L1_error)

  /* "cymock.pyx":723
 * 
 * 
 *     def __dir__(self):             # <<<<<<<<<<<<<<
 *         """Filter the output of `dir(mock)` to only useful members."""
 *         if not FILTER_DIR:
 */
  __pyx_tuple__187 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_extras, __pyx_n_s_from_type, __pyx_n_s_from_dict, __pyx_n_s_from_child_mocks, __pyx_n_s_m_name, __pyx_n_s_m_value, __pyx_n_s_e, __pyx_n_s_e); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_dir, 723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 723, __pyx_L1_error)

  /* "cymock.pyx":741
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         if name in _allowed_names:
 *             # property setters go through here
 */
  __pyx_tuple__189 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_msg, __pyx_n_s_original, __pyx_n_s_mock_name_2); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_setattr, 741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 741, __pyx_L1_error)

  /* "cymock.pyx":780
 * 
 * 
 *     def __delattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name in _all_magics and name in type(self).__dict__:
 *             delattr(type(self), name)
 */
  __pyx_tuple__191 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_delattr, 780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 780, __pyx_L1_error)

  /* "cymock.pyx":798
 * 
 * 
 *     def _format_mock_call_signature(self, args, kwargs):             # <<<<<<<<<<<<<<
 *         name = self._mock_name or 'mock'
 *         return _format_call_signature(name, args, kwargs)
 */
  __pyx_tuple__193 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_format_mock_call_signature, 798, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 798, __pyx_L1_error)

  /* "cymock.pyx":803
 * 
 * 
 *     def _format_mock_failure_message(self, args, kwargs, action='call'):             # <<<<<<<<<<<<<<
 *         message = 'expected %s not found.\nExpected: %s\nActual: %s'
 *         expected_string = self._format_mock_call_signature(args, kwargs)
 */
  __pyx_tuple__195 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_action, __pyx_n_s_message, __pyx_n_s_expected_string, __pyx_n_s_call_args, __pyx_n_s_actual_string); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_format_mock_failure_message, 803, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 803, __pyx_L1_error)
  __pyx_tuple__197 = PyTuple_Pack(1, ((PyObject*)__pyx_n_u_call_2)); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "cymock.pyx":811
 * 
 * 
 *     def _get_call_signature_from_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         * If call objects are asserted against a method/function like obj.meth1
 */
  __pyx_tuple__198 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_sig, __pyx_n_s_names, __pyx_n_s_children, __pyx_n_s_child); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_call_signature_from_name, 811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 811, __pyx_L1_error)

  /* "cymock.pyx":844
 * 
 * 
 *     def _call_matcher(self, _call):             # <<<<<<<<<<<<<<
 *         """
 *         Given a call (or simply an (args, kwargs) tuple), return a
 */
  __pyx_tuple__200 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_call_3, __pyx_n_s_sig, __pyx_n_s_name_2, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_e); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_call_matcher, 844, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 844, __pyx_L1_error)

  /* "cymock.pyx":870
 *             return _call
 * 
 *     def assert_not_called(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was never called.
 *         """
 */
  __pyx_tuple__202 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_not_called, 870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 870, __pyx_L1_error)

  /* "cymock.pyx":880
 *             raise AssertionError(msg)
 * 
 *     def assert_called(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called at least once
 *         """
 */
  __pyx_tuple__204 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_called, 880, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 880, __pyx_L1_error)

  /* "cymock.pyx":888
 *             raise AssertionError(msg)
 * 
 *     def assert_called_once(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called only once.
 *         """
 */
  __pyx_tuple__206 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_called_once, 888, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 888, __pyx_L1_error)

  /* "cymock.pyx":898
 *             raise AssertionError(msg)
 * 
 *     def assert_called_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the last call was made with the specified arguments.
 * 
 */
  __pyx_tuple__208 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_expected, __pyx_n_s_actual, __pyx_n_s_error_message_2, __pyx_n_s_error_message, __pyx_n_s_error_message, __pyx_n_s_cause); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_called_with, 898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 898, __pyx_L1_error)

  /* "cymock.pyx":920
 * 
 * 
 *     def assert_called_once_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called exactly once and that that call was
 *         with the specified arguments."""
 */
  __pyx_tuple__210 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_called_once_with, 920, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 920, __pyx_L1_error)

  /* "cymock.pyx":932
 * 
 * 
 *     def assert_has_calls(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified calls.
 *         The `mock_calls` list is checked for the calls.
 */
  __pyx_tuple__212 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_calls, __pyx_n_s_any_order, __pyx_n_s_expected, __pyx_n_s_cause, __pyx_n_s_all_calls, __pyx_n_s_problem, __pyx_n_s_not_found, __pyx_n_s_kall, __pyx_n_s_c, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_e); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_has_calls, 932, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 932, __pyx_L1_error)
  __pyx_tuple__214 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);

  /* "cymock.pyx":977
 * 
 * 
 *     def assert_any_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified arguments.
 * 
 */
  __pyx_tuple__215 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_expected, __pyx_n_s_actual, __pyx_n_s_cause, __pyx_n_s_expected_string, __pyx_n_s_c); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_any_call, 977, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 977, __pyx_L1_error)

  /* "cymock.pyx":993
 * 
 * 
 *     def _get_child_mock(self, **kw):             # <<<<<<<<<<<<<<
 *         """Create the child mocks for attributes and return value.
 *         By default child mocks will be the same type as the parent.
 */
  __pyx_tuple__217 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_kw, __pyx_n_s_new_name_2, __pyx_n_s_type, __pyx_n_s_klass, __pyx_n_s_attribute, __pyx_n_s_mock_name_2); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_child_mock, 993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(0, 993, __pyx_L1_error)

  /* "cymock.pyx":1032
 * 
 * 
 *     def _calls_repr(self, prefix="Calls"):             # <<<<<<<<<<<<<<
 *         """Renders self.mock_calls as a string.
 * 
 */
  __pyx_tuple__219 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_prefix); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_calls_repr, 1032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __pyx_tuple__221 = PyTuple_Pack(1, ((PyObject*)__pyx_n_u_Calls)); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);

  /* "cymock.pyx":1046
 * 
 * 
 * def _try_iter(obj):             # <<<<<<<<<<<<<<
 *     if obj is None:
 *         return obj
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_try_iter, 1046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 1046, __pyx_L1_error)

  /* "cymock.pyx":1063
 * class CallableMixin(Base):
 * 
 *     def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,             # <<<<<<<<<<<<<<
 *                  wraps=None, name=None, spec_set=None, parent=None,
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):
 */
  __pyx_tuple__224 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_spec, __pyx_n_s_side_effect, __pyx_n_s_return_value, __pyx_n_s_wraps, __pyx_n_s_name_2, __pyx_n_s_spec_set, __pyx_n_s_parent, __pyx_n_s_spec_state, __pyx_n_s_new_name_2, __pyx_n_s_new_parent, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(11, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 1063, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1063, __pyx_L1_error)

  /* "cymock.pyx":1075
 * 
 * 
 *     def _mock_check_sig(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # stub method that can be replaced with one with a specific signature
 *         pass
 */
  __pyx_tuple__226 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_mock_check_sig, 1075, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 1075, __pyx_L1_error)

  /* "cymock.pyx":1080
 * 
 * 
 *     def __call__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # can't use self in-case a function / method we are mocking uses self
 *         # in the signature
 */
  __pyx_tuple__228 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);
  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_call, 1080, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 1080, __pyx_L1_error)

  /* "cymock.pyx":1088
 * 
 * 
 *     def _mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self._execute_mock_call(*args, **kwargs)
 * 
 */
  __pyx_tuple__230 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);
  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_mock_call, 1088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 1088, __pyx_L1_error)

  /* "cymock.pyx":1091
 *         return self._execute_mock_call(*args, **kwargs)
 * 
 *     def _increment_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.called = True
 *         self.call_count += 1
 */
  __pyx_tuple__232 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_call_3, __pyx_n_s_do_method_calls, __pyx_n_s_method_call_name, __pyx_n_s_mock_call_name, __pyx_n_s_is_a_call, __pyx_n_s_new_parent, __pyx_n_s_this_mock_call, __pyx_n_s_dot); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);
  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_increment_mock_call, 1091, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 1091, __pyx_L1_error)

  /* "cymock.pyx":1137
 *             _new_parent = _new_parent._mock_new_parent
 * 
 *     def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # separate from _increment_mock_call so that awaited functions are
 *         # executed separately from their call, also AsyncMock overrides this method
 */
  __pyx_tuple__234 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_effect, __pyx_n_s_result); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);
  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_execute_mock_call, 1137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 1137, __pyx_L1_error)

  /* "cymock.pyx":1217
 * 
 * 
 * def _dot_lookup(thing, comp, import_path):             # <<<<<<<<<<<<<<
 *     try:
 *         return getattr(thing, comp)
 */
  __pyx_tuple__236 = PyTuple_Pack(3, __pyx_n_s_thing, __pyx_n_s_comp, __pyx_n_s_import_path); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);
  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_dot_lookup, 1217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 1217, __pyx_L1_error)

  /* "cymock.pyx":1225
 * 
 * 
 * def _importer(target):             # <<<<<<<<<<<<<<
 *     components = target.split('.')
 *     import_path = components.pop(0)
 */
  __pyx_tuple__238 = PyTuple_Pack(5, __pyx_n_s_target, __pyx_n_s_components, __pyx_n_s_import_path, __pyx_n_s_thing, __pyx_n_s_comp); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);
  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_importer, 1225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 1225, __pyx_L1_error)

  /* "cymock.pyx":1236
 * 
 * 
 * def _is_started(patcher):             # <<<<<<<<<<<<<<
 *     # XXXX horrible
 *     return hasattr(patcher, 'is_local')
 */
  __pyx_tuple__240 = PyTuple_Pack(1, __pyx_n_s_patcher); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__240);
  __Pyx_GIVEREF(__pyx_tuple__240);
  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_is_started, 1236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 1236, __pyx_L1_error)

  /* "cymock.pyx":1241
 * 
 * 
 * class _patch(object):             # <<<<<<<<<<<<<<
 * 
 *     attribute_name = None
 */
  __pyx_tuple__242 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__242);
  __Pyx_GIVEREF(__pyx_tuple__242);

  /* "cymock.pyx":1246
 *     _active_patches = []
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, getter, attribute, new, spec, create,
 *             spec_set, autospec, new_callable, kwargs
 */
  __pyx_tuple__243 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_getter, __pyx_n_s_attribute, __pyx_n_s_new_2, __pyx_n_s_spec, __pyx_n_s_create, __pyx_n_s_spec_set, __pyx_n_s_autospec, __pyx_n_s_new_callable, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(10, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 1246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 1246, __pyx_L1_error)

  /* "cymock.pyx":1273
 * 
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         patcher = _patch(
 *             self.getter, self.attribute, self.new, self.spec,
 */
  __pyx_tuple__245 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_patcher, __pyx_n_s_p); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);
  __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_copy, 1273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(0, 1273, __pyx_L1_error)

  /* "cymock.pyx":1286
 * 
 * 
 *     def __call__(self, func):             # <<<<<<<<<<<<<<
 *         if isinstance(func, type):
 *             return self.decorate_class(func)
 */
  __pyx_tuple__247 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_func_2); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_call, 1286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 1286, __pyx_L1_error)

  /* "cymock.pyx":1294
 * 
 * 
 *     def decorate_class(self, klass):             # <<<<<<<<<<<<<<
 *         for attr in dir(klass):
 *             if not attr.startswith(patch.TEST_PREFIX):
 */
  __pyx_tuple__249 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_klass, __pyx_n_s_attr, __pyx_n_s_attr_value, __pyx_n_s_patcher); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_decorate_class, 1294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 1294, __pyx_L1_error)

  /* "cymock.pyx":1309
 * 
 *     @contextlib.contextmanager
 *     def decoration_helper(self, patched, args, keywargs):             # <<<<<<<<<<<<<<
 *         extra_args = []
 *         entered_patchers = []
 */
  __pyx_tuple__251 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_patched, __pyx_n_s_args, __pyx_n_s_keywargs, __pyx_n_s_extra_args, __pyx_n_s_entered_patchers, __pyx_n_s_patching, __pyx_n_s_exc_info, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_decoration_helper, 1309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 1309, __pyx_L1_error)

  /* "cymock.pyx":1341
 * 
 * 
 *     def decorate_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):
 */
  __pyx_tuple__252 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_func_2, __pyx_n_s_patched, __pyx_n_s_patched); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__252);
  __Pyx_GIVEREF(__pyx_tuple__252);
  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_decorate_callable, 1341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 1341, __pyx_L1_error)

  /* "cymock.pyx":1358
 * 
 * 
 *     def decorate_async_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):
 */
  __pyx_tuple__254 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_func_2, __pyx_n_s_patched, __pyx_n_s_patched); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__254);
  __Pyx_GIVEREF(__pyx_tuple__254);
  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_decorate_async_callable, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 1358, __pyx_L1_error)

  /* "cymock.pyx":1375
 * 
 * 
 *     def get_original(self):             # <<<<<<<<<<<<<<
 *         target = self.getter()
 *         name = self.attribute
 */
  __pyx_tuple__256 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_name_2, __pyx_n_s_original, __pyx_n_s_local); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);
  __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_original, 1375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 1375, __pyx_L1_error)

  /* "cymock.pyx":1399
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Perform the patch."""
 *         new, spec, spec_set = self.new, self.spec, self.spec_set
 */
  __pyx_tuple__258 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_new_2, __pyx_n_s_spec, __pyx_n_s_spec_set, __pyx_n_s_autospec, __pyx_n_s_kwargs, __pyx_n_s_new_callable, __pyx_n_s_original, __pyx_n_s_local, __pyx_n_s_inherit, __pyx_n_s_Klass, __pyx_n_s_kwargs_2, __pyx_n_s_this_spec, __pyx_n_s_not_callable, __pyx_n_s_new_attr, __pyx_n_s_extra_args, __pyx_n_s_patching, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__258)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__258);
  __Pyx_GIVEREF(__pyx_tuple__258);
  __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(1, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__258, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_enter, 1399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 1399, __pyx_L1_error)

  /* "cymock.pyx":1529
 * 
 * 
 *     def __exit__(self, *exc_info):             # <<<<<<<<<<<<<<
 *         """Undo the patch."""
 *         if not _is_started(self):
 */
  __pyx_tuple__260 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_exc_info, __pyx_n_s_patcher); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);
  __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__260, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_exit, 1529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(0, 1529, __pyx_L1_error)

  /* "cymock.pyx":1553
 * 
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         """Activate a patch, returning any created mock."""
 *         result = self.__enter__()
 */
  __pyx_tuple__262 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__262);
  __Pyx_GIVEREF(__pyx_tuple__262);
  __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__262, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_start, 1553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(0, 1553, __pyx_L1_error)

  /* "cymock.pyx":1560
 * 
 * 
 *     def stop(self):             # <<<<<<<<<<<<<<
 *         """Stop an active patch."""
 *         try:
 */
  __pyx_tuple__264 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);
  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_stop, 1560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 1560, __pyx_L1_error)

  /* "cymock.pyx":1572
 * 
 * 
 * def _get_target(target):             # <<<<<<<<<<<<<<
 *     try:
 *         target, attribute = target.rsplit('.', 1)
 */
  __pyx_tuple__266 = PyTuple_Pack(3, __pyx_n_s_target, __pyx_n_s_attribute, __pyx_n_s_getter); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);
  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_target, 1572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(0, 1572, __pyx_L1_error)

  /* "cymock.pyx":1582
 * 
 * 
 * def _patch_object(             # <<<<<<<<<<<<<<
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,
 */
  __pyx_tuple__268 = PyTuple_Pack(10, __pyx_n_s_target, __pyx_n_s_attribute, __pyx_n_s_new_2, __pyx_n_s_spec, __pyx_n_s_create, __pyx_n_s_spec_set, __pyx_n_s_autospec, __pyx_n_s_new_callable, __pyx_n_s_kwargs, __pyx_n_s_getter); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);
  __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(8, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_patch_object, 1582, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(0, 1582, __pyx_L1_error)

  /* "cymock.pyx":1611
 * 
 * 
 * def _patch_multiple(target, spec=None, create=False, spec_set=None,             # <<<<<<<<<<<<<<
 *                     autospec=None, new_callable=None, **kwargs):
 *     """Perform multiple patches in a single call. It takes the object to be
 */
  __pyx_tuple__270 = PyTuple_Pack(13, __pyx_n_s_target, __pyx_n_s_spec, __pyx_n_s_create, __pyx_n_s_spec_set, __pyx_n_s_autospec, __pyx_n_s_new_callable, __pyx_n_s_kwargs, __pyx_n_s_getter, __pyx_n_s_items, __pyx_n_s_attribute, __pyx_n_s_new_2, __pyx_n_s_patcher, __pyx_n_s_this_patcher); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 1611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__270);
  __Pyx_GIVEREF(__pyx_tuple__270);
  __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__270, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_patch_multiple, 1611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 1611, __pyx_L1_error)

  /* "cymock.pyx":1662
 * class patch:
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         target,
 */
  __pyx_tuple__272 = PyTuple_Pack(11, __pyx_n_s_cls, __pyx_n_s_target, __pyx_n_s_new_2, __pyx_n_s_spec, __pyx_n_s_create, __pyx_n_s_spec_set, __pyx_n_s_autospec, __pyx_n_s_new_callable, __pyx_n_s_kwargs, __pyx_n_s_getter, __pyx_n_s_attribute); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__272);
  __Pyx_GIVEREF(__pyx_tuple__272);
  __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(8, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__272, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_new, 1662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 1662, __pyx_L1_error)

  /* "cymock.pyx":1746
 * 
 * 
 * class _patch_dict(object):             # <<<<<<<<<<<<<<
 *     """
 *     Patch a dictionary, or dictionary like object, and restore the dictionary
 */
  __pyx_tuple__274 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__274)) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__274);
  __Pyx_GIVEREF(__pyx_tuple__274);

  /* "cymock.pyx":1775
 *     """
 * 
 *     def __init__(self, in_dict, values=(), clear=False, **kwargs):             # <<<<<<<<<<<<<<
 *         self.in_dict = in_dict
 *         # support any argument supported by dict(...) constructor
 */
  __pyx_tuple__275 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_in_dict, __pyx_n_s_values, __pyx_n_s_clear, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 1775, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __pyx_tuple__277 = PyTuple_Pack(2, ((PyObject*)__pyx_empty_tuple), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);

  /* "cymock.pyx":1784
 * 
 * 
 *     def __call__(self, f):             # <<<<<<<<<<<<<<
 *         if isinstance(f, type):
 *             return self.decorate_class(f)
 */
  __pyx_tuple__278 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_f, __pyx_n_s_inner, __pyx_n_s_inner); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__278);
  __Pyx_GIVEREF(__pyx_tuple__278);
  __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_call, 1784, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 1784, __pyx_L1_error)

  /* "cymock.pyx":1798
 * 
 * 
 *     def decorate_class(self, klass):             # <<<<<<<<<<<<<<
 *         for attr in dir(klass):
 *             attr_value = getattr(klass, attr)
 */
  __pyx_tuple__280 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_klass, __pyx_n_s_attr, __pyx_n_s_attr_value, __pyx_n_s_decorator, __pyx_n_s_decorated); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__280);
  __Pyx_GIVEREF(__pyx_tuple__280);
  __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_decorate_class, 1798, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 1798, __pyx_L1_error)

  /* "cymock.pyx":1809
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Patch the dict."""
 *         self._patch_dict()
 */
  __pyx_tuple__282 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 1809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__282);
  __Pyx_GIVEREF(__pyx_tuple__282);
  __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_enter, 1809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(0, 1809, __pyx_L1_error)

  /* "cymock.pyx":1815
 * 
 * 
 *     def _patch_dict(self):             # <<<<<<<<<<<<<<
 *         values = self.values
 *         if isinstance(self.in_dict, str):
 */
  __pyx_tuple__284 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_values, __pyx_n_s_in_dict, __pyx_n_s_clear, __pyx_n_s_original, __pyx_n_s_key); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_patch_dict, 1815, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 1815, __pyx_L1_error)

  /* "cymock.pyx":1843
 * 
 * 
 *     def _unpatch_dict(self):             # <<<<<<<<<<<<<<
 *         in_dict = self.in_dict
 *         original = self._original
 */
  __pyx_tuple__286 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_in_dict, __pyx_n_s_original, __pyx_n_s_key); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 1843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);
  __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__286, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_unpatch_dict, 1843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 1843, __pyx_L1_error)

  /* "cymock.pyx":1856
 * 
 * 
 *     def __exit__(self, *args):             # <<<<<<<<<<<<<<
 *         """Unpatch the dict."""
 *         self._unpatch_dict()
 */
  __pyx_tuple__288 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 1856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__288);
  __Pyx_GIVEREF(__pyx_tuple__288);
  __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_exit, 1856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(0, 1856, __pyx_L1_error)

  /* "cymock.pyx":1865
 * 
 * 
 * def _clear_dict(in_dict):             # <<<<<<<<<<<<<<
 *     try:
 *         in_dict.clear()
 */
  __pyx_tuple__290 = PyTuple_Pack(3, __pyx_n_s_in_dict, __pyx_n_s_keys, __pyx_n_s_key); if (unlikely(!__pyx_tuple__290)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__290);
  __Pyx_GIVEREF(__pyx_tuple__290);
  __pyx_codeobj__291 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__290, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_clear_dict, 1865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__291)) __PYX_ERR(0, 1865, __pyx_L1_error)

  /* "cymock.pyx":1874
 * 
 * 
 * def _patch_stopall():             # <<<<<<<<<<<<<<
 *     """Stop all active patches. LIFO to unroll nested patches."""
 *     for patch in reversed(_patch._active_patches):
 */
  __pyx_tuple__292 = PyTuple_Pack(1, __pyx_n_s_patch_2); if (unlikely(!__pyx_tuple__292)) __PYX_ERR(0, 1874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__292);
  __Pyx_GIVEREF(__pyx_tuple__292);
  __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__292, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_patch_stopall, 1874, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(0, 1874, __pyx_L1_error)

  /* "cymock.pyx":1921
 * 
 * 
 * def _get_method(name, func):             # <<<<<<<<<<<<<<
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):
 */
  __pyx_tuple__295 = PyTuple_Pack(4, __pyx_n_s_name_2, __pyx_n_s_func_2, __pyx_n_s_method, __pyx_n_s_method); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 1921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_method, 1921, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(0, 1921, __pyx_L1_error)

  /* "cymock.pyx":1974
 * 
 * 
 * def _get_eq(self):             # <<<<<<<<<<<<<<
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value
 */
  __pyx_tuple__297 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_eq, __pyx_n_s_eq); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_eq, 1974, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(0, 1974, __pyx_L1_error)

  /* "cymock.pyx":1984
 *     return __eq__
 * 
 * def _get_ne(self):             # <<<<<<<<<<<<<<
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:
 */
  __pyx_tuple__299 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ne, __pyx_n_s_ne); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_ne, 1984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(0, 1984, __pyx_L1_error)

  /* "cymock.pyx":1993
 *     return __ne__
 * 
 * def _get_iter(self):             # <<<<<<<<<<<<<<
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value
 */
  __pyx_tuple__301 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_iter, __pyx_n_s_iter); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);
  __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_iter, 1993, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) __PYX_ERR(0, 1993, __pyx_L1_error)

  /* "cymock.pyx":2003
 *     return __iter__
 * 
 * def _get_async_iter(self):             # <<<<<<<<<<<<<<
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value
 */
  __pyx_tuple__303 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_aiter, __pyx_n_s_aiter); if (unlikely(!__pyx_tuple__303)) __PYX_ERR(0, 2003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);
  __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__303, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_async_iter, 2003, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(0, 2003, __pyx_L1_error)

  /* "cymock.pyx":2020
 * 
 * 
 * def _set_return_value(mock, method, name):             # <<<<<<<<<<<<<<
 *     fixed = _return_values.get(name, DEFAULT)
 *     if fixed is not DEFAULT:
 */
  __pyx_tuple__305 = PyTuple_Pack(7, __pyx_n_s_mock, __pyx_n_s_method, __pyx_n_s_name_2, __pyx_n_s_fixed, __pyx_n_s_return_calculator, __pyx_n_s_return_value, __pyx_n_s_side_effector); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__305);
  __Pyx_GIVEREF(__pyx_tuple__305);
  __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_set_return_value, 2020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(0, 2020, __pyx_L1_error)

  /* "cymock.pyx":2039
 * 
 * class MagicMixin(Base):
 *     def __init__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(MagicMixin, self).__init__(*args, **kw)
 */
  __pyx_tuple__307 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 2039, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 2039, __pyx_L1_error)

  /* "cymock.pyx":2045
 * 
 * 
 *     def _mock_set_magics(self):             # <<<<<<<<<<<<<<
 *         orig_magics = _magics | _async_method_magics
 *         these_magics = orig_magics
 */
  __pyx_tuple__309 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_orig_magics, __pyx_n_s_these_magics, __pyx_n_s_remove_magics, __pyx_n_s_entry, __pyx_n_s_type); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 2045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_mock_set_magics, 2045, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(0, 2045, __pyx_L1_error)

  /* "cymock.pyx":2071
 * class NonCallableMagicMock(MagicMixin, NonCallableMock):
 *     """A version of `MagicMock` that isn't callable."""
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */
  __pyx_tuple__311 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_spec, __pyx_n_s_spec_set); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 2071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__311);
  __Pyx_GIVEREF(__pyx_tuple__311);
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_mock_add_spec_2, 2071, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(0, 2071, __pyx_L1_error)
  __pyx_tuple__313 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(0, 2071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);

  /* "cymock.pyx":2082
 * 
 * class AsyncMagicMixin(MagicMixin):
 *     def __init__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(AsyncMagicMixin, self).__init__(*args, **kw)
 */
  __pyx_tuple__314 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__314);
  __Pyx_GIVEREF(__pyx_tuple__314);
  __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 2082, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(0, 2082, __pyx_L1_error)

  /* "cymock.pyx":2098
 *     Attributes and the return value of a `MagicMock` will also be `MagicMocks`.
 *     """
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */
  __pyx_tuple__316 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_spec, __pyx_n_s_spec_set); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(0, 2098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__316);
  __Pyx_GIVEREF(__pyx_tuple__316);
  __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_mock_add_spec_2, 2098, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(0, 2098, __pyx_L1_error)
  __pyx_tuple__318 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(0, 2098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__318);
  __Pyx_GIVEREF(__pyx_tuple__318);

  /* "cymock.pyx":2110
 * 
 * class MagicProxy(Base):
 *     def __init__(self, name, parent):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.parent = parent
 */
  __pyx_tuple__319 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 2110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 2110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(0, 2110, __pyx_L1_error)

  /* "cymock.pyx":2114
 *         self.parent = parent
 * 
 *     def create_mock(self):             # <<<<<<<<<<<<<<
 *         entry = self.name
 *         parent = self.parent
 */
  __pyx_tuple__321 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_entry, __pyx_n_s_parent, __pyx_n_s_m); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 2114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_create_mock, 2114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(0, 2114, __pyx_L1_error)

  /* "cymock.pyx":2123
 *         return m
 * 
 *     def __get__(self, obj, _type=None):             # <<<<<<<<<<<<<<
 *         return self.create_mock()
 * 
 */
  __pyx_tuple__323 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_obj, __pyx_n_s_type); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__323);
  __Pyx_GIVEREF(__pyx_tuple__323);
  __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_3, 2123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) __PYX_ERR(0, 2123, __pyx_L1_error)
  __pyx_tuple__325 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__325);
  __Pyx_GIVEREF(__pyx_tuple__325);

  /* "cymock.pyx":2132
 *     await_args_list = _delegating_property('await_args_list')
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super().__init__(*args, **kwargs)
 *         # asyncio.iscoroutinefunction() checks _is_coroutine property to say if an
 */
  __pyx_tuple__326 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_code_mock); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(0, 2132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__326, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 2132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(0, 2132, __pyx_L1_error)

  /* "cymock.pyx":2148
 *         self.__dict__['__code__'] = code_mock
 * 
 *     async def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # This is nearly just like super(), except for sepcial handling
 *         # of coroutines
 */
  __pyx_tuple__328 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_call_3, __pyx_n_s_effect, __pyx_n_s_result); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__328, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_execute_mock_call, 2148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 2148, __pyx_L1_error)

  /* "cymock.pyx":2188
 *         return self.return_value
 * 
 *     def assert_awaited(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited at least once.
 */
  __pyx_tuple__329 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(0, 2188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__329);
  __Pyx_GIVEREF(__pyx_tuple__329);
  __pyx_codeobj__330 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_awaited, 2188, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__330)) __PYX_ERR(0, 2188, __pyx_L1_error)

  /* "cymock.pyx":2196
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_once(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited exactly once.
 */
  __pyx_tuple__331 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__331);
  __Pyx_GIVEREF(__pyx_tuple__331);
  __pyx_codeobj__332 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_awaited_once, 2196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__332)) __PYX_ERR(0, 2196, __pyx_L1_error)

  /* "cymock.pyx":2205
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the last await was with the specified arguments.
 */
  __pyx_tuple__333 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_expected, __pyx_n_s_error_message, __pyx_n_s_error_message, __pyx_n_s_actual, __pyx_n_s_cause); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(0, 2205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__333);
  __Pyx_GIVEREF(__pyx_tuple__333);
  __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_awaited_with, 2205, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(0, 2205, __pyx_L1_error)

  /* "cymock.pyx":2223
 *             raise AssertionError(_error_message()) from cause
 * 
 *     def assert_awaited_once_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited exactly once and with the specified
 */
  __pyx_tuple__335 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 2223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__335);
  __Pyx_GIVEREF(__pyx_tuple__335);
  __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_awaited_once_with, 2223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(0, 2223, __pyx_L1_error)

  /* "cymock.pyx":2234
 *         return self.assert_awaited_with(*args, **kwargs)
 * 
 *     def assert_any_await(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has ever been awaited with the specified arguments.
 */
  __pyx_tuple__337 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_expected, __pyx_n_s_actual, __pyx_n_s_cause, __pyx_n_s_expected_string, __pyx_n_s_c); if (unlikely(!__pyx_tuple__337)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__337);
  __Pyx_GIVEREF(__pyx_tuple__337);
  __pyx_codeobj__338 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__337, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_any_await, 2234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__338)) __PYX_ERR(0, 2234, __pyx_L1_error)

  /* "cymock.pyx":2247
 *             ) from cause
 * 
 *     def assert_has_awaits(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has been awaited with the specified calls.
 */
  __pyx_tuple__339 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_calls, __pyx_n_s_any_order, __pyx_n_s_expected, __pyx_n_s_cause, __pyx_n_s_all_awaits, __pyx_n_s_problem, __pyx_n_s_not_found, __pyx_n_s_kall, __pyx_n_s_c, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_e); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(0, 2247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__339);
  __Pyx_GIVEREF(__pyx_tuple__339);
  __pyx_codeobj__340 = (PyObject*)__Pyx_PyCode_New(3, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_has_awaits, 2247, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__340)) __PYX_ERR(0, 2247, __pyx_L1_error)
  __pyx_tuple__341 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(0, 2247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__341);
  __Pyx_GIVEREF(__pyx_tuple__341);

  /* "cymock.pyx":2291
 *             ) from cause
 * 
 *     def assert_not_awaited(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was never awaited.
 */
  __pyx_tuple__342 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_assert_not_awaited, 2291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(0, 2291, __pyx_L1_error)

  /* "cymock.pyx":2300
 *             raise AssertionError(msg)
 * 
 *     def reset_mock(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         See :func:`.Mock.reset_mock()`
 */
  __pyx_tuple__344 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);
  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_reset_mock, 2300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(0, 2300, __pyx_L1_error)

  /* "cymock.pyx":2353
 * 
 * 
 * class _ANY(object):             # <<<<<<<<<<<<<<
 *     "A helper object that compares equal to everything."
 * 
 */
  __pyx_tuple__346 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(0, 2353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__346);
  __Pyx_GIVEREF(__pyx_tuple__346);

  /* "cymock.pyx":2356
 *     "A helper object that compares equal to everything."
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_tuple__347 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__347)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__347);
  __Pyx_GIVEREF(__pyx_tuple__347);
  __pyx_codeobj__348 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__347, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_eq, 2356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__348)) __PYX_ERR(0, 2356, __pyx_L1_error)

  /* "cymock.pyx":2359
 *         return True
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_tuple__349 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__349)) __PYX_ERR(0, 2359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__349);
  __Pyx_GIVEREF(__pyx_tuple__349);
  __pyx_codeobj__350 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__349, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_ne, 2359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__350)) __PYX_ERR(0, 2359, __pyx_L1_error)

  /* "cymock.pyx":2362
 *         return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<ANY>'
 * 
 */
  __pyx_tuple__351 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__351)) __PYX_ERR(0, 2362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__351);
  __Pyx_GIVEREF(__pyx_tuple__351);
  __pyx_codeobj__352 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__351, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_repr, 2362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__352)) __PYX_ERR(0, 2362, __pyx_L1_error)

  /* "cymock.pyx":2369
 * 
 * 
 * def _format_call_signature(name, args, kwargs):             # <<<<<<<<<<<<<<
 *     message = '%s(%%s)' % name
 *     formatted_args = ''
 */
  __pyx_tuple__353 = PyTuple_Pack(10, __pyx_n_s_name_2, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_message, __pyx_n_s_formatted_args, __pyx_n_s_args_string, __pyx_n_s_kwargs_string, __pyx_n_s_arg, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__353)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__353);
  __Pyx_GIVEREF(__pyx_tuple__353);
  __pyx_codeobj__354 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__353, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_format_call_signature, 2369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__354)) __PYX_ERR(0, 2369, __pyx_L1_error)

  /* "cymock.pyx":2406
 *     If the _Call has no name then it will match any name.
 *     """
 *     def __new__(cls, value=(), name='', parent=None, two=False,             # <<<<<<<<<<<<<<
 *                 from_kall=True):
 *         args = ()
 */
  __pyx_tuple__355 = PyTuple_Pack(11, __pyx_n_s_cls, __pyx_n_s_value, __pyx_n_s_name_2, __pyx_n_s_parent, __pyx_n_s_two, __pyx_n_s_from_kall, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_len_2, __pyx_n_s_first_2, __pyx_n_s_second); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(0, 2406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__355);
  __Pyx_GIVEREF(__pyx_tuple__355);
  __pyx_codeobj__356 = (PyObject*)__Pyx_PyCode_New(6, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_new, 2406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__356)) __PYX_ERR(0, 2406, __pyx_L1_error)
  __pyx_tuple__357 = PyTuple_Pack(5, ((PyObject*)__pyx_empty_tuple), ((PyObject*)__pyx_kp_u__31), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(0, 2406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__357);
  __Pyx_GIVEREF(__pyx_tuple__357);

  /* "cymock.pyx":2438
 * 
 * 
 *     def __init__(self, value=(), name=None, parent=None, two=False,             # <<<<<<<<<<<<<<
 *                  from_kall=True):
 *         self._mock_name = name
 */
  __pyx_tuple__358 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_name_2, __pyx_n_s_parent, __pyx_n_s_two, __pyx_n_s_from_kall); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__358);
  __Pyx_GIVEREF(__pyx_tuple__358);
  __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 2438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) __PYX_ERR(0, 2438, __pyx_L1_error)
  __pyx_tuple__360 = PyTuple_Pack(5, ((PyObject*)__pyx_empty_tuple), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__360);
  __Pyx_GIVEREF(__pyx_tuple__360);

  /* "cymock.pyx":2445
 * 
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if other is ANY:
 *             return True
 */
  __pyx_tuple__361 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_len_other, __pyx_n_s_self_name, __pyx_n_s_self_args, __pyx_n_s_self_kwargs, __pyx_n_s_other_name, __pyx_n_s_other_args, __pyx_n_s_other_kwargs, __pyx_n_s_value, __pyx_n_s_first_2, __pyx_n_s_second); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(0, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__361);
  __Pyx_GIVEREF(__pyx_tuple__361);
  __pyx_codeobj__362 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_eq, 2445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__362)) __PYX_ERR(0, 2445, __pyx_L1_error)

  /* "cymock.pyx":2503
 * 
 * 
 *     def __call__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         if self._mock_name is None:
 *             return _Call(('', args, kwargs), name='()')
 */
  __pyx_tuple__363 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__363);
  __Pyx_GIVEREF(__pyx_tuple__363);
  __pyx_codeobj__364 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_call, 2503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__364)) __PYX_ERR(0, 2503, __pyx_L1_error)

  /* "cymock.pyx":2511
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         if self._mock_name is None:
 *             return _Call(name=attr, from_kall=False)
 */
  __pyx_tuple__365 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_attr, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 2511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__365);
  __Pyx_GIVEREF(__pyx_tuple__365);
  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_getattr, 2511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(0, 2511, __pyx_L1_error)

  /* "cymock.pyx":2518
 * 
 * 
 *     def __getattribute__(self, attr):             # <<<<<<<<<<<<<<
 *         if attr in tuple.__dict__:
 *             raise AttributeError
 */
  __pyx_tuple__367 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_attr); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__367);
  __Pyx_GIVEREF(__pyx_tuple__367);
  __pyx_codeobj__368 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_getattribute, 2518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__368)) __PYX_ERR(0, 2518, __pyx_L1_error)

  /* "cymock.pyx":2524
 * 
 * 
 *     def count(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.__getattr__('count')(*args, **kwargs)
 * 
 */
  __pyx_tuple__369 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);
  __pyx_codeobj__370 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__369, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_count, 2524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__370)) __PYX_ERR(0, 2524, __pyx_L1_error)

  /* "cymock.pyx":2527
 *         return self.__getattr__('count')(*args, **kwargs)
 * 
 *     def index(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.__getattr__('index')(*args, **kwargs)
 * 
 */
  __pyx_tuple__371 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__371)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__371);
  __Pyx_GIVEREF(__pyx_tuple__371);
  __pyx_codeobj__372 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__371, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_index, 2527, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__372)) __PYX_ERR(0, 2527, __pyx_L1_error)

  /* "cymock.pyx":2530
 *         return self.__getattr__('index')(*args, **kwargs)
 * 
 *     def _get_call_arguments(self):             # <<<<<<<<<<<<<<
 *         if len(self) == 2:
 *             args, kwargs = self
 */
  __pyx_tuple__373 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__373)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__373);
  __Pyx_GIVEREF(__pyx_tuple__373);
  __pyx_codeobj__374 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__373, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_call_arguments, 2530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__374)) __PYX_ERR(0, 2530, __pyx_L1_error)

  /* "cymock.pyx":2539
 * 
 *     @property
 *     def args(self):             # <<<<<<<<<<<<<<
 *         return self._get_call_arguments()[0]
 * 
 */
  __pyx_tuple__375 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__375)) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__375);
  __Pyx_GIVEREF(__pyx_tuple__375);
  __pyx_codeobj__376 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__375, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_args, 2539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__376)) __PYX_ERR(0, 2539, __pyx_L1_error)

  /* "cymock.pyx":2543
 * 
 *     @property
 *     def kwargs(self):             # <<<<<<<<<<<<<<
 *         return self._get_call_arguments()[1]
 * 
 */
  __pyx_tuple__377 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__377)) __PYX_ERR(0, 2543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__377);
  __Pyx_GIVEREF(__pyx_tuple__377);
  __pyx_codeobj__378 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__377, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_kwargs, 2543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__378)) __PYX_ERR(0, 2543, __pyx_L1_error)

  /* "cymock.pyx":2546
 *         return self._get_call_arguments()[1]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if not self._mock_from_kall:
 *             name = self._mock_name or 'call'
 */
  __pyx_tuple__379 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_name_2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(0, 2546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__379);
  __Pyx_GIVEREF(__pyx_tuple__379);
  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_repr, 2546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__380)) __PYX_ERR(0, 2546, __pyx_L1_error)

  /* "cymock.pyx":2567
 * 
 * 
 *     def call_list(self):             # <<<<<<<<<<<<<<
 *         """For a call object that represents multiple calls, `call_list`
 *         returns a list of all the intermediate calls as well as the
 */
  __pyx_tuple__381 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_vals, __pyx_n_s_thing); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__381);
  __Pyx_GIVEREF(__pyx_tuple__381);
  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_call_list, 2567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(0, 2567, __pyx_L1_error)

  /* "cymock.pyx":2583
 * 
 * 
 * def create_autospec(spec, spec_set=False, instance=False, _parent=None,             # <<<<<<<<<<<<<<
 *                     _name=None, **kwargs):
 *     """Create a mock object using another object as a spec. Attributes on the
 */
  __pyx_tuple__383 = PyTuple_Pack(18, __pyx_n_s_spec, __pyx_n_s_spec_set, __pyx_n_s_instance, __pyx_n_s_parent_2, __pyx_n_s_name_3, __pyx_n_s_kwargs, __pyx_n_s_is_type, __pyx_n_s_is_async_func_2, __pyx_n_s_kwargs_2, __pyx_n_s_Klass, __pyx_n_s_new_name_2, __pyx_n_s_mock, __pyx_n_s_entry, __pyx_n_s_original, __pyx_n_s_new_2, __pyx_n_s_parent, __pyx_n_s_skipfirst, __pyx_n_s_child_klass); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__383);
  __Pyx_GIVEREF(__pyx_tuple__383);
  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_create_autospec, 2583, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(0, 2583, __pyx_L1_error)

  /* "cymock.pyx":2714
 * 
 * 
 * def _must_skip(spec, entry, is_type):             # <<<<<<<<<<<<<<
 *     """
 *     Return whether we should skip the first argument on spec's `entry`
 */
  __pyx_tuple__385 = PyTuple_Pack(5, __pyx_n_s_spec, __pyx_n_s_entry, __pyx_n_s_is_type, __pyx_n_s_klass, __pyx_n_s_result); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(0, 2714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__385);
  __Pyx_GIVEREF(__pyx_tuple__385);
  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_must_skip, 2714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(0, 2714, __pyx_L1_error)

  /* "cymock.pyx":2742
 * 
 * 
 * class _SpecState(object):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,
 */
  __pyx_tuple__387 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__387);
  __Pyx_GIVEREF(__pyx_tuple__387);

  /* "cymock.pyx":2744
 * class _SpecState(object):
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,             # <<<<<<<<<<<<<<
 *                  name=None, ids=None, instance=False):
 *         self.spec = spec
 */
  __pyx_tuple__388 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_spec, __pyx_n_s_spec_set, __pyx_n_s_parent, __pyx_n_s_name_2, __pyx_n_s_ids, __pyx_n_s_instance); if (unlikely(!__pyx_tuple__388)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__388);
  __Pyx_GIVEREF(__pyx_tuple__388);
  __pyx_codeobj__389 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__388, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 2744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__389)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __pyx_tuple__390 = PyTuple_Pack(5, ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__390)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__390);
  __Pyx_GIVEREF(__pyx_tuple__390);

  /* "cymock.pyx":2765
 * 
 * 
 * def _to_stream(read_data):             # <<<<<<<<<<<<<<
 *     if isinstance(read_data, bytes):
 *         return io.BytesIO(read_data)
 */
  __pyx_tuple__391 = PyTuple_Pack(1, __pyx_n_s_read_data); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__391);
  __Pyx_GIVEREF(__pyx_tuple__391);
  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_to_stream, 2765, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(0, 2765, __pyx_L1_error)

  /* "cymock.pyx":2772
 * 
 * 
 * def mock_open(mock=None, read_data=''):             # <<<<<<<<<<<<<<
 *     """
 *     A helper function to create a mock to replace the use of `open`. It works
 */
  __pyx_tuple__393 = PyTuple_Pack(18, __pyx_n_s_mock, __pyx_n_s_read_data, __pyx_n_s_read_data_2, __pyx_n_s_state, __pyx_n_s_readlines_side_effect, __pyx_n_s_readlines_side_effect, __pyx_n_s_read_side_effect, __pyx_n_s_read_side_effect, __pyx_n_s_readline_side_effect, __pyx_n_s_readline_side_effect, __pyx_n_s_iter_side_effect, __pyx_n_s_iter_side_effect, __pyx_n_s_next_side_effect, __pyx_n_s_next_side_effect, __pyx_n_s_io_2, __pyx_n_s_handle, __pyx_n_s_reset_data, __pyx_n_s_reset_data); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__393);
  __Pyx_GIVEREF(__pyx_tuple__393);
  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_mock_open, 2772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(0, 2772, __pyx_L1_error)

  /* "cymock.pyx":2859
 *     no args. Setting it calls the mock with the value being set.
 *     """
 *     def _get_child_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         return MagicMock(**kwargs)
 * 
 */
  __pyx_tuple__395 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(0, 2859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__395);
  __Pyx_GIVEREF(__pyx_tuple__395);
  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_child_mock, 2859, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(0, 2859, __pyx_L1_error)

  /* "cymock.pyx":2862
 *         return MagicMock(**kwargs)
 * 
 *     def __get__(self, obj, obj_type=None):             # <<<<<<<<<<<<<<
 *         return self()
 *     def __set__(self, obj, val):
 */
  __pyx_tuple__397 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_obj, __pyx_n_s_obj_type); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__397);
  __Pyx_GIVEREF(__pyx_tuple__397);
  __pyx_codeobj__398 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_get_3, 2862, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__398)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __pyx_tuple__399 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__399);
  __Pyx_GIVEREF(__pyx_tuple__399);

  /* "cymock.pyx":2864
 *     def __get__(self, obj, obj_type=None):
 *         return self()
 *     def __set__(self, obj, val):             # <<<<<<<<<<<<<<
 *         self(val)
 * 
 */
  __pyx_tuple__400 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_obj, __pyx_n_s_val); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(0, 2864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__400);
  __Pyx_GIVEREF(__pyx_tuple__400);
  __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__400, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_set_2, 2864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) __PYX_ERR(0, 2864, __pyx_L1_error)

  /* "cymock.pyx":2868
 * 
 * 
 * def seal(mock):             # <<<<<<<<<<<<<<
 *     """Disable the automatic generation of child mocks.
 * 
 */
  __pyx_tuple__402 = PyTuple_Pack(3, __pyx_n_s_mock, __pyx_n_s_attr, __pyx_n_s_m); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(0, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__402);
  __Pyx_GIVEREF(__pyx_tuple__402);
  __pyx_codeobj__403 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__402, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_seal, 2868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__403)) __PYX_ERR(0, 2868, __pyx_L1_error)

  /* "cymock.pyx":2894
 *     Wraps an iterator in an asynchronous iterator.
 *     """
 *     def __init__(self, iterator):             # <<<<<<<<<<<<<<
 *         self.iterator = iterator
 *         code_mock = NonCallableMock(spec_set=CodeType)
 */
  __pyx_tuple__404 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_iterator, __pyx_n_s_code_mock); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__404);
  __Pyx_GIVEREF(__pyx_tuple__404);
  __pyx_codeobj__405 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__404, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_init, 2894, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__405)) __PYX_ERR(0, 2894, __pyx_L1_error)

  /* "cymock.pyx":2900
 *         self.__dict__['__code__'] = code_mock
 * 
 *     def __aiter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_tuple__406 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__406)) __PYX_ERR(0, 2900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__406);
  __Pyx_GIVEREF(__pyx_tuple__406);
  __pyx_codeobj__407 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__406, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_aiter, 2900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__407)) __PYX_ERR(0, 2900, __pyx_L1_error)

  /* "cymock.pyx":2903
 *         return self
 * 
 *     async def __anext__(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return next(self.iterator)
 */
  __pyx_tuple__408 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__408)) __PYX_ERR(0, 2903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__408);
  __Pyx_GIVEREF(__pyx_tuple__408);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__408, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cymock_pyx, __pyx_n_s_anext, 2903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 2903, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_7genexpr__pyx_v_6cymock_name = Py_None; Py_INCREF(Py_None);
  __pyx_9genexpr13__pyx_v_6cymock_method = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct___check_signature) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct___check_signature.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct___check_signature.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct___check_signature.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct___check_signature.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct___check_signature = &__pyx_type_6cymock___pyx_scope_struct___check_signature;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_1__set_signature) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_1__set_signature.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_1__set_signature.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_1__set_signature.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_1__set_signature.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_1__set_signature = &__pyx_type_6cymock___pyx_scope_struct_1__set_signature;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_2__setup_func) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_2__setup_func.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_2__setup_func.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_2__setup_func.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_2__setup_func.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_2__setup_func = &__pyx_type_6cymock___pyx_scope_struct_2__setup_func;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_3__setup_async_mock) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_3__setup_async_mock.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_3__setup_async_mock.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_3__setup_async_mock.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_3__setup_async_mock.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_3__setup_async_mock = &__pyx_type_6cymock___pyx_scope_struct_3__setup_async_mock;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_4___setattr__) < 0) __PYX_ERR(0, 741, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_4___setattr__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_4___setattr__.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_4___setattr__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_4___setattr__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_4___setattr__ = &__pyx_type_6cymock___pyx_scope_struct_4___setattr__;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_5_assert_called_with) < 0) __PYX_ERR(0, 898, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_5_assert_called_with.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_5_assert_called_with.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_5_assert_called_with.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_5_assert_called_with.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_5_assert_called_with = &__pyx_type_6cymock___pyx_scope_struct_5_assert_called_with;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_6_assert_has_calls) < 0) __PYX_ERR(0, 932, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_6_assert_has_calls.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_6_assert_has_calls.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_6_assert_has_calls.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_6_assert_has_calls.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_6_assert_has_calls = &__pyx_type_6cymock___pyx_scope_struct_6_assert_has_calls;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_7_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_7_genexpr.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_7_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_7_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_7_genexpr = &__pyx_type_6cymock___pyx_scope_struct_7_genexpr;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 944, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_8_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_8_genexpr.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_8_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_8_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_8_genexpr = &__pyx_type_6cymock___pyx_scope_struct_8_genexpr;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_9_decoration_helper) < 0) __PYX_ERR(0, 1309, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_9_decoration_helper.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_9_decoration_helper.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_9_decoration_helper.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_9_decoration_helper.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_9_decoration_helper = &__pyx_type_6cymock___pyx_scope_struct_9_decoration_helper;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_10_decorate_callable) < 0) __PYX_ERR(0, 1341, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_10_decorate_callable.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_10_decorate_callable.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_10_decorate_callable.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_10_decorate_callable.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_10_decorate_callable = &__pyx_type_6cymock___pyx_scope_struct_10_decorate_callable;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_11_decorate_async_callable) < 0) __PYX_ERR(0, 1358, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_11_decorate_async_callable.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_11_decorate_async_callable.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_11_decorate_async_callable.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_11_decorate_async_callable.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_11_decorate_async_callable = &__pyx_type_6cymock___pyx_scope_struct_11_decorate_async_callable;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_12_patched) < 0) __PYX_ERR(0, 1365, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_12_patched.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_12_patched.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_12_patched.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_12_patched.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_12_patched = &__pyx_type_6cymock___pyx_scope_struct_12_patched;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_13__get_target) < 0) __PYX_ERR(0, 1572, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_13__get_target.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_13__get_target.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_13__get_target.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_13__get_target.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_13__get_target = &__pyx_type_6cymock___pyx_scope_struct_13__get_target;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_14__patch_object) < 0) __PYX_ERR(0, 1582, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_14__patch_object.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_14__patch_object.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_14__patch_object.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_14__patch_object.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_14__patch_object = &__pyx_type_6cymock___pyx_scope_struct_14__patch_object;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_15__patch_multiple) < 0) __PYX_ERR(0, 1611, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_15__patch_multiple.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_15__patch_multiple.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_15__patch_multiple.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_15__patch_multiple.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_15__patch_multiple = &__pyx_type_6cymock___pyx_scope_struct_15__patch_multiple;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_16___call__) < 0) __PYX_ERR(0, 1784, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_16___call__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_16___call__.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_16___call__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_16___call__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_16___call__ = &__pyx_type_6cymock___pyx_scope_struct_16___call__;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 1905, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_17_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_17_genexpr.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_17_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_17_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_17_genexpr = &__pyx_type_6cymock___pyx_scope_struct_17_genexpr;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 1906, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_18_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_18_genexpr.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_18_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_18_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_18_genexpr = &__pyx_type_6cymock___pyx_scope_struct_18_genexpr;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_19__get_method) < 0) __PYX_ERR(0, 1921, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_19__get_method.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_19__get_method.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_19__get_method.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_19__get_method.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_19__get_method = &__pyx_type_6cymock___pyx_scope_struct_19__get_method;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_20__get_eq) < 0) __PYX_ERR(0, 1974, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_20__get_eq.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_20__get_eq.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_20__get_eq.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_20__get_eq.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_20__get_eq = &__pyx_type_6cymock___pyx_scope_struct_20__get_eq;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_21__get_ne) < 0) __PYX_ERR(0, 1984, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_21__get_ne.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_21__get_ne.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_21__get_ne.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_21__get_ne.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_21__get_ne = &__pyx_type_6cymock___pyx_scope_struct_21__get_ne;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_22__get_iter) < 0) __PYX_ERR(0, 1993, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_22__get_iter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_22__get_iter.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_22__get_iter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_22__get_iter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_22__get_iter = &__pyx_type_6cymock___pyx_scope_struct_22__get_iter;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_23__get_async_iter) < 0) __PYX_ERR(0, 2003, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_23__get_async_iter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_23__get_async_iter.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_23__get_async_iter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_23__get_async_iter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_23__get_async_iter = &__pyx_type_6cymock___pyx_scope_struct_23__get_async_iter;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_24__execute_mock_call) < 0) __PYX_ERR(0, 2148, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_24__execute_mock_call.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_24__execute_mock_call.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_24__execute_mock_call.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_24__execute_mock_call.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_24__execute_mock_call = &__pyx_type_6cymock___pyx_scope_struct_24__execute_mock_call;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_25_assert_awaited_with) < 0) __PYX_ERR(0, 2205, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_25_assert_awaited_with.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_25_assert_awaited_with.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_25_assert_awaited_with.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_25_assert_awaited_with.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_25_assert_awaited_with = &__pyx_type_6cymock___pyx_scope_struct_25_assert_awaited_with;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_26_assert_has_awaits) < 0) __PYX_ERR(0, 2247, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_26_assert_has_awaits.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_26_assert_has_awaits.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_26_assert_has_awaits.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_26_assert_has_awaits.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_26_assert_has_awaits = &__pyx_type_6cymock___pyx_scope_struct_26_assert_has_awaits;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_27_genexpr) < 0) __PYX_ERR(0, 2260, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_27_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_27_genexpr.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_27_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_27_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_27_genexpr = &__pyx_type_6cymock___pyx_scope_struct_27_genexpr;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_28_genexpr) < 0) __PYX_ERR(0, 2261, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_28_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_28_genexpr.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_28_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_28_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_28_genexpr = &__pyx_type_6cymock___pyx_scope_struct_28_genexpr;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_29_mock_open) < 0) __PYX_ERR(0, 2772, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_29_mock_open.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_29_mock_open.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_29_mock_open.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_29_mock_open.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_29_mock_open = &__pyx_type_6cymock___pyx_scope_struct_29_mock_open;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_30__readline_side_effect) < 0) __PYX_ERR(0, 2797, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_30__readline_side_effect.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_30__readline_side_effect.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_30__readline_side_effect.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_30__readline_side_effect.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_30__readline_side_effect = &__pyx_type_6cymock___pyx_scope_struct_30__readline_side_effect;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_31__iter_side_effect) < 0) __PYX_ERR(0, 2802, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_31__iter_side_effect.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_31__iter_side_effect.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_31__iter_side_effect.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_31__iter_side_effect.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_31__iter_side_effect = &__pyx_type_6cymock___pyx_scope_struct_31__iter_side_effect;
  if (PyType_Ready(&__pyx_type_6cymock___pyx_scope_struct_32___anext__) < 0) __PYX_ERR(0, 2903, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6cymock___pyx_scope_struct_32___anext__.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6cymock___pyx_scope_struct_32___anext__.tp_dictoffset && __pyx_type_6cymock___pyx_scope_struct_32___anext__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6cymock___pyx_scope_struct_32___anext__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_6cymock___pyx_scope_struct_32___anext__ = &__pyx_type_6cymock___pyx_scope_struct_32___anext__;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initcymock(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initcymock(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_cymock(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_cymock(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_cymock(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'cymock' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cymock(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("cymock", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_cymock) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "cymock")) {
      if (unlikely(PyDict_SetItemString(modules, "cymock", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "cymock.pyx":12
 * 
 * __all__ = (
 *     'Mock',             # <<<<<<<<<<<<<<
 *     'MagicMock',
 *     'patch',
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_tuple__92) < 0) __PYX_ERR(0, 11, __pyx_L1_error)

  /* "cymock.pyx":30
 * 
 * 
 * __version__ = '1.0'             # <<<<<<<<<<<<<<
 * 
 * import asyncio
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_1_0) < 0) __PYX_ERR(0, 30, __pyx_L1_error)

  /* "cymock.pyx":32
 * __version__ = '1.0'
 * 
 * import asyncio             # <<<<<<<<<<<<<<
 * import contextlib
 * import io
 */
  __pyx_t_1 = __Pyx_patch_asyncio(__Pyx_Import(__pyx_n_s_asyncio, 0, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":33
 * 
 * import asyncio
 * import contextlib             # <<<<<<<<<<<<<<
 * import io
 * import inspect
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_contextlib, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_contextlib, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":34
 * import asyncio
 * import contextlib
 * import io             # <<<<<<<<<<<<<<
 * import inspect
 * import pprint
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_io, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_io, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":35
 * import contextlib
 * import io
 * import inspect             # <<<<<<<<<<<<<<
 * import pprint
 * import sys
 */
  __pyx_t_1 = __Pyx_patch_inspect(__Pyx_Import(__pyx_n_s_inspect, 0, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inspect, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":36
 * import io
 * import inspect
 * import pprint             # <<<<<<<<<<<<<<
 * import sys
 * import builtins
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pprint, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pprint, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":37
 * import inspect
 * import pprint
 * import sys             # <<<<<<<<<<<<<<
 * import builtins
 * from types import CodeType, ModuleType, MethodType
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":38
 * import pprint
 * import sys
 * import builtins             # <<<<<<<<<<<<<<
 * from types import CodeType, ModuleType, MethodType
 * from unittest.util import safe_repr
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_builtins_3, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtins_3, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":39
 * import sys
 * import builtins
 * from types import CodeType, ModuleType, MethodType             # <<<<<<<<<<<<<<
 * from unittest.util import safe_repr
 * from functools import wraps, partial
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_CodeType);
  __Pyx_GIVEREF(__pyx_n_s_CodeType);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_CodeType);
  __Pyx_INCREF(__pyx_n_s_ModuleType);
  __Pyx_GIVEREF(__pyx_n_s_ModuleType);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ModuleType);
  __Pyx_INCREF(__pyx_n_s_MethodType);
  __Pyx_GIVEREF(__pyx_n_s_MethodType);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_MethodType);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_types, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CodeType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CodeType, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ModuleType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ModuleType, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MethodType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MethodType, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":40
 * import builtins
 * from types import CodeType, ModuleType, MethodType
 * from unittest.util import safe_repr             # <<<<<<<<<<<<<<
 * from functools import wraps, partial
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_safe_repr);
  __Pyx_GIVEREF(__pyx_n_s_safe_repr);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_safe_repr);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_unittest_util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_safe_repr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_repr, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":41
 * from types import CodeType, ModuleType, MethodType
 * from unittest.util import safe_repr
 * from functools import wraps, partial             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_wraps);
  __Pyx_GIVEREF(__pyx_n_s_wraps);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_wraps);
  __Pyx_INCREF(__pyx_n_s_partial);
  __Pyx_GIVEREF(__pyx_n_s_partial);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_partial);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wraps, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partial, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":44
 * 
 * 
 * _builtins = {name for name in dir(builtins) if not name.startswith('_')}             # <<<<<<<<<<<<<<
 * 
 * FILTER_DIR = True
 */
  { /* enter inner scope */
    __pyx_t_2 = PySet_New(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Dir(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L4_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 44, __pyx_L4_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 44, __pyx_L4_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 44, __pyx_L4_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XGOTREF(__pyx_7genexpr__pyx_v_6cymock_name);
      __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_6cymock_name, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_6cymock_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_n_u__39) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u__39);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 44, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = ((!__pyx_t_8) != 0);
      if (__pyx_t_9) {
        if (unlikely(PySet_Add(__pyx_t_2, (PyObject*)__pyx_7genexpr__pyx_v_6cymock_name))) __PYX_ERR(0, 44, __pyx_L4_error)
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_7genexpr__pyx_v_6cymock_name);
    __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_6cymock_name, Py_None);
    goto __pyx_L8_exit_scope;
    __pyx_L4_error:;
    __Pyx_GOTREF(__pyx_7genexpr__pyx_v_6cymock_name);
    __Pyx_DECREF_SET(__pyx_7genexpr__pyx_v_6cymock_name, Py_None);
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtins_2, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":46
 * _builtins = {name for name in dir(builtins) if not name.startswith('_')}
 * 
 * FILTER_DIR = True             # <<<<<<<<<<<<<<
 * 
 * # Workaround for issue #12370
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FILTER_DIR, Py_True) < 0) __PYX_ERR(0, 46, __pyx_L1_error)

  /* "cymock.pyx":50
 * # Workaround for issue #12370
 * # Without this, the __class__ properties wouldn't be set correctly
 * _safe_super = super             # <<<<<<<<<<<<<<
 * 
 * def _is_async_obj(obj):
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_super, __pyx_builtin_super) < 0) __PYX_ERR(0, 50, __pyx_L1_error)

  /* "cymock.pyx":52
 * _safe_super = super
 * 
 * def _is_async_obj(obj):             # <<<<<<<<<<<<<<
 *     if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
 *         return False
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_1_is_async_obj, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_async_obj, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":60
 * 
 * 
 * def _is_async_func(func):             # <<<<<<<<<<<<<<
 *     if getattr(func, '__code__', None):
 *         return asyncio.iscoroutinefunction(func)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_3_is_async_func, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_async_func, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":67
 * 
 * 
 * def _is_instance_mock(obj):             # <<<<<<<<<<<<<<
 *     # can't use isinstance on Mock objects because they override __class__
 *     # The base class for all mocks is NonCallableMock
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_5_is_instance_mock, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_instance_mock, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":73
 * 
 * 
 * def _is_exception(obj):             # <<<<<<<<<<<<<<
 *     return (
 *         isinstance(obj, BaseException) or
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_7_is_exception, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_exception, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":80
 * 
 * 
 * def _extract_mock(obj):             # <<<<<<<<<<<<<<
 *     # Autospecced functions will return a FunctionType with "mock" attribute
 *     # which is the actual mock object that needs to be used.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_9_extract_mock, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_mock, __pyx_t_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":89
 * 
 * 
 * def _get_signature_object(func, as_instance, eat_self):             # <<<<<<<<<<<<<<
 *     """
 *     Given an arbitrary, possibly callable object, try to create a suitable
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_11_get_signature_object, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_signature_object, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":118
 * 
 * 
 * def _check_signature(func, mock, skipfirst, instance=False):             # <<<<<<<<<<<<<<
 *     sig = _get_signature_object(func, instance, skipfirst)
 *     if sig is None:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_13_check_signature, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_signature, __pyx_t_2) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":130
 * 
 * 
 * def _copy_func_details(func, funcopy):             # <<<<<<<<<<<<<<
 *     # we explicitly don't copy func.__dict__ into this copy as it would
 *     # expose original attributes that should be mocked
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_15_copy_func_details, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_func_details, __pyx_t_2) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":143
 * 
 * 
 * def _callable(obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, type):
 *         return True
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_17_callable, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_callable, __pyx_t_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":153
 * 
 * 
 * def _is_list(obj):             # <<<<<<<<<<<<<<
 *     # checks for list or tuples
 *     # XXXX badly named!
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_19_is_list, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_list, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":159
 * 
 * 
 * def _instance_callable(obj):             # <<<<<<<<<<<<<<
 *     """Given an object, return True if the object is callable.
 *     For classes, return True if instances would be callable."""
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_21_instance_callable, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_instance_callable, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":174
 * 
 * 
 * def _set_signature(mock, original, instance=False):             # <<<<<<<<<<<<<<
 *     # creates a function with signature (*args, **kwargs) that delegates to a
 *     # mock. It still does signature checking by calling a lambda with the same
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_23_set_signature, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_signature, __pyx_t_2) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":201
 * 
 * 
 * def _setup_func(funcopy, mock, sig):             # <<<<<<<<<<<<<<
 *     funcopy.mock = mock
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_25_setup_func, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setup_func, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":250
 * 
 * 
 * def _setup_async_mock(mock):             # <<<<<<<<<<<<<<
 *     mock._is_coroutine = asyncio.coroutines._is_coroutine
 *     mock.await_count = 0
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_27_setup_async_mock, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setup_async_mock, __pyx_t_2) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":277
 * 
 * 
 * def _is_magic(name):             # <<<<<<<<<<<<<<
 *     return '__%s__' % name[2:-2] == name
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_29_is_magic, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_magic, __pyx_t_2) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":281
 * 
 * 
 * class _SentinelObject(object):             # <<<<<<<<<<<<<<
 *     "A unique, named, sentinel object."
 *     def __init__(self, name):
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__123); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__123, __pyx_n_s_SentinelObject, __pyx_n_s_SentinelObject, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_A_unique_named_sentinel_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymock.pyx":283
 * class _SentinelObject(object):
 *     "A unique, named, sentinel object."
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15_SentinelObject_1__init__, 0, __pyx_n_s_SentinelObject___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":286
 *         self.name = name
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel.%s' % self.name
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15_SentinelObject_3__repr__, 0, __pyx_n_s_SentinelObject___repr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_repr, __pyx_t_3) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":289
 *         return 'sentinel.%s' % self.name
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel.%s' % self.name
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15_SentinelObject_5__reduce__, 0, __pyx_n_s_SentinelObject___reduce, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_reduce, __pyx_t_3) < 0) __PYX_ERR(0, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":281
 * 
 * 
 * class _SentinelObject(object):             # <<<<<<<<<<<<<<
 *     "A unique, named, sentinel object."
 *     def __init__(self, name):
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SentinelObject, __pyx_tuple__123, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SentinelObject, __pyx_t_3) < 0) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":293
 * 
 * 
 * class _Sentinel(object):             # <<<<<<<<<<<<<<
 *     """Access attributes to return a named object, usable as a sentinel."""
 *     def __init__(self):
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__130); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__130, __pyx_n_s_Sentinel, __pyx_n_s_Sentinel, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_Access_attributes_to_return_a_na); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymock.pyx":295
 * class _Sentinel(object):
 *     """Access attributes to return a named object, usable as a sentinel."""
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self._sentinels = {}
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9_Sentinel_1__init__, 0, __pyx_n_s_Sentinel___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":298
 *         self._sentinels = {}
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name == '__bases__':
 *             # Without this help(unittest.mock) raises an exception
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9_Sentinel_3__getattr__, 0, __pyx_n_s_Sentinel___getattr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_getattr, __pyx_t_3) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":304
 *         return self._sentinels.setdefault(name, _SentinelObject(name))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return 'sentinel'
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9_Sentinel_5__reduce__, 0, __pyx_n_s_Sentinel___reduce, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_reduce, __pyx_t_3) < 0) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":293
 * 
 * 
 * class _Sentinel(object):             # <<<<<<<<<<<<<<
 *     """Access attributes to return a named object, usable as a sentinel."""
 *     def __init__(self):
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Sentinel, __pyx_tuple__130, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Sentinel, __pyx_t_3) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":308
 * 
 * 
 * sentinel = _Sentinel()             # <<<<<<<<<<<<<<
 * 
 * DEFAULT = sentinel.DEFAULT
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sentinel, __pyx_t_1) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":310
 * sentinel = _Sentinel()
 * 
 * DEFAULT = sentinel.DEFAULT             # <<<<<<<<<<<<<<
 * _missing = sentinel.MISSING
 * _deleted = sentinel.DELETED
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sentinel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT, __pyx_t_2) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":311
 * 
 * DEFAULT = sentinel.DEFAULT
 * _missing = sentinel.MISSING             # <<<<<<<<<<<<<<
 * _deleted = sentinel.DELETED
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MISSING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_missing, __pyx_t_1) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":312
 * DEFAULT = sentinel.DEFAULT
 * _missing = sentinel.MISSING
 * _deleted = sentinel.DELETED             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sentinel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DELETED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deleted, __pyx_t_2) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":316
 * 
 * _allowed_names = {
 *     'return_value', '_mock_return_value', 'side_effect',             # <<<<<<<<<<<<<<
 *     '_mock_side_effect', '_mock_parent', '_mock_new_parent',
 *     '_mock_name', '_mock_new_name'
 */
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PySet_Add(__pyx_t_2, __pyx_n_u_return_value) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_n_u_mock_return_value) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_n_u_side_effect) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_n_u_mock_side_effect) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_n_u_mock_parent) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_n_u_mock_new_parent) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_n_u_mock_name) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_n_u_mock_new_name) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_allowed_names, __pyx_t_2) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":322
 * 
 * 
 * def _delegating_property(name):             # <<<<<<<<<<<<<<
 *     _allowed_names.add(name)
 *     _the_name = '_mock_' + name
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_31_delegating_property, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_delegating_property, __pyx_t_2) < 0) __PYX_ERR(0, 322, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":341
 * 
 * 
 * class _CallList(list):             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, value):
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)(&PyList_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyList_Type)));
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_CallList, __pyx_n_s_CallList, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":343
 * class _CallList(list):
 * 
 *     def __contains__(self, value):             # <<<<<<<<<<<<<<
 *         if not isinstance(value, list):
 *             return list.__contains__(self, value)
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9_CallList_1__contains__, 0, __pyx_n_s_CallList___contains, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_contains, __pyx_t_6) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":357
 *         return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return pprint.pformat(list(self))
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9_CallList_3__repr__, 0, __pyx_n_s_CallList___repr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_6) < 0) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":341
 * 
 * 
 * class _CallList(list):             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, value):
 */
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CallList, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CallList, __pyx_t_6) < 0) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":361
 * 
 * 
 * def _check_and_set_parent(parent, value, name, new_name):             # <<<<<<<<<<<<<<
 *     value = _extract_mock(value)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_33_check_and_set_parent, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_and_set_parent, __pyx_t_2) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":388
 * 
 * # Internal class to identify if we wrapped an iterator object or not.
 * class _MockIter(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, obj):
 *         self.obj = iter(obj)
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__145); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__145, __pyx_n_s_MockIter, __pyx_n_s_MockIter, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymock.pyx":389
 * # Internal class to identify if we wrapped an iterator object or not.
 * class _MockIter(object):
 *     def __init__(self, obj):             # <<<<<<<<<<<<<<
 *         self.obj = iter(obj)
 *     def __next__(self):
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9_MockIter_1__init__, 0, __pyx_n_s_MockIter___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":391
 *     def __init__(self, obj):
 *         self.obj = iter(obj)
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return next(self.obj)
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9_MockIter_3__next__, 0, __pyx_n_s_MockIter___next, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_next, __pyx_t_3) < 0) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":388
 * 
 * # Internal class to identify if we wrapped an iterator object or not.
 * class _MockIter(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, obj):
 *         self.obj = iter(obj)
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MockIter, __pyx_tuple__145, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MockIter, __pyx_t_3) < 0) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":394
 *         return next(self.obj)
 * 
 * class Base(object):             # <<<<<<<<<<<<<<
 *     _mock_return_value = DEFAULT
 *     _mock_side_effect = None
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__150); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__150, __pyx_n_s_Base, __pyx_n_s_Base, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymock.pyx":395
 * 
 * class Base(object):
 *     _mock_return_value = DEFAULT             # <<<<<<<<<<<<<<
 *     _mock_side_effect = None
 *     def __init__(self, *args, **kwargs):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_mock_return_value, __pyx_t_3) < 0) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":396
 * class Base(object):
 *     _mock_return_value = DEFAULT
 *     _mock_side_effect = None             # <<<<<<<<<<<<<<
 *     def __init__(self, *args, **kwargs):
 *         pass
 */
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_mock_side_effect, Py_None) < 0) __PYX_ERR(0, 396, __pyx_L1_error)

  /* "cymock.pyx":397
 *     _mock_return_value = DEFAULT
 *     _mock_side_effect = None
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_4Base_1__init__, 0, __pyx_n_s_Base___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":394
 *         return next(self.obj)
 * 
 * class Base(object):             # <<<<<<<<<<<<<<
 *     _mock_return_value = DEFAULT
 *     _mock_side_effect = None
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Base, __pyx_tuple__150, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Base, __pyx_t_3) < 0) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":402
 * 
 * 
 * class NonCallableMock(Base):             # <<<<<<<<<<<<<<
 *     """A non-callable version of `Mock`"""
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_NonCallableMock, __pyx_n_s_NonCallableMock, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_A_non_callable_version_of_Mock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":405
 *     """A non-callable version of `Mock`"""
 * 
 *     def __new__(cls, *args, **kw):             # <<<<<<<<<<<<<<
 *         # every instance has its own class
 *         # so we can create magic methods on the
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_NonCallableMock___new, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_new, __pyx_t_6) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":427
 * 
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, spec=None, wraps=None, name=None, spec_set=None,
 *             parent=None, _spec_state=None, _new_name='', _new_parent=None,
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_3__init__, 0, __pyx_n_s_NonCallableMock___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__157);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":472
 * 
 * 
 *     def attach_mock(self, mock, attribute):             # <<<<<<<<<<<<<<
 *         """
 *         Attach a mock as an attribute of this one, replacing its name and
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_5attach_mock, 0, __pyx_n_s_NonCallableMock_attach_mock, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_attach_mock, __pyx_t_6) < 0) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":487
 * 
 * 
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_7mock_add_spec, 0, __pyx_n_s_NonCallableMock_mock_add_spec, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__162);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_mock_add_spec_2, __pyx_t_6) < 0) __PYX_ERR(0, 487, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":496
 * 
 * 
 *     def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,             # <<<<<<<<<<<<<<
 *                        _eat_self=False):
 *         _spec_class = None
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_9_mock_add_spec, 0, __pyx_n_s_NonCallableMock__mock_add_spec, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__165);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_mock_add_spec, __pyx_t_6) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":524
 *         __dict__['_spec_asyncs'] = _spec_asyncs
 * 
 *     def __get_return_value(self):             # <<<<<<<<<<<<<<
 *         ret = self._mock_return_value
 *         if self._mock_delegate is not None:
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_11__get_return_value, 0, __pyx_n_s_NonCallableMock___get_return_val, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NonCallableMock__get_return_val, __pyx_t_6) < 0) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":537
 * 
 * 
 *     def __set_return_value(self, value):             # <<<<<<<<<<<<<<
 *         if self._mock_delegate is not None:
 *             self._mock_delegate.return_value = value
 */
  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_13__set_return_value, 0, __pyx_n_s_NonCallableMock___set_return_val, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NonCallableMock__set_return_val, __pyx_t_6) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "cymock.pyx":544
 *             _check_and_set_parent(self, value, None, '()')
 * 
 *     __return_value_doc = "The value to be returned when the mock is called."             # <<<<<<<<<<<<<<
 *     return_value = property(__get_return_value, __set_return_value,
 *                             __return_value_doc)
 */
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NonCallableMock__return_value_d, __pyx_kp_u_The_value_to_be_returned_when_th) < 0) __PYX_ERR(0, 544, __pyx_L1_error)

  /* "cymock.pyx":545
 * 
 *     __return_value_doc = "The value to be returned when the mock is called."
 *     return_value = property(__get_return_value, __set_return_value,             # <<<<<<<<<<<<<<
 *                             __return_value_doc)
 * 
 */
  __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NonCallableMock__get_return_val);
  if (unlikely(!__pyx_t_6)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NonCallableMock__get_return_val);
  }
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NonCallableMock__set_return_val);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NonCallableMock__set_return_val);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cymock.pyx":546
 *     __return_value_doc = "The value to be returned when the mock is called."
 *     return_value = property(__get_return_value, __set_return_value,
 *                             __return_value_doc)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NonCallableMock__return_value_d);
  if (unlikely(!__pyx_t_10)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NonCallableMock__return_value_d);
  }
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cymock.pyx":545
 * 
 *     __return_value_doc = "The value to be returned when the mock is called."
 *     return_value = property(__get_return_value, __set_return_value,             # <<<<<<<<<<<<<<
 *                             __return_value_doc)
 * 
 */
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_return_value, __pyx_t_10) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":550
 * 
 *     @property
 *     def __class__(self):             # <<<<<<<<<<<<<<
 *         if self._spec_class is None:
 *             return type(self)
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_15__class__, 0, __pyx_n_s_NonCallableMock___class, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cymock.pyx":549
 * 
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def __class__(self):
 *         if self._spec_class is None:
 */
  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_class, __pyx_t_11) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":555
 *         return self._spec_class
 * 
 *     called = _delegating_property('called')             # <<<<<<<<<<<<<<
 *     call_count = _delegating_property('call_count')
 *     call_args = _delegating_property('call_args')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_delegating_property); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_n_u_called) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_n_u_called);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_called, __pyx_t_11) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":556
 * 
 *     called = _delegating_property('called')
 *     call_count = _delegating_property('call_count')             # <<<<<<<<<<<<<<
 *     call_args = _delegating_property('call_args')
 *     call_args_list = _delegating_property('call_args_list')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_delegating_property); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_n_u_call_count) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_n_u_call_count);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_call_count, __pyx_t_11) < 0) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":557
 *     called = _delegating_property('called')
 *     call_count = _delegating_property('call_count')
 *     call_args = _delegating_property('call_args')             # <<<<<<<<<<<<<<
 *     call_args_list = _delegating_property('call_args_list')
 *     mock_calls = _delegating_property('mock_calls')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_delegating_property); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_n_u_call_args) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_n_u_call_args);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_call_args, __pyx_t_11) < 0) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":558
 *     call_count = _delegating_property('call_count')
 *     call_args = _delegating_property('call_args')
 *     call_args_list = _delegating_property('call_args_list')             # <<<<<<<<<<<<<<
 *     mock_calls = _delegating_property('mock_calls')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_delegating_property); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_n_u_call_args_list) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_n_u_call_args_list);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_call_args_list, __pyx_t_11) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":559
 *     call_args = _delegating_property('call_args')
 *     call_args_list = _delegating_property('call_args_list')
 *     mock_calls = _delegating_property('mock_calls')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_delegating_property); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_n_u_mock_calls) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_n_u_mock_calls);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_mock_calls, __pyx_t_11) < 0) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":562
 * 
 * 
 *     def __get_side_effect(self):             # <<<<<<<<<<<<<<
 *         delegated = self._mock_delegate
 *         if delegated is None:
 */
  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_17__get_side_effect, 0, __pyx_n_s_NonCallableMock___get_side_effec, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NonCallableMock__get_side_effec, __pyx_t_11) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":573
 *         return sf
 * 
 *     def __set_side_effect(self, value):             # <<<<<<<<<<<<<<
 *         value = _try_iter(value)
 *         delegated = self._mock_delegate
 */
  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_19__set_side_effect, 0, __pyx_n_s_NonCallableMock___set_side_effec, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NonCallableMock__set_side_effec, __pyx_t_11) < 0) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":581
 *             delegated.side_effect = value
 * 
 *     side_effect = property(__get_side_effect, __set_side_effect)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NonCallableMock__get_side_effec);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NonCallableMock__get_side_effec);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NonCallableMock__set_side_effec);
  if (unlikely(!__pyx_t_10)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NonCallableMock__set_side_effec);
  }
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10);
  __pyx_t_11 = 0;
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_side_effect, __pyx_t_10) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":584
 * 
 * 
 *     def reset_mock(self,  visited=None,*, return_value=False, side_effect=False):             # <<<<<<<<<<<<<<
 *         "Restore the mock object to its initial state."
 *         if visited is None:
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return_value, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_side_effect, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_21reset_mock, 0, __pyx_n_s_NonCallableMock_reset_mock, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__178);
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_reset_mock, __pyx_t_7) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":614
 * 
 * 
 *     def configure_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """Set attributes on the mock through keyword arguments.
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_23configure_mock, 0, __pyx_n_s_NonCallableMock_configure_mock, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_configure_mock, __pyx_t_7) < 0) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":636
 * 
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name in {'_mock_methods', '_mock_unsafe'}:
 *             raise AttributeError(name)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_25__getattr__, 0, __pyx_n_s_NonCallableMock___getattr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getattr, __pyx_t_7) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":675
 * 
 * 
 *     def _extract_mock_name(self):             # <<<<<<<<<<<<<<
 *         _name_list = [self._mock_new_name]
 *         _parent = self._mock_new_parent
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_27_extract_mock_name, 0, __pyx_n_s_NonCallableMock__extract_mock_na, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_extract_mock_name, __pyx_t_7) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":702
 *         return ''.join(_name_list)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         name = self._extract_mock_name()
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_29__repr__, 0, __pyx_n_s_NonCallableMock___repr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":723
 * 
 * 
 *     def __dir__(self):             # <<<<<<<<<<<<<<
 *         """Filter the output of `dir(mock)` to only useful members."""
 *         if not FILTER_DIR:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_31__dir__, 0, __pyx_n_s_NonCallableMock___dir, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_dir, __pyx_t_7) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":741
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         if name in _allowed_names:
 *             # property setters go through here
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_33__setattr__, 0, __pyx_n_s_NonCallableMock___setattr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setattr, __pyx_t_7) < 0) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":780
 * 
 * 
 *     def __delattr__(self, name):             # <<<<<<<<<<<<<<
 *         if name in _all_magics and name in type(self).__dict__:
 *             delattr(type(self), name)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_35__delattr__, 0, __pyx_n_s_NonCallableMock___delattr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_delattr, __pyx_t_7) < 0) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":798
 * 
 * 
 *     def _format_mock_call_signature(self, args, kwargs):             # <<<<<<<<<<<<<<
 *         name = self._mock_name or 'mock'
 *         return _format_call_signature(name, args, kwargs)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_37_format_mock_call_signature, 0, __pyx_n_s_NonCallableMock__format_mock_cal, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_format_mock_call_signature, __pyx_t_7) < 0) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":803
 * 
 * 
 *     def _format_mock_failure_message(self, args, kwargs, action='call'):             # <<<<<<<<<<<<<<
 *         message = 'expected %s not found.\nExpected: %s\nActual: %s'
 *         expected_string = self._format_mock_call_signature(args, kwargs)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_39_format_mock_failure_message, 0, __pyx_n_s_NonCallableMock__format_mock_fai, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__197);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_format_mock_failure_message, __pyx_t_7) < 0) __PYX_ERR(0, 803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":811
 * 
 * 
 *     def _get_call_signature_from_name(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         * If call objects are asserted against a method/function like obj.meth1
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_41_get_call_signature_from_name, 0, __pyx_n_s_NonCallableMock__get_call_signat, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_call_signature_from_name, __pyx_t_7) < 0) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":844
 * 
 * 
 *     def _call_matcher(self, _call):             # <<<<<<<<<<<<<<
 *         """
 *         Given a call (or simply an (args, kwargs) tuple), return a
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_43_call_matcher, 0, __pyx_n_s_NonCallableMock__call_matcher, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_call_matcher, __pyx_t_7) < 0) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":870
 *             return _call
 * 
 *     def assert_not_called(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was never called.
 *         """
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_45assert_not_called, 0, __pyx_n_s_NonCallableMock_assert_not_calle, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_assert_not_called, __pyx_t_7) < 0) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":880
 *             raise AssertionError(msg)
 * 
 *     def assert_called(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called at least once
 *         """
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_47assert_called, 0, __pyx_n_s_NonCallableMock_assert_called, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_assert_called, __pyx_t_7) < 0) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":888
 *             raise AssertionError(msg)
 * 
 *     def assert_called_once(self):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called only once.
 *         """
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_49assert_called_once, 0, __pyx_n_s_NonCallableMock_assert_called_on, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_assert_called_once, __pyx_t_7) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":898
 *             raise AssertionError(msg)
 * 
 *     def assert_called_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the last call was made with the specified arguments.
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_51assert_called_with, 0, __pyx_n_s_NonCallableMock_assert_called_wi_2, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_assert_called_with, __pyx_t_7) < 0) __PYX_ERR(0, 898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":920
 * 
 * 
 *     def assert_called_once_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert that the mock was called exactly once and that that call was
 *         with the specified arguments."""
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_53assert_called_once_with, 0, __pyx_n_s_NonCallableMock_assert_called_on_2, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_assert_called_once_with, __pyx_t_7) < 0) __PYX_ERR(0, 920, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":932
 * 
 * 
 *     def assert_has_calls(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified calls.
 *         The `mock_calls` list is checked for the calls.
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_55assert_has_calls, 0, __pyx_n_s_NonCallableMock_assert_has_calls_2, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__214);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_assert_has_calls, __pyx_t_7) < 0) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":977
 * 
 * 
 *     def assert_any_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """assert the mock has been called with the specified arguments.
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_57assert_any_call, 0, __pyx_n_s_NonCallableMock_assert_any_call, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_assert_any_call, __pyx_t_7) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":993
 * 
 * 
 *     def _get_child_mock(self, **kw):             # <<<<<<<<<<<<<<
 *         """Create the child mocks for attributes and return value.
 *         By default child mocks will be the same type as the parent.
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_59_get_child_mock, 0, __pyx_n_s_NonCallableMock__get_child_mock, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_child_mock, __pyx_t_7) < 0) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1032
 * 
 * 
 *     def _calls_repr(self, prefix="Calls"):             # <<<<<<<<<<<<<<
 *         """Renders self.mock_calls as a string.
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15NonCallableMock_61_calls_repr, 0, __pyx_n_s_NonCallableMock__calls_repr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__221);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_calls_repr, __pyx_t_7) < 0) __PYX_ERR(0, 1032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":402
 * 
 * 
 * class NonCallableMock(Base):             # <<<<<<<<<<<<<<
 *     """A non-callable version of `Mock`"""
 * 
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_NonCallableMock, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NonCallableMock, __pyx_t_7) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1046
 * 
 * 
 * def _try_iter(obj):             # <<<<<<<<<<<<<<
 *     if obj is None:
 *         return obj
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6cymock_35_try_iter, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_try_iter, __pyx_t_1) < 0) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1061
 * 
 * 
 * class CallableMixin(Base):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_CallableMixin, __pyx_n_s_CallableMixin, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":1063
 * class CallableMixin(Base):
 * 
 *     def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,             # <<<<<<<<<<<<<<
 *                  wraps=None, name=None, spec_set=None, parent=None,
 *                  _spec_state=None, _new_name='', _new_parent=None, **kwargs):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_13CallableMixin_1__init__, 0, __pyx_n_s_CallableMixin___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_7)->__pyx_arg_return_value = __pyx_t_10;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_6cymock_86__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1075
 * 
 * 
 *     def _mock_check_sig(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # stub method that can be replaced with one with a specific signature
 *         pass
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_13CallableMixin_3_mock_check_sig, 0, __pyx_n_s_CallableMixin__mock_check_sig, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_mock_check_sig, __pyx_t_7) < 0) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1080
 * 
 * 
 *     def __call__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # can't use self in-case a function / method we are mocking uses self
 *         # in the signature
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_13CallableMixin_5__call__, 0, __pyx_n_s_CallableMixin___call, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_call, __pyx_t_7) < 0) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1088
 * 
 * 
 *     def _mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self._execute_mock_call(*args, **kwargs)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_13CallableMixin_7_mock_call, 0, __pyx_n_s_CallableMixin__mock_call, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_mock_call, __pyx_t_7) < 0) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1091
 *         return self._execute_mock_call(*args, **kwargs)
 * 
 *     def _increment_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.called = True
 *         self.call_count += 1
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_13CallableMixin_9_increment_mock_call, 0, __pyx_n_s_CallableMixin__increment_mock_ca, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_increment_mock_call, __pyx_t_7) < 0) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1137
 *             _new_parent = _new_parent._mock_new_parent
 * 
 *     def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # separate from _increment_mock_call so that awaited functions are
 *         # executed separately from their call, also AsyncMock overrides this method
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_13CallableMixin_11_execute_mock_call, 0, __pyx_n_s_CallableMixin__execute_mock_call, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_execute_mock_call, __pyx_t_7) < 0) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1061
 * 
 * 
 * class CallableMixin(Base):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_CallableMixin, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CallableMixin, __pyx_t_7) < 0) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1165
 * 
 * 
 * class Mock(CallableMixin, NonCallableMock):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new `Mock` object. `Mock` takes several optional arguments
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CallableMixin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_Mock, __pyx_n_s_Mock, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_Create_a_new_Mock_object_Mock_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Mock, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Mock, __pyx_t_7) < 0) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1217
 * 
 * 
 * def _dot_lookup(thing, comp, import_path):             # <<<<<<<<<<<<<<
 *     try:
 *         return getattr(thing, comp)
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_37_dot_lookup, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dot_lookup, __pyx_t_3) < 0) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1225
 * 
 * 
 * def _importer(target):             # <<<<<<<<<<<<<<
 *     components = target.split('.')
 *     import_path = components.pop(0)
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_39_importer, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_importer, __pyx_t_3) < 0) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1236
 * 
 * 
 * def _is_started(patcher):             # <<<<<<<<<<<<<<
 *     # XXXX horrible
 *     return hasattr(patcher, 'is_local')
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_41_is_started, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_started, __pyx_t_3) < 0) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1241
 * 
 * 
 * class _patch(object):             # <<<<<<<<<<<<<<
 * 
 *     attribute_name = None
 */
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__242); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__242, __pyx_n_s_patch, __pyx_n_s_patch, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymock.pyx":1243
 * class _patch(object):
 * 
 *     attribute_name = None             # <<<<<<<<<<<<<<
 *     _active_patches = []
 * 
 */
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_attribute_name, Py_None) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)

  /* "cymock.pyx":1244
 * 
 *     attribute_name = None
 *     _active_patches = []             # <<<<<<<<<<<<<<
 * 
 *     def __init__(
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_active_patches, __pyx_t_2) < 0) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1246
 *     _active_patches = []
 * 
 *     def __init__(             # <<<<<<<<<<<<<<
 *             self, getter, attribute, new, spec, create,
 *             spec_set, autospec, new_callable, kwargs
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_1__init__, 0, __pyx_n_s_patch___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 1246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1273
 * 
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         patcher = _patch(
 *             self.getter, self.attribute, self.new, self.spec,
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_3copy, 0, __pyx_n_s_patch_copy, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1286
 * 
 * 
 *     def __call__(self, func):             # <<<<<<<<<<<<<<
 *         if isinstance(func, type):
 *             return self.decorate_class(func)
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_5__call__, 0, __pyx_n_s_patch___call, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1294
 * 
 * 
 *     def decorate_class(self, klass):             # <<<<<<<<<<<<<<
 *         for attr in dir(klass):
 *             if not attr.startswith(patch.TEST_PREFIX):
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_7decorate_class, 0, __pyx_n_s_patch_decorate_class, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_decorate_class, __pyx_t_2) < 0) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1308
 * 
 * 
 *     @contextlib.contextmanager             # <<<<<<<<<<<<<<
 *     def decoration_helper(self, patched, args, keywargs):
 *         extra_args = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_contextlib); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_contextmanager); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1309
 * 
 *     @contextlib.contextmanager
 *     def decoration_helper(self, patched, args, keywargs):             # <<<<<<<<<<<<<<
 *         extra_args = []
 *         entered_patchers = []
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_9decoration_helper, 0, __pyx_n_s_patch_decoration_helper, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_decoration_helper, __pyx_t_2) < 0) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1341
 * 
 * 
 *     def decorate_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_async_callable()
 *         if hasattr(func, 'patchings'):
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_12decorate_callable, 0, __pyx_n_s_patch_decorate_callable, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_decorate_callable, __pyx_t_2) < 0) __PYX_ERR(0, 1341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1358
 * 
 * 
 *     def decorate_async_callable(self, func):             # <<<<<<<<<<<<<<
 *         # NB. Keep the method in sync with decorate_callable()
 *         if hasattr(func, 'patchings'):
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_14decorate_async_callable, 0, __pyx_n_s_patch_decorate_async_callable, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_decorate_async_callable, __pyx_t_2) < 0) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1375
 * 
 * 
 *     def get_original(self):             # <<<<<<<<<<<<<<
 *         target = self.getter()
 *         name = self.attribute
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_16get_original, 0, __pyx_n_s_patch_get_original, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_get_original, __pyx_t_2) < 0) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1399
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Perform the patch."""
 *         new, spec, spec_set = self.new, self.spec, self.spec_set
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_18__enter__, 0, __pyx_n_s_patch___enter, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1529
 * 
 * 
 *     def __exit__(self, *exc_info):             # <<<<<<<<<<<<<<
 *         """Undo the patch."""
 *         if not _is_started(self):
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_20__exit__, 0, __pyx_n_s_patch___exit, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1553
 * 
 * 
 *     def start(self):             # <<<<<<<<<<<<<<
 *         """Activate a patch, returning any created mock."""
 *         result = self.__enter__()
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_22start, 0, __pyx_n_s_patch_start, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1560
 * 
 * 
 *     def stop(self):             # <<<<<<<<<<<<<<
 *         """Stop an active patch."""
 *         try:
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_6_patch_24stop, 0, __pyx_n_s_patch_stop, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1241
 * 
 * 
 * class _patch(object):             # <<<<<<<<<<<<<<
 * 
 *     attribute_name = None
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_patch, __pyx_tuple__242, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_patch, __pyx_t_2) < 0) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1572
 * 
 * 
 * def _get_target(target):             # <<<<<<<<<<<<<<
 *     try:
 *         target, attribute = target.rsplit('.', 1)
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_43_get_target, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_target, __pyx_t_3) < 0) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1583
 * 
 * def _patch_object(
 *         target, attribute, new=DEFAULT, spec=None,             # <<<<<<<<<<<<<<
 *         create=False, spec_set=None, autospec=None,
 *         new_callable=None, **kwargs
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_k__60 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cymock.pyx":1582
 * 
 * 
 * def _patch_object(             # <<<<<<<<<<<<<<
 *         target, attribute, new=DEFAULT, spec=None,
 *         create=False, spec_set=None, autospec=None,
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_45_patch_object, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_patch_object, __pyx_t_3) < 0) __PYX_ERR(0, 1582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1611
 * 
 * 
 * def _patch_multiple(target, spec=None, create=False, spec_set=None,             # <<<<<<<<<<<<<<
 *                     autospec=None, new_callable=None, **kwargs):
 *     """Perform multiple patches in a single call. It takes the object to be
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_47_patch_multiple, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_patch_multiple, __pyx_t_3) < 0) __PYX_ERR(0, 1611, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1660
 * 
 * 
 * class patch:             # <<<<<<<<<<<<<<
 * 
 *     def __new__(
 */
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_patch_2, __pyx_n_s_patch_2, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":1662
 * class patch:
 * 
 *     def __new__(             # <<<<<<<<<<<<<<
 *         cls,
 *         target,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5patch_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_patch___new, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 1662, __pyx_L1_error)

  /* "cymock.pyx":1665
 *         cls,
 *         target,
 *         new=DEFAULT,             # <<<<<<<<<<<<<<
 *         spec=None,
 *         create=False,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_new = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_6cymock_88__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_new, __pyx_t_1) < 0) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1660
 * 
 * 
 * class patch:             # <<<<<<<<<<<<<<
 * 
 *     def __new__(
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_patch_2, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_patch_2, __pyx_t_1) < 0) __PYX_ERR(0, 1660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1746
 * 
 * 
 * class _patch_dict(object):             # <<<<<<<<<<<<<<
 *     """
 *     Patch a dictionary, or dictionary like object, and restore the dictionary
 */
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__274); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__274, __pyx_n_s_patch_dict, __pyx_n_s_patch_dict, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_Patch_a_dictionary_or_dictionar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cymock.pyx":1775
 *     """
 * 
 *     def __init__(self, in_dict, values=(), clear=False, **kwargs):             # <<<<<<<<<<<<<<
 *         self.in_dict = in_dict
 *         # support any argument supported by dict(...) constructor
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_patch_dict_1__init__, 0, __pyx_n_s_patch_dict___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__276)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__277);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1784
 * 
 * 
 *     def __call__(self, f):             # <<<<<<<<<<<<<<
 *         if isinstance(f, type):
 *             return self.decorate_class(f)
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_patch_dict_3__call__, 0, __pyx_n_s_patch_dict___call, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 1784, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1798
 * 
 * 
 *     def decorate_class(self, klass):             # <<<<<<<<<<<<<<
 *         for attr in dir(klass):
 *             attr_value = getattr(klass, attr)
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_patch_dict_5decorate_class, 0, __pyx_n_s_patch_dict_decorate_class, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_decorate_class, __pyx_t_2) < 0) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1809
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Patch the dict."""
 *         self._patch_dict()
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_patch_dict_7__enter__, 0, __pyx_n_s_patch_dict___enter, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(0, 1809, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1815
 * 
 * 
 *     def _patch_dict(self):             # <<<<<<<<<<<<<<
 *         values = self.values
 *         if isinstance(self.in_dict, str):
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_patch_dict_9_patch_dict, 0, __pyx_n_s_patch_dict__patch_dict, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_patch_dict, __pyx_t_2) < 0) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1843
 * 
 * 
 *     def _unpatch_dict(self):             # <<<<<<<<<<<<<<
 *         in_dict = self.in_dict
 *         original = self._original
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_patch_dict_11_unpatch_dict, 0, __pyx_n_s_patch_dict__unpatch_dict, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_unpatch_dict, __pyx_t_2) < 0) __PYX_ERR(0, 1843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1856
 * 
 * 
 *     def __exit__(self, *args):             # <<<<<<<<<<<<<<
 *         """Unpatch the dict."""
 *         self._unpatch_dict()
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_11_patch_dict_13__exit__, 0, __pyx_n_s_patch_dict___exit, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1861
 *         return False
 * 
 *     start = __enter__             # <<<<<<<<<<<<<<
 *     stop = __exit__
 * 
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_enter);
  if (unlikely(!__pyx_t_2)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enter);
  }
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 1861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1862
 * 
 *     start = __enter__
 *     stop = __exit__             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_exit);
  if (unlikely(!__pyx_t_2)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_exit);
  }
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(0, 1862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":1746
 * 
 * 
 * class _patch_dict(object):             # <<<<<<<<<<<<<<
 *     """
 *     Patch a dictionary, or dictionary like object, and restore the dictionary
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_patch_dict, __pyx_tuple__274, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_patch_dict, __pyx_t_2) < 0) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1865
 * 
 * 
 * def _clear_dict(in_dict):             # <<<<<<<<<<<<<<
 *     try:
 *         in_dict.clear()
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_49_clear_dict, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear_dict, __pyx_t_3) < 0) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1874
 * 
 * 
 * def _patch_stopall():             # <<<<<<<<<<<<<<
 *     """Stop all active patches. LIFO to unroll nested patches."""
 *     for patch in reversed(_patch._active_patches):
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_51_patch_stopall, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_patch_stopall, __pyx_t_3) < 0) __PYX_ERR(0, 1874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1880
 * 
 * 
 * patch.object = _patch_object             # <<<<<<<<<<<<<<
 * patch.dict = _patch_dict
 * patch.multiple = _patch_multiple
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_patch_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_patch_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_object, __pyx_t_3) < 0) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1881
 * 
 * patch.object = _patch_object
 * patch.dict = _patch_dict             # <<<<<<<<<<<<<<
 * patch.multiple = _patch_multiple
 * patch.stopall = _patch_stopall
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_patch_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_patch_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_dict_2, __pyx_t_1) < 0) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1882
 * patch.object = _patch_object
 * patch.dict = _patch_dict
 * patch.multiple = _patch_multiple             # <<<<<<<<<<<<<<
 * patch.stopall = _patch_stopall
 * patch.TEST_PREFIX = 'test'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_patch_multiple); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_patch_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_multiple, __pyx_t_3) < 0) __PYX_ERR(0, 1882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cymock.pyx":1883
 * patch.dict = _patch_dict
 * patch.multiple = _patch_multiple
 * patch.stopall = _patch_stopall             # <<<<<<<<<<<<<<
 * patch.TEST_PREFIX = 'test'
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_patch_stopall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_patch_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_stopall, __pyx_t_1) < 0) __PYX_ERR(0, 1883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1884
 * patch.multiple = _patch_multiple
 * patch.stopall = _patch_stopall
 * patch.TEST_PREFIX = 'test'             # <<<<<<<<<<<<<<
 * 
 * magic_methods = (
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_patch_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_TEST_PREFIX, __pyx_n_u_test) < 0) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1887
 * 
 * magic_methods = (
 *     "lt le gt ge eq ne "             # <<<<<<<<<<<<<<
 *     "getitem setitem delitem "
 *     "len contains iter "
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_magic_methods, __pyx_kp_u_lt_le_gt_ge_eq_ne_getitem_setite) < 0) __PYX_ERR(0, 1886, __pyx_L1_error)

  /* "cymock.pyx":1903
 * 
 * numerics = (
 *     "add sub mul matmul div floordiv mod lshift rshift and xor or pow truediv"             # <<<<<<<<<<<<<<
 * )
 * inplace = ' '.join('i%s' % n for n in numerics.split())
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numerics, __pyx_kp_u_add_sub_mul_matmul_div_floordiv) < 0) __PYX_ERR(0, 1902, __pyx_L1_error)

  /* "cymock.pyx":1905
 *     "add sub mul matmul div floordiv mod lshift rshift and xor or pow truediv"
 * )
 * inplace = ' '.join('i%s' % n for n in numerics.split())             # <<<<<<<<<<<<<<
 * right = ' '.join('r%s' % n for n in numerics.split())
 * 
 */
  __pyx_t_3 = __pyx_pf_6cymock_76genexpr(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__294, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_inplace, __pyx_t_3) < 0) __PYX_ERR(0, 1905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1906
 * )
 * inplace = ' '.join('i%s' % n for n in numerics.split())
 * right = ' '.join('r%s' % n for n in numerics.split())             # <<<<<<<<<<<<<<
 * 
 * # not including __prepare__, __instancecheck__, __subclasscheck__
 */
  __pyx_t_3 = __pyx_pf_6cymock_79genexpr(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__294, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_right, __pyx_t_3) < 0) __PYX_ERR(0, 1906, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1913
 * 
 * _non_defaults = {
 *     '__get__', '__set__', '__delete__', '__reversed__', '__missing__',             # <<<<<<<<<<<<<<
 *     '__reduce__', '__reduce_ex__', '__getinitargs__', '__getnewargs__',
 *     '__getstate__', '__setstate__', '__getformat__', '__setformat__',
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PySet_Add(__pyx_t_3, __pyx_n_u_get_3) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_set_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_delete) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_reversed_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_missing_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_reduce) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_reduce_ex) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_getinitargs) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_getnewargs) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_getstate) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_setstate) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_getformat) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_setformat) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_repr) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_dir) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_subclasses) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_format_2) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_getnewargs_ex) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_non_defaults, __pyx_t_3) < 0) __PYX_ERR(0, 1912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1921
 * 
 * 
 * def _get_method(name, func):             # <<<<<<<<<<<<<<
 *     "Turns a callable object (like a mock) into a real function"
 *     def method(self, *args, **kw):
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_53_get_method, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_method, __pyx_t_3) < 0) __PYX_ERR(0, 1921, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1929
 * 
 * 
 * _magics = {             # <<<<<<<<<<<<<<
 *     '__%s__' % method for method in
 *     ' '.join([magic_methods, numerics, inplace, right]).split()
 */
  { /* enter inner scope */
    __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1929, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "cymock.pyx":1931
 * _magics = {
 *     '__%s__' % method for method in
 *     ' '.join([magic_methods, numerics, inplace, right]).split()             # <<<<<<<<<<<<<<
 * }
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_magic_methods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1931, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numerics); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1931, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_inplace); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1931, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_right); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1931, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = PyList_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1931, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_10);
    PyList_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_11, 3, __pyx_t_7);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_10 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__294, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1931, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyUnicode_Split(((PyObject*)__pyx_t_7), ((PyObject *)NULL), -1L); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1931, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_t_11; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_7)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_11 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1931, __pyx_L11_error)
      #else
      __pyx_t_11 = PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1931, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_11);
      #endif
      __Pyx_XGOTREF(__pyx_9genexpr13__pyx_v_6cymock_method);
      __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_6cymock_method, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_t_11 = 0;

      /* "cymock.pyx":1930
 * 
 * _magics = {
 *     '__%s__' % method for method in             # <<<<<<<<<<<<<<
 *     ' '.join([magic_methods, numerics, inplace, right]).split()
 * }
 */
      __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s, __pyx_9genexpr13__pyx_v_6cymock_method); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1930, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1930, __pyx_L11_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_9genexpr13__pyx_v_6cymock_method);
    __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_6cymock_method, Py_None);
    goto __pyx_L14_exit_scope;
    __pyx_L11_error:;
    __Pyx_GOTREF(__pyx_9genexpr13__pyx_v_6cymock_method);
    __Pyx_DECREF_SET(__pyx_9genexpr13__pyx_v_6cymock_method, Py_None);
    goto __pyx_L1_error;
    __pyx_L14_exit_scope:;
  } /* exit inner scope */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_magics, __pyx_t_3) < 0) __PYX_ERR(0, 1929, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1935
 * 
 * # Magic methods used for async `with` statements
 * _async_method_magics = {"__aenter__", "__aexit__", "__anext__"}             # <<<<<<<<<<<<<<
 * # Magic methods that are only used with async calls but are synchronous functions themselves
 * _sync_async_magics = {"__aiter__"}
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PySet_Add(__pyx_t_3, __pyx_n_u_aenter) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_aexit) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  if (PySet_Add(__pyx_t_3, __pyx_n_u_anext) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_async_method_magics, __pyx_t_3) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1937
 * _async_method_magics = {"__aenter__", "__aexit__", "__anext__"}
 * # Magic methods that are only used with async calls but are synchronous functions themselves
 * _sync_async_magics = {"__aiter__"}             # <<<<<<<<<<<<<<
 * _async_magics = _async_method_magics | _sync_async_magics
 * 
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PySet_Add(__pyx_t_3, __pyx_n_u_aiter) < 0) __PYX_ERR(0, 1937, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sync_async_magics, __pyx_t_3) < 0) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1938
 * # Magic methods that are only used with async calls but are synchronous functions themselves
 * _sync_async_magics = {"__aiter__"}
 * _async_magics = _async_method_magics | _sync_async_magics             # <<<<<<<<<<<<<<
 * 
 * _all_sync_magics = _magics | _non_defaults
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_async_method_magics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sync_async_magics); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = PyNumber_Or(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_async_magics, __pyx_t_11) < 0) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":1940
 * _async_magics = _async_method_magics | _sync_async_magics
 * 
 * _all_sync_magics = _magics | _non_defaults             # <<<<<<<<<<<<<<
 * _all_magics = _all_sync_magics | _async_magics
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_magics); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_non_defaults); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyNumber_Or(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_sync_magics, __pyx_t_3) < 0) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":1941
 * 
 * _all_sync_magics = _magics | _non_defaults
 * _all_magics = _all_sync_magics | _async_magics             # <<<<<<<<<<<<<<
 * 
 * _unsupported_magics = {
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_all_sync_magics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_async_magics); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = PyNumber_Or(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_magics, __pyx_t_11) < 0) __PYX_ERR(0, 1941, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":1944
 * 
 * _unsupported_magics = {
 *     '__getattr__', '__setattr__',             # <<<<<<<<<<<<<<
 *     '__init__', '__new__', '__prepare__',
 *     '__instancecheck__', '__subclasscheck__',
 */
  __pyx_t_11 = PySet_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PySet_Add(__pyx_t_11, __pyx_n_u_getattr) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  if (PySet_Add(__pyx_t_11, __pyx_n_u_setattr) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  if (PySet_Add(__pyx_t_11, __pyx_n_u_init) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  if (PySet_Add(__pyx_t_11, __pyx_n_u_new) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  if (PySet_Add(__pyx_t_11, __pyx_n_u_prepare) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  if (PySet_Add(__pyx_t_11, __pyx_n_u_instancecheck) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  if (PySet_Add(__pyx_t_11, __pyx_n_u_subclasscheck) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  if (PySet_Add(__pyx_t_11, __pyx_n_u_del) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unsupported_magics, __pyx_t_11) < 0) __PYX_ERR(0, 1943, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":1951
 * 
 * _calculate_return_value = {
 *     '__hash__': lambda self: object.__hash__(self),             # <<<<<<<<<<<<<<
 *     '__str__': lambda self: object.__str__(self),
 *     '__sizeof__': lambda self: object.__sizeof__(self),
 */
  __pyx_t_11 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_82lambda10, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_hash, __pyx_t_7) < 0) __PYX_ERR(0, 1951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1952
 * _calculate_return_value = {
 *     '__hash__': lambda self: object.__hash__(self),
 *     '__str__': lambda self: object.__str__(self),             # <<<<<<<<<<<<<<
 *     '__sizeof__': lambda self: object.__sizeof__(self),
 *     '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}",
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_83lambda11, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_str, __pyx_t_7) < 0) __PYX_ERR(0, 1951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1953
 *     '__hash__': lambda self: object.__hash__(self),
 *     '__str__': lambda self: object.__str__(self),
 *     '__sizeof__': lambda self: object.__sizeof__(self),             # <<<<<<<<<<<<<<
 *     '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}",
 * }
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_84lambda12, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_sizeof, __pyx_t_7) < 0) __PYX_ERR(0, 1951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":1954
 *     '__str__': lambda self: object.__str__(self),
 *     '__sizeof__': lambda self: object.__sizeof__(self),
 *     '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}",             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_85lambda13, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cymock, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_fspath, __pyx_t_7) < 0) __PYX_ERR(0, 1951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculate_return_value, __pyx_t_11) < 0) __PYX_ERR(0, 1950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":1958
 * 
 * _return_values = {
 *     '__lt__': NotImplemented,             # <<<<<<<<<<<<<<
 *     '__gt__': NotImplemented,
 *     '__le__': NotImplemented,
 */
  __pyx_t_11 = __Pyx_PyDict_NewPresized(13); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_lt, __pyx_builtin_NotImplemented) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "cymock.pyx":1959
 * _return_values = {
 *     '__lt__': NotImplemented,
 *     '__gt__': NotImplemented,             # <<<<<<<<<<<<<<
 *     '__le__': NotImplemented,
 *     '__ge__': NotImplemented,
 */
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_gt, __pyx_builtin_NotImplemented) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "cymock.pyx":1960
 *     '__lt__': NotImplemented,
 *     '__gt__': NotImplemented,
 *     '__le__': NotImplemented,             # <<<<<<<<<<<<<<
 *     '__ge__': NotImplemented,
 *     '__int__': 1,
 */
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_le, __pyx_builtin_NotImplemented) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "cymock.pyx":1961
 *     '__gt__': NotImplemented,
 *     '__le__': NotImplemented,
 *     '__ge__': NotImplemented,             # <<<<<<<<<<<<<<
 *     '__int__': 1,
 *     '__contains__': False,
 */
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_ge, __pyx_builtin_NotImplemented) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_int, __pyx_int_1) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "cymock.pyx":1963
 *     '__ge__': NotImplemented,
 *     '__int__': 1,
 *     '__contains__': False,             # <<<<<<<<<<<<<<
 *     '__len__': 0,
 *     '__exit__': False,
 */
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_contains, Py_False) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_len, __pyx_int_0) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "cymock.pyx":1965
 *     '__contains__': False,
 *     '__len__': 0,
 *     '__exit__': False,             # <<<<<<<<<<<<<<
 *     '__complex__': 1j,
 *     '__float__': 1.0,
 */
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_exit, Py_False) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "cymock.pyx":1966
 *     '__len__': 0,
 *     '__exit__': False,
 *     '__complex__': 1j,             # <<<<<<<<<<<<<<
 *     '__float__': 1.0,
 *     '__bool__': True,
 */
  __pyx_t_7 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_complex, __pyx_t_7) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_float, __pyx_float_1_0) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "cymock.pyx":1968
 *     '__complex__': 1j,
 *     '__float__': 1.0,
 *     '__bool__': True,             # <<<<<<<<<<<<<<
 *     '__index__': 1,
 *     '__aexit__': False,
 */
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_bool, Py_True) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_index_2, __pyx_int_1) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)

  /* "cymock.pyx":1970
 *     '__bool__': True,
 *     '__index__': 1,
 *     '__aexit__': False,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_aexit, Py_False) < 0) __PYX_ERR(0, 1958, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_values, __pyx_t_11) < 0) __PYX_ERR(0, 1957, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":1974
 * 
 * 
 * def _get_eq(self):             # <<<<<<<<<<<<<<
 *     def __eq__(other):
 *         ret_val = self.__eq__._mock_return_value
 */
  __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_6cymock_55_get_eq, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_eq, __pyx_t_11) < 0) __PYX_ERR(0, 1974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":1984
 *     return __eq__
 * 
 * def _get_ne(self):             # <<<<<<<<<<<<<<
 *     def __ne__(other):
 *         if self.__ne__._mock_return_value is not DEFAULT:
 */
  __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_6cymock_57_get_ne, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ne, __pyx_t_11) < 0) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":1993
 *     return __ne__
 * 
 * def _get_iter(self):             # <<<<<<<<<<<<<<
 *     def __iter__():
 *         ret_val = self.__iter__._mock_return_value
 */
  __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_6cymock_59_get_iter, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_iter, __pyx_t_11) < 0) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2003
 *     return __iter__
 * 
 * def _get_async_iter(self):             # <<<<<<<<<<<<<<
 *     def __aiter__():
 *         ret_val = self.__aiter__._mock_return_value
 */
  __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_6cymock_61_get_async_iter, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_async_iter, __pyx_t_11) < 0) __PYX_ERR(0, 2003, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2012
 * 
 * _side_effect_methods = {
 *     '__eq__': _get_eq,             # <<<<<<<<<<<<<<
 *     '__ne__': _get_ne,
 *     '__iter__': _get_iter,
 */
  __pyx_t_11 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_get_eq); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_eq, __pyx_t_7) < 0) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2013
 * _side_effect_methods = {
 *     '__eq__': _get_eq,
 *     '__ne__': _get_ne,             # <<<<<<<<<<<<<<
 *     '__iter__': _get_iter,
 *     '__aiter__': _get_async_iter
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_get_ne); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_ne, __pyx_t_7) < 0) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2014
 *     '__eq__': _get_eq,
 *     '__ne__': _get_ne,
 *     '__iter__': _get_iter,             # <<<<<<<<<<<<<<
 *     '__aiter__': _get_async_iter
 * }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_get_iter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_iter, __pyx_t_7) < 0) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2015
 *     '__ne__': _get_ne,
 *     '__iter__': _get_iter,
 *     '__aiter__': _get_async_iter             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_get_async_iter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_u_aiter, __pyx_t_7) < 0) __PYX_ERR(0, 2012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_side_effect_methods, __pyx_t_11) < 0) __PYX_ERR(0, 2011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2020
 * 
 * 
 * def _set_return_value(mock, method, name):             # <<<<<<<<<<<<<<
 *     fixed = _return_values.get(name, DEFAULT)
 *     if fixed is not DEFAULT:
 */
  __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_6cymock_63_set_return_value, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_return_value, __pyx_t_11) < 0) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2038
 * 
 * 
 * class MagicMixin(Base):             # <<<<<<<<<<<<<<
 *     def __init__(self, *args, **kw):
 *         self._mock_set_magics()  # make magic work for kwargs in init
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Base); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11);
  __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_7, __pyx_n_s_MagicMixin, __pyx_n_s_MagicMixin, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":2039
 * 
 * class MagicMixin(Base):
 *     def __init__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(MagicMixin, self).__init__(*args, **kw)
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_10MagicMixin_1__init__, 0, __pyx_n_s_MagicMixin___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__308)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 2039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2045
 * 
 * 
 *     def _mock_set_magics(self):             # <<<<<<<<<<<<<<
 *         orig_magics = _magics | _async_method_magics
 *         these_magics = orig_magics
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_10MagicMixin_3_mock_set_magics, 0, __pyx_n_s_MagicMixin__mock_set_magics, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__310)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_mock_set_magics, __pyx_t_10) < 0) __PYX_ERR(0, 2045, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2038
 * 
 * 
 * class MagicMixin(Base):             # <<<<<<<<<<<<<<
 *     def __init__(self, *args, **kw):
 *         self._mock_set_magics()  # make magic work for kwargs in init
 */
  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_MagicMixin, __pyx_t_7, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MagicMixin, __pyx_t_10) < 0) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2069
 * 
 * 
 * class NonCallableMagicMock(MagicMixin, NonCallableMock):             # <<<<<<<<<<<<<<
 *     """A version of `MagicMock` that isn't callable."""
 *     def mock_add_spec(self, spec, spec_set=False):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_MagicMixin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_NonCallableMock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11);
  __pyx_t_7 = 0;
  __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_3, __pyx_n_s_NonCallableMagicMock, __pyx_n_s_NonCallableMagicMock, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_A_version_of_MagicMock_that_isn); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cymock.pyx":2071
 * class NonCallableMagicMock(MagicMixin, NonCallableMock):
 *     """A version of `MagicMock` that isn't callable."""
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_20NonCallableMagicMock_1mock_add_spec, 0, __pyx_n_s_NonCallableMagicMock_mock_add_sp, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__312)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__313);
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_mock_add_spec_2, __pyx_t_10) < 0) __PYX_ERR(0, 2071, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2069
 * 
 * 
 * class NonCallableMagicMock(MagicMixin, NonCallableMock):             # <<<<<<<<<<<<<<
 *     """A version of `MagicMock` that isn't callable."""
 *     def mock_add_spec(self, spec, spec_set=False):
 */
  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_NonCallableMagicMock, __pyx_t_3, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NonCallableMagicMock, __pyx_t_10) < 0) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2081
 * 
 * 
 * class AsyncMagicMixin(MagicMixin):             # <<<<<<<<<<<<<<
 *     def __init__(self, *args, **kw):
 *         self._mock_set_magics()  # make magic work for kwargs in init
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MagicMixin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_11, __pyx_n_s_AsyncMagicMixin, __pyx_n_s_AsyncMagicMixin, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cymock.pyx":2082
 * 
 * class AsyncMagicMixin(MagicMixin):
 *     def __init__(self, *args, **kw):             # <<<<<<<<<<<<<<
 *         self._mock_set_magics()  # make magic work for kwargs in init
 *         _safe_super(AsyncMagicMixin, self).__init__(*args, **kw)
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_15AsyncMagicMixin_1__init__, 0, __pyx_n_s_AsyncMagicMixin___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 2082, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2081
 * 
 * 
 * class AsyncMagicMixin(MagicMixin):             # <<<<<<<<<<<<<<
 *     def __init__(self, *args, **kw):
 *         self._mock_set_magics()  # make magic work for kwargs in init
 */
  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_AsyncMagicMixin, __pyx_t_11, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncMagicMixin, __pyx_t_10) < 0) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2087
 *         self._mock_set_magics()  # fix magic broken by upper level init
 * 
 * class MagicMock(MagicMixin, Mock):             # <<<<<<<<<<<<<<
 *     """
 *     MagicMock is a subclass of Mock with default implementations
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_MagicMixin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Mock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
  __pyx_t_11 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_7, __pyx_n_s_MagicMock, __pyx_n_s_MagicMock, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_MagicMock_is_a_subclass_of_Mock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cymock.pyx":2098
 *     Attributes and the return value of a `MagicMock` will also be `MagicMocks`.
 *     """
 *     def mock_add_spec(self, spec, spec_set=False):             # <<<<<<<<<<<<<<
 *         """Add a spec to a mock. `spec` can either be an object or a
 *         list of strings. Only attributes on the `spec` can be fetched as
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_9MagicMock_1mock_add_spec, 0, __pyx_n_s_MagicMock_mock_add_spec, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__318);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_mock_add_spec_2, __pyx_t_10) < 0) __PYX_ERR(0, 2098, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2087
 *         self._mock_set_magics()  # fix magic broken by upper level init
 * 
 * class MagicMock(MagicMixin, Mock):             # <<<<<<<<<<<<<<
 *     """
 *     MagicMock is a subclass of Mock with default implementations
 */
  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MagicMock, __pyx_t_7, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MagicMock, __pyx_t_10) < 0) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2109
 * 
 * 
 * class MagicProxy(Base):             # <<<<<<<<<<<<<<
 *     def __init__(self, name, parent):
 *         self.name = name
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Base); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_3, __pyx_n_s_MagicProxy, __pyx_n_s_MagicProxy, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cymock.pyx":2110
 * 
 * class MagicProxy(Base):
 *     def __init__(self, name, parent):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.parent = parent
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_10MagicProxy_1__init__, 0, __pyx_n_s_MagicProxy___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 2110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2114
 *         self.parent = parent
 * 
 *     def create_mock(self):             # <<<<<<<<<<<<<<
 *         entry = self.name
 *         parent = self.parent
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_10MagicProxy_3create_mock, 0, __pyx_n_s_MagicProxy_create_mock, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_create_mock, __pyx_t_10) < 0) __PYX_ERR(0, 2114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2123
 *         return m
 * 
 *     def __get__(self, obj, _type=None):             # <<<<<<<<<<<<<<
 *         return self.create_mock()
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_10MagicProxy_5__get__, 0, __pyx_n_s_MagicProxy___get, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__325);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_get_3, __pyx_t_10) < 0) __PYX_ERR(0, 2123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2109
 * 
 * 
 * class MagicProxy(Base):             # <<<<<<<<<<<<<<
 *     def __init__(self, name, parent):
 *         self.name = name
 */
  __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_MagicProxy, __pyx_t_3, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MagicProxy, __pyx_t_10) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2127
 * 
 * 
 * class AsyncMockMixin(Base):             # <<<<<<<<<<<<<<
 *     await_count = _delegating_property('await_count')
 *     await_args = _delegating_property('await_args')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_7, __pyx_n_s_AsyncMockMixin, __pyx_n_s_AsyncMockMixin, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cymock.pyx":2128
 * 
 * class AsyncMockMixin(Base):
 *     await_count = _delegating_property('await_count')             # <<<<<<<<<<<<<<
 *     await_args = _delegating_property('await_args')
 *     await_args_list = _delegating_property('await_args_list')
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_delegating_property); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_n_u_await_count) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_await_count);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_await_count, __pyx_t_2) < 0) __PYX_ERR(0, 2128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2129
 * class AsyncMockMixin(Base):
 *     await_count = _delegating_property('await_count')
 *     await_args = _delegating_property('await_args')             # <<<<<<<<<<<<<<
 *     await_args_list = _delegating_property('await_args_list')
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_delegating_property); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_n_u_await_args) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_await_args);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_await_args, __pyx_t_2) < 0) __PYX_ERR(0, 2129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2130
 *     await_count = _delegating_property('await_count')
 *     await_args = _delegating_property('await_args')
 *     await_args_list = _delegating_property('await_args_list')             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *args, **kwargs):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_delegating_property); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_n_u_await_args_list) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_u_await_args_list);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_await_args_list, __pyx_t_2) < 0) __PYX_ERR(0, 2130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2132
 *     await_args_list = _delegating_property('await_args_list')
 * 
 *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super().__init__(*args, **kwargs)
 *         # asyncio.iscoroutinefunction() checks _is_coroutine property to say if an
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_1__init__, 0, __pyx_n_s_AsyncMockMixin___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__327)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  PyList_Append(__pyx_t_10, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 2132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2148
 *         self.__dict__['__code__'] = code_mock
 * 
 *     async def _execute_mock_call(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         # This is nearly just like super(), except for sepcial handling
 *         # of coroutines
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_3_execute_mock_call, 0, __pyx_n_s_AsyncMockMixin__execute_mock_cal, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_execute_mock_call, __pyx_t_2) < 0) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2188
 *         return self.return_value
 * 
 *     def assert_awaited(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited at least once.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_6assert_awaited, 0, __pyx_n_s_AsyncMockMixin_assert_awaited, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__330)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_assert_awaited, __pyx_t_2) < 0) __PYX_ERR(0, 2188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2196
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_once(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited exactly once.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_8assert_awaited_once, 0, __pyx_n_s_AsyncMockMixin_assert_awaited_on, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__332)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_assert_awaited_once, __pyx_t_2) < 0) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2205
 *             raise AssertionError(msg)
 * 
 *     def assert_awaited_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the last await was with the specified arguments.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_10assert_awaited_with, 0, __pyx_n_s_AsyncMockMixin_assert_awaited_wi_2, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__334)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_assert_awaited_with, __pyx_t_2) < 0) __PYX_ERR(0, 2205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2223
 *             raise AssertionError(_error_message()) from cause
 * 
 *     def assert_awaited_once_with(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was awaited exactly once and with the specified
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_12assert_awaited_once_with, 0, __pyx_n_s_AsyncMockMixin_assert_awaited_on_2, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__336)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_assert_awaited_once_with, __pyx_t_2) < 0) __PYX_ERR(0, 2223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2234
 *         return self.assert_awaited_with(*args, **kwargs)
 * 
 *     def assert_any_await(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has ever been awaited with the specified arguments.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_14assert_any_await, 0, __pyx_n_s_AsyncMockMixin_assert_any_await, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__338)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_assert_any_await, __pyx_t_2) < 0) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2247
 *             ) from cause
 * 
 *     def assert_has_awaits(self, calls, any_order=False):             # <<<<<<<<<<<<<<
 *         """
 *         Assert the mock has been awaited with the specified calls.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_16assert_has_awaits, 0, __pyx_n_s_AsyncMockMixin_assert_has_awaits_2, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__340)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__341);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_assert_has_awaits, __pyx_t_2) < 0) __PYX_ERR(0, 2247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2291
 *             ) from cause
 * 
 *     def assert_not_awaited(self):             # <<<<<<<<<<<<<<
 *         """
 *         Assert that the mock was never awaited.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_18assert_not_awaited, 0, __pyx_n_s_AsyncMockMixin_assert_not_awaite, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__343)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_assert_not_awaited, __pyx_t_2) < 0) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2300
 *             raise AssertionError(msg)
 * 
 *     def reset_mock(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         See :func:`.Mock.reset_mock()`
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14AsyncMockMixin_20reset_mock, 0, __pyx_n_s_AsyncMockMixin_reset_mock, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__345)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  PyList_Append(__pyx_t_10, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_reset_mock, __pyx_t_2) < 0) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2127
 * 
 * 
 * class AsyncMockMixin(Base):             # <<<<<<<<<<<<<<
 *     await_count = _delegating_property('await_count')
 *     await_args = _delegating_property('await_args')
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_AsyncMockMixin, __pyx_t_7, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_CyFunction_InitClassCell(__pyx_t_10, __pyx_t_2) < 0) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncMockMixin, __pyx_t_2) < 0) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2310
 * 
 * 
 * class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock):             # <<<<<<<<<<<<<<
 *     """
 *     Enhance :class:`Mock` with features allowing to mock
 */
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_AsyncMockMixin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AsyncMagicMixin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Mock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_11);
  __pyx_t_7 = 0;
  __pyx_t_3 = 0;
  __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_n_s_AsyncMock, __pyx_n_s_AsyncMock, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_Enhance_class_Mock_with_feature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_AsyncMock, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncMock, __pyx_t_7) < 0) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2353
 * 
 * 
 * class _ANY(object):             # <<<<<<<<<<<<<<
 *     "A helper object that compares equal to everything."
 * 
 */
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__346); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__346, __pyx_n_s_ANY_3, __pyx_n_s_ANY_3, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_A_helper_object_that_compares_eq); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cymock.pyx":2356
 *     "A helper object that compares equal to everything."
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_4_ANY_1__eq__, 0, __pyx_n_s_ANY___eq, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__348)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_eq, __pyx_t_3) < 0) __PYX_ERR(0, 2356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2359
 *         return True
 * 
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return False
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_4_ANY_3__ne__, 0, __pyx_n_s_ANY___ne, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__350)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_ne, __pyx_t_3) < 0) __PYX_ERR(0, 2359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2362
 *         return False
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<ANY>'
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_4_ANY_5__repr__, 0, __pyx_n_s_ANY___repr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__352)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_repr, __pyx_t_3) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2353
 * 
 * 
 * class _ANY(object):             # <<<<<<<<<<<<<<
 *     "A helper object that compares equal to everything."
 * 
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ANY_3, __pyx_tuple__346, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANY_3, __pyx_t_3) < 0) __PYX_ERR(0, 2353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2365
 *         return '<ANY>'
 * 
 * ANY = _ANY()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ANY_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ANY_2, __pyx_t_11) < 0) __PYX_ERR(0, 2365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2369
 * 
 * 
 * def _format_call_signature(name, args, kwargs):             # <<<<<<<<<<<<<<
 *     message = '%s(%%s)' % name
 *     formatted_args = ''
 */
  __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_6cymock_65_format_call_signature, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_format_call_signature, __pyx_t_11) < 0) __PYX_ERR(0, 2369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2387
 * 
 * 
 * class _Call(tuple):             # <<<<<<<<<<<<<<
 *     """
 *     A tuple for holding the results of a call to a mock, either in the form
 */
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(((PyObject *)(&PyTuple_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type)));
  PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)(&PyTuple_Type)));
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_11, __pyx_n_s_Call, __pyx_n_s_Call, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_A_tuple_for_holding_the_results); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":2406
 *     If the _Call has no name then it will match any name.
 *     """
 *     def __new__(cls, value=(), name='', parent=None, two=False,             # <<<<<<<<<<<<<<
 *                 from_kall=True):
 *         args = ()
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Call___new, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__356)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__357);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_new, __pyx_t_7) < 0) __PYX_ERR(0, 2406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2438
 * 
 * 
 *     def __init__(self, value=(), name=None, parent=None, two=False,             # <<<<<<<<<<<<<<
 *                  from_kall=True):
 *         self._mock_name = name
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_3__init__, 0, __pyx_n_s_Call___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__359)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__360);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2445
 * 
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if other is ANY:
 *             return True
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_5__eq__, 0, __pyx_n_s_Call___eq, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__362)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_eq, __pyx_t_7) < 0) __PYX_ERR(0, 2445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2500
 * 
 * 
 *     __ne__ = object.__ne__             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_ne); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ne, __pyx_t_7) < 0) __PYX_ERR(0, 2500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2503
 * 
 * 
 *     def __call__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         if self._mock_name is None:
 *             return _Call(('', args, kwargs), name='()')
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_7__call__, 0, __pyx_n_s_Call___call, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__364)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_call, __pyx_t_7) < 0) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2511
 * 
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         if self._mock_name is None:
 *             return _Call(name=attr, from_kall=False)
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_9__getattr__, 0, __pyx_n_s_Call___getattr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getattr, __pyx_t_7) < 0) __PYX_ERR(0, 2511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2518
 * 
 * 
 *     def __getattribute__(self, attr):             # <<<<<<<<<<<<<<
 *         if attr in tuple.__dict__:
 *             raise AttributeError
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_11__getattribute__, 0, __pyx_n_s_Call___getattribute, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__368)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getattribute, __pyx_t_7) < 0) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2524
 * 
 * 
 *     def count(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.__getattr__('count')(*args, **kwargs)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_13count, 0, __pyx_n_s_Call_count, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__370)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2527
 *         return self.__getattr__('count')(*args, **kwargs)
 * 
 *     def index(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         return self.__getattr__('index')(*args, **kwargs)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_15index, 0, __pyx_n_s_Call_index, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__372)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2530
 *         return self.__getattr__('index')(*args, **kwargs)
 * 
 *     def _get_call_arguments(self):             # <<<<<<<<<<<<<<
 *         if len(self) == 2:
 *             args, kwargs = self
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_17_get_call_arguments, 0, __pyx_n_s_Call__get_call_arguments, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__374)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_call_arguments, __pyx_t_7) < 0) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2539
 * 
 *     @property
 *     def args(self):             # <<<<<<<<<<<<<<
 *         return self._get_call_arguments()[0]
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_19args, 0, __pyx_n_s_Call_args, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__376)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "cymock.pyx":2538
 *         return args, kwargs
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def args(self):
 *         return self._get_call_arguments()[0]
 */
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_args, __pyx_t_10) < 0) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cymock.pyx":2543
 * 
 *     @property
 *     def kwargs(self):             # <<<<<<<<<<<<<<
 *         return self._get_call_arguments()[1]
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_21kwargs, 0, __pyx_n_s_Call_kwargs, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__378)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "cymock.pyx":2542
 *         return self._get_call_arguments()[0]
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def kwargs(self):
 *         return self._get_call_arguments()[1]
 */
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_kwargs, __pyx_t_7) < 0) __PYX_ERR(0, 2543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2546
 *         return self._get_call_arguments()[1]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if not self._mock_from_kall:
 *             name = self._mock_name or 'call'
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_23__repr__, 0, __pyx_n_s_Call___repr, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__380)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 2546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2567
 * 
 * 
 *     def call_list(self):             # <<<<<<<<<<<<<<
 *         """For a call object that represents multiple calls, `call_list`
 *         returns a list of all the intermediate calls as well as the
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_5_Call_25call_list, 0, __pyx_n_s_Call_call_list, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_call_list, __pyx_t_7) < 0) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2387
 * 
 * 
 * class _Call(tuple):             # <<<<<<<<<<<<<<
 *     """
 *     A tuple for holding the results of a call to a mock, either in the form
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Call, __pyx_t_11, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Call, __pyx_t_7) < 0) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2580
 * 
 * 
 * call = _Call(from_kall=False)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Call); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_from_kall, Py_False) < 0) __PYX_ERR(0, 2580, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_call_2, __pyx_t_3) < 0) __PYX_ERR(0, 2580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2583
 * 
 * 
 * def create_autospec(spec, spec_set=False, instance=False, _parent=None,             # <<<<<<<<<<<<<<
 *                     _name=None, **kwargs):
 *     """Create a mock object using another object as a spec. Attributes on the
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_67create_autospec, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_autospec, __pyx_t_3) < 0) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2714
 * 
 * 
 * def _must_skip(spec, entry, is_type):             # <<<<<<<<<<<<<<
 *     """
 *     Return whether we should skip the first argument on spec's `entry`
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6cymock_69_must_skip, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_must_skip, __pyx_t_3) < 0) __PYX_ERR(0, 2714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2742
 * 
 * 
 * class _SpecState(object):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,
 */
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__387); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__387, __pyx_n_s_SpecState, __pyx_n_s_SpecState, (PyObject *) NULL, __pyx_n_s_cymock, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "cymock.pyx":2744
 * class _SpecState(object):
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,             # <<<<<<<<<<<<<<
 *                  name=None, ids=None, instance=False):
 *         self.spec = spec
 */
  __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_10_SpecState_1__init__, 0, __pyx_n_s_SpecState___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__389)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_tuple__390);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_11) < 0) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2742
 * 
 * 
 * class _SpecState(object):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, spec, spec_set=False, parent=None,
 */
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SpecState, __pyx_tuple__387, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SpecState, __pyx_t_11) < 0) __PYX_ERR(0, 2742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cymock.pyx":2756
 * FunctionTypes = (
 *     # python function
 *     type(create_autospec),             # <<<<<<<<<<<<<<
 *     # instance method
 *     type(ANY.__eq__),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_create_autospec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":2758
 *     type(create_autospec),
 *     # instance method
 *     type(ANY.__eq__),             # <<<<<<<<<<<<<<
 * )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ANY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_eq); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2756
 * FunctionTypes = (
 *     # python function
 *     type(create_autospec),             # <<<<<<<<<<<<<<
 *     # instance method
 *     type(ANY.__eq__),
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_3)));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_3)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_t_3)));
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_11)));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_11)));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)Py_TYPE(__pyx_t_11)));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionTypes, __pyx_t_2) < 0) __PYX_ERR(0, 2754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2762
 * 
 * 
 * file_spec = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_spec, Py_None) < 0) __PYX_ERR(0, 2762, __pyx_L1_error)

  /* "cymock.pyx":2765
 * 
 * 
 * def _to_stream(read_data):             # <<<<<<<<<<<<<<
 *     if isinstance(read_data, bytes):
 *         return io.BytesIO(read_data)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_71_to_stream, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_to_stream, __pyx_t_2) < 0) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2772
 * 
 * 
 * def mock_open(mock=None, read_data=''):             # <<<<<<<<<<<<<<
 *     """
 *     A helper function to create a mock to replace the use of `open`. It works
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6cymock_73mock_open, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mock_open, __pyx_t_2) < 0) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2850
 * 
 * 
 * class PropertyMock(Mock):             # <<<<<<<<<<<<<<
 *     """
 *     A mock intended to be used as a property, or other descriptor, on a class.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Mock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_11, __pyx_n_s_PropertyMock, __pyx_n_s_PropertyMock, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_A_mock_intended_to_be_used_as_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cymock.pyx":2859
 *     no args. Setting it calls the mock with the value being set.
 *     """
 *     def _get_child_mock(self, **kwargs):             # <<<<<<<<<<<<<<
 *         return MagicMock(**kwargs)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_12PropertyMock_1_get_child_mock, 0, __pyx_n_s_PropertyMock__get_child_mock, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__396)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_child_mock, __pyx_t_7) < 0) __PYX_ERR(0, 2859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2862
 *         return MagicMock(**kwargs)
 * 
 *     def __get__(self, obj, obj_type=None):             # <<<<<<<<<<<<<<
 *         return self()
 *     def __set__(self, obj, val):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_12PropertyMock_3__get__, 0, __pyx_n_s_PropertyMock___get, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__398)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__399);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_3, __pyx_t_7) < 0) __PYX_ERR(0, 2862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2864
 *     def __get__(self, obj, obj_type=None):
 *         return self()
 *     def __set__(self, obj, val):             # <<<<<<<<<<<<<<
 *         self(val)
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_12PropertyMock_5__set__, 0, __pyx_n_s_PropertyMock___set, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__401)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_set_2, __pyx_t_7) < 0) __PYX_ERR(0, 2864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cymock.pyx":2850
 * 
 * 
 * class PropertyMock(Mock):             # <<<<<<<<<<<<<<
 *     """
 *     A mock intended to be used as a property, or other descriptor, on a class.
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PropertyMock, __pyx_t_11, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PropertyMock, __pyx_t_7) < 0) __PYX_ERR(0, 2850, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2868
 * 
 * 
 * def seal(mock):             # <<<<<<<<<<<<<<
 *     """Disable the automatic generation of child mocks.
 * 
 */
  __pyx_t_11 = PyCFunction_NewEx(&__pyx_mdef_6cymock_75seal, NULL, __pyx_n_s_cymock); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_seal, __pyx_t_11) < 0) __PYX_ERR(0, 2868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":2890
 * 
 * 
 * class _AsyncIterator:             # <<<<<<<<<<<<<<
 *     """
 *     Wraps an iterator in an asynchronous iterator.
 */
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_AsyncIterator, __pyx_n_s_AsyncIterator, (PyObject *) NULL, __pyx_n_s_cymock, __pyx_kp_s_Wraps_an_iterator_in_an_asynchr); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "cymock.pyx":2894
 *     Wraps an iterator in an asynchronous iterator.
 *     """
 *     def __init__(self, iterator):             # <<<<<<<<<<<<<<
 *         self.iterator = iterator
 *         code_mock = NonCallableMock(spec_set=CodeType)
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14_AsyncIterator_1__init__, 0, __pyx_n_s_AsyncIterator___init, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__405)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 2894, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2900
 *         self.__dict__['__code__'] = code_mock
 * 
 *     def __aiter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14_AsyncIterator_3__aiter__, 0, __pyx_n_s_AsyncIterator___aiter, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__407)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_aiter, __pyx_t_2) < 0) __PYX_ERR(0, 2900, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2903
 *         return self
 * 
 *     async def __anext__(self):             # <<<<<<<<<<<<<<
 *         try:
 *             return next(self.iterator)
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6cymock_14_AsyncIterator_5__anext__, 0, __pyx_n_s_AsyncIterator___anext, NULL, __pyx_n_s_cymock, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_anext, __pyx_t_2) < 0) __PYX_ERR(0, 2903, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cymock.pyx":2890
 * 
 * 
 * class _AsyncIterator:             # <<<<<<<<<<<<<<
 *     """
 *     Wraps an iterator in an asynchronous iterator.
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_AsyncIterator, __pyx_empty_tuple, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AsyncIterator, __pyx_t_2) < 0) __PYX_ERR(0, 2890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "cymock.pyx":1
 * # mock.py             # <<<<<<<<<<<<<<
 * # Test tools for mocking and patching.
 * # Maintained by Michael Foord
 */
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_kp_u_NonCallableMock_configure_mock_l_2, __pyx_kp_u_Set_attributes_on_the_mock_throu) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_11) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /*--- Wrapped vars code ---*/

  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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init cymock", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cymock");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* PyExec */
static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) {
    return __Pyx_PyExec3(o, globals, NULL);
}
static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) {
    PyObject* result;
    PyObject* s = 0;
    char *code = 0;
    if (!globals || globals == Py_None) {
        globals = __pyx_d;
    } else if (!PyDict_Check(globals)) {
        PyErr_Format(PyExc_TypeError, "exec() arg 2 must be a dict, not %.200s",
                     Py_TYPE(globals)->tp_name);
        goto bad;
    }
    if (!locals || locals == Py_None) {
        locals = globals;
    }
    if (__Pyx_PyDict_GetItemStr(globals, __pyx_n_s_builtins) == NULL) {
        if (PyDict_SetItem(globals, __pyx_n_s_builtins, PyEval_GetBuiltins()) < 0)
            goto bad;
    }
    if (PyCode_Check(o)) {
        if (__Pyx_PyCode_HasFreeVars((PyCodeObject *)o)) {
            PyErr_SetString(PyExc_TypeError,
                "code object passed to exec() may not contain free variables");
            goto bad;
        }
        #if CYTHON_COMPILING_IN_PYPY || PY_VERSION_HEX < 0x030200B1
        result = PyEval_EvalCode((PyCodeObject *)o, globals, locals);
        #else
        result = PyEval_EvalCode(o, globals, locals);
        #endif
    } else {
        PyCompilerFlags cf;
        cf.cf_flags = 0;
        if (PyUnicode_Check(o)) {
            cf.cf_flags = PyCF_SOURCE_IS_UTF8;
            s = PyUnicode_AsUTF8String(o);
            if (!s) goto bad;
            o = s;
        #if PY_MAJOR_VERSION >= 3
        } else if (!PyBytes_Check(o)) {
        #else
        } else if (!PyString_Check(o)) {
        #endif
            PyErr_Format(PyExc_TypeError,
                "exec: arg 1 must be string, bytes or code object, got %.200s",
                Py_TYPE(o)->tp_name);
            goto bad;
        }
        #if PY_MAJOR_VERSION >= 3
        code = PyBytes_AS_STRING(o);
        #else
        code = PyString_AS_STRING(o);
        #endif
        if (PyEval_MergeCompilerFlags(&cf)) {
            result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf);
        } else {
            result = PyRun_String(code, Py_file_input, globals, locals);
        }
        Py_XDECREF(s);
    }
    return result;
bad:
    Py_XDECREF(s);
    return 0;
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* IterNext */
static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_Occurred();
    if (unlikely(exc_type)) {
        if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return NULL;
        __Pyx_PyErr_Clear();
        Py_INCREF(defval);
        return defval;
    }
    if (defval) {
        Py_INCREF(defval);
        return defval;
    }
    __Pyx_PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}
static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
    PyErr_Format(PyExc_TypeError,
        "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
}
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
    iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
    if (likely(iternext)) {
#if CYTHON_USE_TYPE_SLOTS
        next = iternext(iterator);
        if (likely(next))
            return next;
        #if PY_VERSION_HEX >= 0x02070000
        if (unlikely(iternext == &_PyObject_NextNotImplemented))
            return NULL;
        #endif
#else
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
#endif
    } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    }
#if !CYTHON_USE_TYPE_SLOTS
    else {
        next = PyIter_Next(iterator);
        if (likely(next))
            return next;
    }
#endif
    return __Pyx_PyIter_Next2Default(defval);
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod0 */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_ASSUME_SAFE_MACROS
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* py_dict_items */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
    else
        return PyDict_Items(d);
}

/* pop */
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
    if (Py_TYPE(L) == &PySet_Type) {
        return PySet_Pop(L);
    }
    return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) {
    if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) {
        Py_SIZE(L) -= 1;
        return PyList_GET_ITEM(L, PyList_GET_SIZE(L));
    }
    return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
}
#endif

/* SetItemInt */
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
#else
    if (is_list || PySequence_Check(o))
#endif
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_NE));
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* pop_index */
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
    PyObject *r;
    if (unlikely(!py_ix)) return NULL;
    r = __Pyx__PyObject_PopIndex(L, py_ix);
    Py_DECREF(py_ix);
    return r;
}
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
    return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
    Py_ssize_t size = PyList_GET_SIZE(L);
    if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
        Py_ssize_t cix = ix;
        if (cix < 0) {
            cix += size;
        }
        if (likely(__Pyx_is_valid_index(cix, size))) {
            PyObject* v = PyList_GET_ITEM(L, cix);
            Py_SIZE(L) -= 1;
            size -= 1;
            memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
            return v;
        }
    }
    if (py_ix == Py_None) {
        return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix));
    } else {
        return __Pyx__PyObject_PopIndex(L, py_ix);
    }
}
#endif

/* CoroutineBase */
#include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Coroutine */
static void __Pyx_CoroutineAwait_dealloc(PyObject *self) {
    PyObject_GC_UnTrack(self);
    Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine);
    PyObject_GC_Del(self);
}
static int __Pyx_CoroutineAwait_traverse(__pyx_CoroutineAwaitObject *self, visitproc visit, void *arg) {
    Py_VISIT(self->coroutine);
    return 0;
}
static int __Pyx_CoroutineAwait_clear(__pyx_CoroutineAwaitObject *self) {
    Py_CLEAR(self->coroutine);
    return 0;
}
static PyObject *__Pyx_CoroutineAwait_Next(__pyx_CoroutineAwaitObject *self) {
    return __Pyx_Generator_Next(self->coroutine);
}
static PyObject *__Pyx_CoroutineAwait_Send(__pyx_CoroutineAwaitObject *self, PyObject *value) {
    return __Pyx_Coroutine_Send(self->coroutine, value);
}
static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) {
    return __Pyx_Coroutine_Throw(self->coroutine, args);
}
static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self->coroutine);
}
static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) {
    Py_INCREF(self);
    return self;
}
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_CoroutineAwait_no_new(CYTHON_UNUSED PyTypeObject *type, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwargs) {
    PyErr_SetString(PyExc_TypeError, "cannot instantiate type, use 'await coroutine' instead");
    return NULL;
}
#endif
static PyMethodDef __pyx_CoroutineAwait_methods[] = {
    {"send", (PyCFunction) __Pyx_CoroutineAwait_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_CoroutineAwait_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_CoroutineAwaitType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "coroutine_wrapper",
    sizeof(__pyx_CoroutineAwaitObject),
    0,
    (destructor) __Pyx_CoroutineAwait_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    PyDoc_STR("A wrapper object implementing __await__ for coroutines."),
    (traverseproc) __Pyx_CoroutineAwait_traverse,
    (inquiry) __Pyx_CoroutineAwait_clear,
    0,
    0,
    __Pyx_CoroutineAwait_self,
    (iternextfunc) __Pyx_CoroutineAwait_Next,
    __pyx_CoroutineAwait_methods,
    0                         ,
    0                      ,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if !CYTHON_COMPILING_IN_PYPY
    __Pyx_CoroutineAwait_no_new,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
#if PY_VERSION_HEX < 0x030500B1 || defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS
static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) {
    __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_CoroutineAwaitType);
    if (unlikely(!await)) return NULL;
    Py_INCREF(coroutine);
    await->coroutine = coroutine;
    PyObject_GC_Track(await);
    return (PyObject*)await;
}
#endif
#if PY_VERSION_HEX < 0x030500B1
static PyObject *__Pyx_Coroutine_await_method(PyObject *coroutine, CYTHON_UNUSED PyObject *arg) {
    return __Pyx__Coroutine_await(coroutine);
}
#endif
#if defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS
static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) {
    if (unlikely(!coroutine || !__Pyx_Coroutine_Check(coroutine))) {
        PyErr_SetString(PyExc_TypeError, "invalid input, expected coroutine");
        return NULL;
    }
    return __Pyx__Coroutine_await(coroutine);
}
#endif
static PyObject *
__Pyx_Coroutine_get_frame(CYTHON_UNUSED __pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    Py_RETURN_NONE;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
static PyObject *__Pyx_Coroutine_compare(PyObject *obj, PyObject *other, int op) {
    PyObject* result;
    switch (op) {
        case Py_EQ: result = (other == obj) ? Py_True : Py_False; break;
        case Py_NE: result = (other != obj) ? Py_True : Py_False; break;
        default:
            result = Py_NotImplemented;
    }
    Py_INCREF(result);
    return result;
}
#endif
static PyMethodDef __pyx_Coroutine_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
#if PY_VERSION_HEX < 0x030500B1
    {"__await__", (PyCFunction) __Pyx_Coroutine_await_method, METH_NOARGS,
     (char*) PyDoc_STR("__await__() -> return an iterator to be used in await expression.")},
#endif
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Coroutine_memberlist[] = {
    {(char *) "cr_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being awaited, or None")},
    {(char*) "cr_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Coroutine_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the coroutine"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the coroutine"), 0},
    {(char *) "cr_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the coroutine"), 0},
    {0, 0, 0, 0, 0}
};
#if CYTHON_USE_ASYNC_SLOTS
static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async = {
    __Pyx_Coroutine_await,
    0,
    0,
};
#endif
static PyTypeObject __pyx_CoroutineType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "coroutine",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
#if CYTHON_USE_ASYNC_SLOTS
    &__pyx_Coroutine_as_async,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
#if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
    __Pyx_Coroutine_compare,
#else
    0,
#endif
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    0,
    __pyx_Coroutine_methods,
    __pyx_Coroutine_memberlist,
    __pyx_Coroutine_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Coroutine_init(void) {
    __pyx_CoroutineType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_CoroutineType = __Pyx_FetchCommonType(&__pyx_CoroutineType_type);
    if (unlikely(!__pyx_CoroutineType))
        return -1;
#ifdef __Pyx_IterableCoroutine_USED
    if (unlikely(__pyx_IterableCoroutine_init() == -1))
        return -1;
#endif
    __pyx_CoroutineAwaitType = __Pyx_FetchCommonType(&__pyx_CoroutineAwaitType_type);
    if (unlikely(!__pyx_CoroutineAwaitType))
        return -1;
    return 0;
}

/* GetAwaitIter */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
#ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(o)) {
        return __Pyx_NewRef(o);
    }
#endif
    return __Pyx__Coroutine_GetAwaitableIter(o);
}
static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) {
#if PY_VERSION_HEX >= 0x030600B3 || defined(_PyErr_FormatFromCause)
    _PyErr_FormatFromCause(
        PyExc_TypeError,
        "'async for' received an invalid object "
        "from __anext__: %.100s",
        Py_TYPE(source)->tp_name);
#elif PY_MAJOR_VERSION >= 3
    PyObject *exc, *val, *val2, *tb;
    assert(PyErr_Occurred());
    PyErr_Fetch(&exc, &val, &tb);
    PyErr_NormalizeException(&exc, &val, &tb);
    if (tb != NULL) {
        PyException_SetTraceback(val, tb);
        Py_DECREF(tb);
    }
    Py_DECREF(exc);
    assert(!PyErr_Occurred());
    PyErr_Format(
        PyExc_TypeError,
        "'async for' received an invalid object "
        "from __anext__: %.100s",
        Py_TYPE(source)->tp_name);
    PyErr_Fetch(&exc, &val2, &tb);
    PyErr_NormalizeException(&exc, &val2, &tb);
    Py_INCREF(val);
    PyException_SetCause(val2, val);
    PyException_SetContext(val2, val);
    PyErr_Restore(exc, val2, tb);
#else
    source++;
#endif
}
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) {
    PyObject *res;
#if CYTHON_USE_ASYNC_SLOTS
    __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj);
    if (likely(am && am->am_await)) {
        res = (*am->am_await)(obj);
    } else
#endif
#if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact)
    if (PyCoro_CheckExact(obj)) {
        return __Pyx_NewRef(obj);
    } else
#endif
#if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE)
    if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
        return __Pyx_NewRef(obj);
    } else
#endif
    {
        PyObject *method = NULL;
        int is_method = __Pyx_PyObject_GetMethod(obj, __pyx_n_s_await, &method);
        if (likely(is_method)) {
            res = __Pyx_PyObject_CallOneArg(method, obj);
        } else if (likely(method)) {
            res = __Pyx_PyObject_CallNoArg(method);
        } else
            goto slot_error;
        Py_DECREF(method);
    }
    if (unlikely(!res)) {
        __Pyx_Coroutine_AwaitableIterError(obj);
        goto bad;
    }
    if (unlikely(!PyIter_Check(res))) {
        PyErr_Format(PyExc_TypeError,
                     "__await__() returned non-iterator of type '%.100s'",
                     Py_TYPE(res)->tp_name);
        Py_CLEAR(res);
    } else {
        int is_coroutine = 0;
        #ifdef __Pyx_Coroutine_USED
        is_coroutine |= __Pyx_Coroutine_Check(res);
        #endif
        #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact)
        is_coroutine |= PyCoro_CheckExact(res);
        #endif
        if (unlikely(is_coroutine)) {
            /* __await__ must return an *iterator*, not
               a coroutine or another awaitable (see PEP 492) */
            PyErr_SetString(PyExc_TypeError,
                            "__await__() returned a coroutine");
            Py_CLEAR(res);
        }
    }
    return res;
slot_error:
    PyErr_Format(PyExc_TypeError,
                 "object %.100s can't be used in 'await' expression",
                 Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* CoroutineYieldFrom */
static PyObject* __Pyx__Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source) {
    PyObject *retval;
    PyObject *source_gen = __Pyx__Coroutine_GetAwaitableIter(source);
    if (unlikely(!source_gen)) {
        return NULL;
    }
    if (__Pyx_Coroutine_Check(source_gen)) {
        retval = __Pyx_Generator_Next(source_gen);
    } else {
#if CYTHON_USE_TYPE_SLOTS
        retval = Py_TYPE(source_gen)->tp_iternext(source_gen);
#else
        retval = PyIter_Next(source_gen);
#endif
    }
    if (retval) {
        gen->yieldfrom = source_gen;
        return retval;
    }
    Py_DECREF(source_gen);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) {
    PyObject *retval;
    if (__Pyx_Coroutine_Check(source)) {
        if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) {
            PyErr_SetString(
                PyExc_RuntimeError,
                "coroutine is being awaited already");
            return NULL;
        }
        retval = __Pyx_Generator_Next(source);
#ifdef __Pyx_AsyncGen_USED
    } else if (__pyx_PyAsyncGenASend_CheckExact(source)) {
        retval = __Pyx_async_gen_asend_iternext(source);
#endif
    } else {
        return __Pyx__Coroutine_Yield_From_Generic(gen, source);
    }
    if (retval) {
        Py_INCREF(source);
        gen->yieldfrom = source;
    }
    return retval;
}

/* ReturnWithStopIteration */
static void __Pyx__ReturnWithStopIteration(PyObject* value) {
    PyObject *exc, *args;
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_PYSTON
    __Pyx_PyThreadState_declare
    if ((PY_VERSION_HEX >= 0x03030000 && PY_VERSION_HEX < 0x030500B1)
            || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        args = PyTuple_New(1);
        if (unlikely(!args)) return;
        Py_INCREF(value);
        PyTuple_SET_ITEM(args, 0, value);
        exc = PyType_Type.tp_call(PyExc_StopIteration, args, NULL);
        Py_DECREF(args);
        if (!exc) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_type)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(PyExc_StopIteration);
        __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL);
        return;
    }
    #endif
#else
    args = PyTuple_Pack(1, value);
    if (unlikely(!args)) return;
    exc = PyObject_Call(PyExc_StopIteration, args, NULL);
    Py_DECREF(args);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(PyExc_StopIteration, exc);
    Py_DECREF(exc);
}

/* py_dict_pop */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3
    if ((1)) {
        return _PyDict_Pop(d, key, default_value);
    } else
#endif
    if (default_value) {
        return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value);
    } else {
        return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key);
    }
}

/* MergeKeywords */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict);
                Py_DECREF(fallback);
            }
        }
        if (unlikely(!iter)) goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}

/* SliceTupleAndList */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    *_length = stop - start;
    *_start = start;
    *_stop = stop;
}
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyList_New(0);
    dest = PyList_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyListObject*)src)->ob_item + start,
        ((PyListObject*)dest)->ob_item,
        length);
    return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyTuple_New(0);
    dest = PyTuple_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyTupleObject*)src)->ob_item + start,
        ((PyTupleObject*)dest)->ob_item,
        length);
    return dest;
}
#endif

/* StopAsyncIteration */
#if PY_VERSION_HEX < 0x030500B1
static PyTypeObject __Pyx__PyExc_StopAsyncIteration_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "StopAsyncIteration",
    sizeof(PyBaseExceptionObject),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
    PyDoc_STR("Signal the end from iterator.__anext__()."),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
#endif
static int __pyx_StopAsyncIteration_init(void) {
#if PY_VERSION_HEX >= 0x030500B1
    __Pyx_PyExc_StopAsyncIteration = PyExc_StopAsyncIteration;
#else
    PyObject *builtins = PyEval_GetBuiltins();
    if (likely(builtins)) {
        PyObject *exc = PyMapping_GetItemString(builtins, (char*) "StopAsyncIteration");
        if (exc) {
            __Pyx_PyExc_StopAsyncIteration = exc;
            return 0;
        }
    }
    PyErr_Clear();
    __Pyx__PyExc_StopAsyncIteration_type.tp_traverse = ((PyTypeObject*)PyExc_BaseException)->tp_traverse;
    __Pyx__PyExc_StopAsyncIteration_type.tp_clear = ((PyTypeObject*)PyExc_BaseException)->tp_clear;
    __Pyx__PyExc_StopAsyncIteration_type.tp_dictoffset = ((PyTypeObject*)PyExc_BaseException)->tp_dictoffset;
    __Pyx__PyExc_StopAsyncIteration_type.tp_base = (PyTypeObject*)PyExc_Exception;
    __Pyx_PyExc_StopAsyncIteration = (PyObject*) __Pyx_FetchCommonType(&__Pyx__PyExc_StopAsyncIteration_type);
    if (unlikely(!__Pyx_PyExc_StopAsyncIteration))
        return -1;
    if (builtins && unlikely(PyMapping_SetItemString(builtins, (char*) "StopAsyncIteration", __Pyx_PyExc_StopAsyncIteration) < 0))
        return -1;
#endif
    return 0;
}

/* Generator */
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* GeneratorYieldFrom */
static void __PyxPyIter_CheckErrorAndDecref(PyObject *source) {
    PyErr_Format(PyExc_TypeError,
                 "iter() returned non-iterator of type '%.100s'",
                 Py_TYPE(source)->tp_name);
    Py_DECREF(source);
}
static CYTHON_INLINE PyObject* __Pyx_Generator_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) {
    PyObject *source_gen, *retval;
#ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(source)) {
        Py_INCREF(source);
        source_gen = source;
        retval = __Pyx_Generator_Next(source);
    } else
#endif
    {
#if CYTHON_USE_TYPE_SLOTS
        if (likely(Py_TYPE(source)->tp_iter)) {
            source_gen = Py_TYPE(source)->tp_iter(source);
            if (unlikely(!source_gen))
                return NULL;
            if (unlikely(!PyIter_Check(source_gen))) {
                __PyxPyIter_CheckErrorAndDecref(source_gen);
                return NULL;
            }
        } else
#endif
        {
            source_gen = PyObject_GetIter(source);
            if (unlikely(!source_gen))
                return NULL;
        }
#if CYTHON_USE_TYPE_SLOTS
        retval = Py_TYPE(source_gen)->tp_iternext(source_gen);
#else
        retval = PyIter_Next(source_gen);
#endif
    }
    if (likely(retval)) {
        gen->yieldfrom = source_gen;
        return retval;
    }
    Py_DECREF(source_gen);
    return NULL;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* PatchInspect */
static PyObject* __Pyx_patch_inspect(PyObject* module) {
#if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT)
    static int inspect_patched = 0;
    if (unlikely((!inspect_patched) && module)) {
        module = __Pyx_Coroutine_patch_module(
            module, ""
"old_types = getattr(_module.isgenerator, '_cython_generator_types', None)\n"
"if old_types is None or not isinstance(old_types, set):\n"
"    old_types = set()\n"
"    def cy_wrap(orig_func, type=type, cython_generator_types=old_types):\n"
"        def cy_isgenerator(obj): return type(obj) in cython_generator_types or orig_func(obj)\n"
"        cy_isgenerator._cython_generator_types = cython_generator_types\n"
"        return cy_isgenerator\n"
"    _module.isgenerator = cy_wrap(_module.isgenerator)\n"
"old_types.add(_cython_generator_type)\n"
        );
        inspect_patched = 1;
    }
#else
    if ((0)) return __Pyx_Coroutine_patch_module(module, NULL);
#endif
    return module;
}

/* PatchAsyncIO */
static PyObject* __Pyx_patch_asyncio(PyObject* module) {
#if PY_VERSION_HEX < 0x030500B2 &&\
        (defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED)) &&\
        (!defined(CYTHON_PATCH_ASYNCIO) || CYTHON_PATCH_ASYNCIO)
    PyObject *patch_module = NULL;
    static int asyncio_patched = 0;
    if (unlikely((!asyncio_patched) && module)) {
        PyObject *package;
        package = __Pyx_Import(__pyx_n_s_asyncio_coroutines, NULL, 0);
        if (package) {
            patch_module = __Pyx_Coroutine_patch_module(
                PyObject_GetAttrString(package, "coroutines"), ""
"try:\n"
"    coro_types = _module._COROUTINE_TYPES\n"
"except AttributeError: pass\n"
"else:\n"
"    if _cython_coroutine_type is not None and _cython_coroutine_type not in coro_types:\n"
"        coro_types = tuple(coro_types) + (_cython_coroutine_type,)\n"
"    if _cython_generator_type is not None and _cython_generator_type not in coro_types:\n"
"        coro_types = tuple(coro_types) + (_cython_generator_type,)\n"
"_module._COROUTINE_TYPES = coro_types\n"
            );
        } else {
            PyErr_Clear();
            package = __Pyx_Import(__pyx_n_s_asyncio_tasks, NULL, 0);
            if (unlikely(!package)) goto asyncio_done;
            patch_module = __Pyx_Coroutine_patch_module(
                PyObject_GetAttrString(package, "tasks"), ""
"if hasattr(_module, 'iscoroutine'):\n"
"    old_types = getattr(_module.iscoroutine, '_cython_coroutine_types', None)\n"
"    if old_types is None or not isinstance(old_types, set):\n"
"        old_types = set()\n"
"        def cy_wrap(orig_func, type=type, cython_coroutine_types=old_types):\n"
"            def cy_iscoroutine(obj): return type(obj) in cython_coroutine_types or orig_func(obj)\n"
"            cy_iscoroutine._cython_coroutine_types = cython_coroutine_types\n"
"            return cy_iscoroutine\n"
"        _module.iscoroutine = cy_wrap(_module.iscoroutine)\n"
"    if _cython_coroutine_type is not None:\n"
"        old_types.add(_cython_coroutine_type)\n"
"    if _cython_generator_type is not None:\n"
"        old_types.add(_cython_generator_type)\n"
            );
        }
        Py_DECREF(package);
        if (unlikely(!patch_module)) goto ignore;
asyncio_done:
        PyErr_Clear();
        asyncio_patched = 1;
#ifdef __Pyx_Generator_USED
        {
            PyObject *inspect_module;
            if (patch_module) {
                inspect_module = PyObject_GetAttr(patch_module, __pyx_n_s_inspect);
                Py_DECREF(patch_module);
            } else {
                inspect_module = __Pyx_Import(__pyx_n_s_inspect, NULL, 0);
            }
            if (unlikely(!inspect_module)) goto ignore;
            inspect_module = __Pyx_patch_inspect(inspect_module);
            if (unlikely(!inspect_module)) {
                Py_DECREF(module);
                module = NULL;
            }
            Py_XDECREF(inspect_module);
        }
#else
        if ((0)) return __Pyx_patch_inspect(module);
#endif
    }
    return module;
ignore:
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch asyncio package with custom generator type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    if ((0)) return __Pyx_patch_inspect(__Pyx_Coroutine_patch_module(module, NULL));
#endif
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CyFunctionClassCell */
static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) {
    Py_ssize_t i, count = PyList_GET_SIZE(cyfunctions);
    for (i = 0; i < count; i++) {
        __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *)
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            PyList_GET_ITEM(cyfunctions, i);
#else
            PySequence_ITEM(cyfunctions, i);
        if (unlikely(!m))
            return -1;
#endif
        Py_INCREF(classobj);
        m->func_classobj = classobj;
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF((PyObject*)m);
#endif
    }
    return 0;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* Declarations */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
