/* Generated by Cython 0.24.1 */

/* BEGIN: Cython Metadata
{
    "distutils": {}, 
    "module_name": "cycloudpickle.cycloudpickle"
}
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 < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_24_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
#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_CPYTHON 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
  #define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
#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"
  #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 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
#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_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_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #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_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_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
#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
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? 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
#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
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#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) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#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
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#ifndef CYTHON_INLINE
  #if 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 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; \
}

#if PY_MAJOR_VERSION >= 3
  #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_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#endif

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

#define __PYX_HAVE__cycloudpickle__cycloudpickle
#define __PYX_HAVE_API__cycloudpickle__cycloudpickle
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#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_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#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_DEFAULT 0
#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)))  )
#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) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _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 char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE 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_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((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)
#if PY_MAJOR_VERSION < 3
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);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#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)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#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));
    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 PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
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;


static const char *__pyx_f[] = {
  "cycloudpickle/cycloudpickle.pyx",
  "cycloudpickle/cypickle.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_13cycloudpickle_8cypickle__Framer;
struct __pyx_obj_13cycloudpickle_8cypickle_Pickler;
struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler;
struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops;
struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops;
struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals;
struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr;
struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dump;
struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dumps;

/* "cycloudpickle/cycloudpickle.pyx":726
 * # Shorthands for legacy support
 * 
 * cpdef dump(obj, file, protocol=2):             # <<<<<<<<<<<<<<
 *     CloudPickler(file, protocol).dump(obj)
 * 
 */
struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dump {
  int __pyx_n;
  PyObject *protocol;
};

/* "cycloudpickle/cycloudpickle.pyx":730
 * 
 * 
 * cpdef dumps(obj, protocol=2):             # <<<<<<<<<<<<<<
 *     file = StringIO()
 * 
 */
struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dumps {
  int __pyx_n;
  PyObject *protocol;
};

/* "cypickle.pxd":1
 * cdef class _Framer:             # <<<<<<<<<<<<<<
 *     cdef object file_write
 *     cdef object current_frame
 */
struct __pyx_obj_13cycloudpickle_8cypickle__Framer {
  PyObject_HEAD
  PyObject *file_write;
  PyObject *current_frame;
};


/* "cypickle.pxd":5
 *     cdef object current_frame
 * 
 * cdef class Pickler:             # <<<<<<<<<<<<<<
 *     cdef int protocol
 *     cdef int proto
 */
struct __pyx_obj_13cycloudpickle_8cypickle_Pickler {
  PyObject_HEAD
  int protocol;
  int proto;
  int bin;
  int fast;
  int fix_imports;
  PyObject *_file_write;
  struct __pyx_obj_13cycloudpickle_8cypickle__Framer *framer;
  PyObject *write;
  PyObject *memo;
};


/* "cycloudpickle/cycloudpickle.pyx":174
 * 
 * 
 * cdef class CloudPickler(Pickler):             # <<<<<<<<<<<<<<
 *     cdef object modules
 *     cdef object globals_ref
 */
struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler {
  struct __pyx_obj_13cycloudpickle_8cypickle_Pickler __pyx_base;
  PyObject *modules;
  PyObject *globals_ref;
};


/* "cycloudpickle/cycloudpickle.pyx":107
 * 
 * if sys.version_info < (3, 4):
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */
struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops {
  PyObject_HEAD
  PyObject *__pyx_v_code;
  PyObject *__pyx_v_extended_arg;
  PyObject *__pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_op;
  PyObject *__pyx_v_oparg;
};


/* "cycloudpickle/cycloudpickle.pyx":132
 * 
 * else:
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */
struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops {
  PyObject_HEAD
  PyObject *__pyx_v_code;
  PyObject *__pyx_v_instr;
  PyObject *__pyx_v_op;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "cycloudpickle/cycloudpickle.pyx":148
 *     else {})
 * 
 * def extract_code_globals(co):             # <<<<<<<<<<<<<<
 *     """
 *     Find all globals names read or written to by codeblock co
 */
struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals {
  PyObject_HEAD
  PyObject *__pyx_v_co;
  PyObject *__pyx_v_names;
};


/* "cycloudpickle/cycloudpickle.pyx":160
 *             out_names = set()
 *         else:
 *             out_names = set(names[oparg]             # <<<<<<<<<<<<<<
 *                             for op, oparg in _walk_global_ops(co))
 * 
 */
struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *__pyx_outer_scope;
  PyObject *__pyx_v_op;
  PyObject *__pyx_v_oparg;
};


/* --- 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_COMPILING_IN_CPYTHON
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);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

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

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

/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

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

/* 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

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#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));
}

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

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

/* 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);

/* PyThreadStateGet.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#endif

/* SaveResetException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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

/* PyErrExceptionMatches.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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

/* GetException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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

/* 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);

/* 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);

/* 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

/* 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 CYTHON_INLINE 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);

/* PyErrFetchRestore.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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);
#else
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(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

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

/* SwapException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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

/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact);

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

/* 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);

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

/* ListCompAppend.proto */
#if CYTHON_COMPILING_IN_CPYTHON
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

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

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

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#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_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);

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

/* 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);

/* PyObjectSetAttrStr.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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) {
    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);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* ListAppend.proto */
#if CYTHON_COMPILING_IN_CPYTHON
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

/* 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);

/* 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);

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

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

/* CallNextTpDealloc.proto */
static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);

/* CallNextTpTraverse.proto */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

/* CallNextTpClear.proto */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);

/* 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 */
static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
                                             int is_tuple, 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);

/* GetNameInClass.proto */
static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);

/* 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);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* UnicodeAsUCS4.proto */
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);

/* object_ord.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Ord(c)\
    (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
#else
#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
#endif
static long __Pyx__PyObject_Ord(PyObject* c);

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

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

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static int __Pyx_Coroutine_clear(PyObject *self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

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

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(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, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

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

/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);

/* TypeImport.proto */
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);

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


/* Module declarations from 'cycloudpickle.cypickle' */
static PyTypeObject *__pyx_ptype_13cycloudpickle_8cypickle__Framer = 0;
static PyTypeObject *__pyx_ptype_13cycloudpickle_8cypickle_Pickler = 0;

/* Module declarations from 'cpython.version' */

/* Module declarations from 'cycloudpickle.cycloudpickle' */
static PyTypeObject *__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler = 0;
static PyTypeObject *__pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops = 0;
static PyTypeObject *__pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops = 0;
static PyTypeObject *__pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals = 0;
static PyTypeObject *__pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr = 0;
static PyObject *__pyx_f_13cycloudpickle_13cycloudpickle_islambda(PyObject *); /*proto*/
static PyObject *__pyx_f_13cycloudpickle_13cycloudpickle_dump(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dump *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_13cycloudpickle_13cycloudpickle_dumps(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dumps *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_13cycloudpickle_13cycloudpickle__find_module(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "cycloudpickle.cycloudpickle"
int __pyx_module_is_main_cycloudpickle__cycloudpickle = 0;

/* Implementation of 'cycloudpickle.cycloudpickle' */
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_vars;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_classmethod;
static PyObject *__pyx_builtin_IOError;
static const char __pyx_k_[] = "";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_v[] = "v";
static const char __pyx_k__4[] = "\n";
static const char __pyx_k_co[] = "co";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_io[] = "io";
static const char __pyx_k_op[] = "op";
static const char __pyx_k_OBJ[] = "OBJ";
static const char __pyx_k_PY3[] = "PY3";
static const char __pyx_k__10[] = ".";
static const char __pyx_k__25[] = "+";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_arg[] = "arg";
static const char __pyx_k_dis[] = "dis";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_gen[] = "gen";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_imp[] = "imp";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_ord[] = "ord";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_INST[] = "INST";
static const char __pyx_k_MARK[] = "MARK";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_call[] = "__call__";
static const char __pyx_k_code[] = "__code__";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_dump[] = "dump";
static const char __pyx_k_fdel[] = "fdel";
static const char __pyx_k_fget[] = "fget";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_fset[] = "fset";
static const char __pyx_k_func[] = "__func__";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_item[] = "item";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_load[] = "load";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_save[] = "save";
static const char __pyx_k_seek[] = "seek";
static const char __pyx_k_self[] = "__self__";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_tell[] = "tell";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_vars[] = "vars";
static const char __pyx_k_BUILD[] = "BUILD";
static const char __pyx_k_Dummy[] = "Dummy";
static const char __pyx_k_TUPLE[] = "TUPLE";
static const char __pyx_k_attrs[] = "attrs";
static const char __pyx_k_bases[] = "__bases__";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_const[] = "const";
static const char __pyx_k_get_2[] = "__get__";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_input[] = "input";
static const char __pyx_k_instr[] = "instr";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_names[] = "names";
static const char __pyx_k_oparg[] = "oparg";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_stdin[] = "<stdin>";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_GLOBAL[] = "GLOBAL";
static const char __pyx_k_NEWOBJ[] = "NEWOBJ";
static const char __pyx_k_REDUCE[] = "REDUCE";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_buffer[] = "buffer";
static const char __pyx_k_closed[] = "closed";
static const char __pyx_k_code_2[] = "code";
static const char __pyx_k_func_2[] = "func";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_isatty[] = "isatty";
static const char __pyx_k_lambda[] = "<lambda>";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_newobj[] = "__newobj__";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_opcode[] = "opcode";
static const char __pyx_k_opname[] = "opname";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_self_2[] = "self";
static const char __pyx_k_stderr[] = "stderr";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_BytesIO[] = "BytesIO";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_builtin[] = "__builtin__";
static const char __pyx_k_closure[] = "__closure__";
static const char __pyx_k_co_code[] = "co_code";
static const char __pyx_k_co_name[] = "co_name";
static const char __pyx_k_copyreg[] = "copyreg";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_getattr[] = "getattr";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_globals[] = "__globals__";
static const char __pyx_k_memoize[] = "memoize";
static const char __pyx_k_modules[] = "modules";
static const char __pyx_k_partial[] = "partial";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_stdin_2[] = "stdin";
static const char __pyx_k_tornado[] = "tornado";
static const char __pyx_k_weakref[] = "__weakref__";
static const char __pyx_k_wrapped[] = "__wrapped__";
static const char __pyx_k_CodeType[] = "CodeType";
static const char __pyx_k_Ellipsis[] = "Ellipsis";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_StringIO[] = "StringIO";
static const char __pyx_k_builtins[] = "__builtins__";
static const char __pyx_k_co_flags[] = "co_flags";
static const char __pyx_k_co_names[] = "co_names";
static const char __pyx_k_copy_reg[] = "copy_reg";
static const char __pyx_k_defaults[] = "__defaults__";
static const char __pyx_k_dispatch[] = "dispatch";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_getvalue[] = "getvalue";
static const char __pyx_k_im_class[] = "im_class";
static const char __pyx_k_keywords[] = "keywords";
static const char __pyx_k_objclass[] = "__objclass__";
static const char __pyx_k_operator[] = "operator";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_protocol[] = "protocol";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_ClassType[] = "ClassType";
static const char __pyx_k_cStringIO[] = "cStringIO";
static const char __pyx_k_co_consts[] = "co_consts";
static const char __pyx_k_co_lnotab[] = "co_lnotab";
static const char __pyx_k_coroutine[] = "coroutine";
static const char __pyx_k_dictitems[] = "dictitems";
static const char __pyx_k_functools[] = "functools";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_listitems[] = "listitems";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_out_names[] = "out_names";
static const char __pyx_k_recursion[] = "recursion";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_save_file[] = "save_file";
static const char __pyx_k_save_inst[] = "save_inst";
static const char __pyx_k_subimport[] = "subimport";
static const char __pyx_k_traceback[] = "traceback";
static const char __pyx_k_transient[] = "__transient__";
static const char __pyx_k_weakref_2[] = "weakref";
static const char __pyx_k_GLOBAL_OPS[] = "GLOBAL_OPS";
static const char __pyx_k_MethodType[] = "MethodType";
static const char __pyx_k_ModuleType[] = "ModuleType";
static const char __pyx_k_attrgetter[] = "attrgetter";
static const char __pyx_k_builtins_2[] = "builtins";
static const char __pyx_k_co_nlocals[] = "co_nlocals";
static const char __pyx_k_genpartial[] = "_genpartial";
static const char __pyx_k_itemgetter[] = "itemgetter";
static const char __pyx_k_keep_alive[] = "_keep_alive";
static const char __pyx_k_memoryview[] = "memoryview";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_LOAD_GLOBAL[] = "LOAD_GLOBAL";
static const char __pyx_k_classmethod[] = "classmethod";
static const char __pyx_k_co_argcount[] = "co_argcount";
static const char __pyx_k_co_cellvars[] = "co_cellvars";
static const char __pyx_k_co_filename[] = "co_filename";
static const char __pyx_k_co_freevars[] = "co_freevars";
static const char __pyx_k_co_varnames[] = "co_varnames";
static const char __pyx_k_find_module[] = "find_module";
static const char __pyx_k_getinitargs[] = "__getinitargs__";
static const char __pyx_k_save_buffer[] = "save_buffer";
static const char __pyx_k_save_global[] = "save_global";
static const char __pyx_k_save_module[] = "save_module";
static const char __pyx_k_save_reduce[] = "save_reduce";
static const char __pyx_k_save_string[] = "save_string";
static const char __pyx_k_tornado_gen[] = "tornado.gen";
static const char __pyx_k_whichmodule[] = "whichmodule";
static const char __pyx_k_EXTENDED_ARG[] = "EXTENDED_ARG";
static const char __pyx_k_FunctionType[] = "FunctionType";
static const char __pyx_k_InstanceType[] = "InstanceType";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_STORE_GLOBAL[] = "STORE_GLOBAL";
static const char __pyx_k_builtin_type[] = "_builtin_type";
static const char __pyx_k_co_stacksize[] = "co_stacksize";
static const char __pyx_k_extended_arg[] = "extended_arg";
static const char __pyx_k_gen_ellipsis[] = "_gen_ellipsis";
static const char __pyx_k_getattribute[] = "__getattribute__";
static const char __pyx_k_restore_attr[] = "_restore_attr";
static const char __pyx_k_save_partial[] = "save_partial";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_DELETE_GLOBAL[] = "DELETE_GLOBAL";
static const char __pyx_k_GeneratorType[] = "GeneratorType";
static const char __pyx_k_HAVE_ARGUMENT[] = "HAVE_ARGUMENT";
static const char __pyx_k_PicklingError[] = "PicklingError";
static const char __pyx_k_TextIOWrapper[] = "TextIOWrapper";
static const char __pyx_k_batch_appends[] = "_batch_appends";
static const char __pyx_k_cell_contents[] = "cell_contents";
static const char __pyx_k_fill_function[] = "_fill_function";
static const char __pyx_k_inject_addons[] = "inject_addons";
static const char __pyx_k_save_ellipsis[] = "save_ellipsis";
static const char __pyx_k_save_function[] = "save_function";
static const char __pyx_k_save_property[] = "save_property";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_BufferedRandom[] = "BufferedRandom";
static const char __pyx_k_Can_t_pickle_r[] = "Can't pickle %r";
static const char __pyx_k_NotImplemented[] = "NotImplemented";
static const char __pyx_k_batch_setitems[] = "_batch_setitems";
static const char __pyx_k_co_firstlineno[] = "co_firstlineno";
static const char __pyx_k_make_skel_func[] = "_make_skel_func";
static const char __pyx_k_save_attrgetter[] = "save_attrgetter";
static const char __pyx_k_save_codeobject[] = "save_codeobject";
static const char __pyx_k_save_itemgetter[] = "save_itemgetter";
static const char __pyx_k_save_memoryview[] = "save_memoryview";
static const char __pyx_k_walk_global_ops[] = "_walk_global_ops";
static const char __pyx_k_get_instructions[] = "get_instructions";
static const char __pyx_k_save_classmethod[] = "save_classmethod";
static const char __pyx_k_save_unsupported[] = "save_unsupported";
static const char __pyx_k_WeakKeyDictionary[] = "WeakKeyDictionary";
static const char __pyx_k_co_kwonlyargcount[] = "co_kwonlyargcount";
static const char __pyx_k_dynamic_subimport[] = "dynamic_subimport";
static const char __pyx_k_extract_func_data[] = "extract_func_data";
static const char __pyx_k_method_descriptor[] = "method_descriptor";
static const char __pyx_k_pypy_version_info[] = "pypy_version_info";
static const char __pyx_k_BUILTIN_TYPE_NAMES[] = "_BUILTIN_TYPE_NAMES";
static const char __pyx_k_BuiltinFunctionType[] = "BuiltinFunctionType";
static const char __pyx_k_gen_not_implemented[] = "_gen_not_implemented";
static const char __pyx_k_reconstruct_closure[] = "_reconstruct_closure";
static const char __pyx_k_save_function_tuple[] = "save_function_tuple";
static const char __pyx_k_save_instancemethod[] = "save_instancemethod";
static const char __pyx_k_extract_code_globals[] = "extract_code_globals";
static const char __pyx_k_is_tornado_coroutine[] = "is_tornado_coroutine";
static const char __pyx_k_save_not_implemented[] = "save_not_implemented";
static const char __pyx_k_is_coroutine_function[] = "is_coroutine_function";
static const char __pyx_k_save_builtin_function[] = "save_builtin_function";
static const char __pyx_k_cloudpickle_cloudpickle[] = "cloudpickle.cloudpickle";
static const char __pyx_k_reduce_method_descriptor[] = "_reduce_method_descriptor";
static const char __pyx_k_rebuild_tornado_coroutine[] = "_rebuild_tornado_coroutine";
static const char __pyx_k_Cannot_pickle_closed_files[] = "Cannot pickle closed files";
static const char __pyx_k_extract_code_globals_cache[] = "_extract_code_globals_cache";
static const char __pyx_k_cycloudpickle_cycloudpickle[] = "cycloudpickle.cycloudpickle";
static const char __pyx_k_Cannot_pickle_standard_input[] = "Cannot pickle standard input";
static const char __pyx_k_save_attrgetter_locals_Dummy[] = "save_attrgetter.<locals>.Dummy";
static const char __pyx_k_save_itemgetter_locals_Dummy[] = "save_itemgetter.<locals>.Dummy";
static const char __pyx_k_home_frens_jan_Workspaces_tgho[] = "/home/frens-jan/Workspaces/tgho/bndl/cycloudpickle/cycloudpickle/cycloudpickle.pyx";
static const char __pyx_k_Cannot_pickle_files_that_do_not[] = "Cannot pickle files that do not map to an actual file";
static const char __pyx_k_Cannot_pickle_files_that_map_to[] = "Cannot pickle files that map to tty objects";
static const char __pyx_k_Cannot_pickle_objects_of_type_s[] = "Cannot pickle objects of type %s";
static const char __pyx_k_This_file_is_an_adaptation_of_c[] = "\nThis file is an adaptation of cloudpickle to use Cython.\n\n---\n\nThis class is defined to override standard pickle functionality\n\nThe goals of it follow:\n-Serialize lambdas and nested functions to compiled byte code\n-Deal with main module correctly\n-Deal with other non-serializable objects\n\nIt does not include an unpickler, as standard python unpickling suffices.\n\nThis module was extracted from the `cloud` package, developed by `PiCloud, Inc.\n<http://www.picloud.com>`_.\n\nCopyright (c) 2012, Regents of the University of California.\nCopyright (c) 2009 `PiCloud, Inc. <http://www.picloud.com>`_.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n    * Neither the name of the University of California, Berkeley nor the\n      names of its contributors may be used to endorse or promote\n      products derived from this software without specific prior written\n      permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABIL""ITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n";
static const char __pyx_k_args_0_from___newobj___args_has[] = "args[0] from __newobj__ args has no __new__";
static const char __pyx_k_Cannot_pickle_file_s_as_it_canno[] = "Cannot pickle file %s as it cannot be read";
static const char __pyx_k_Cannot_pickle_files_that_are_not[] = "Cannot pickle files that are not opened for reading: %s";
static const char __pyx_k_Could_not_pickle_object_as_exces[] = "Could not pickle object as excessively deep recursion required.";
static const char __pyx_k_args_from_reduce_should_be_a_tup[] = "args from reduce() should be a tuple";
static const char __pyx_k_extract_code_globals_locals_gene[] = "extract_code_globals.<locals>.genexpr";
static const char __pyx_k_func_from_reduce_should_be_calla[] = "func from reduce should be callable";
static const char __pyx_k_save_attrgetter_locals_Dummy___g[] = "save_attrgetter.<locals>.Dummy.__getattribute__";
static const char __pyx_k_save_attrgetter_locals_Dummy___i[] = "save_attrgetter.<locals>.Dummy.__init__";
static const char __pyx_k_save_itemgetter_locals_Dummy___g[] = "save_itemgetter.<locals>.Dummy.__getitem__";
static const char __pyx_k_args_0_from___newobj___args_has_2[] = "args[0] from __newobj__ args has the wrong class";
static PyObject *__pyx_kp_b_;
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_s_BUILD;
static PyObject *__pyx_n_s_BUILTIN_TYPE_NAMES;
static PyObject *__pyx_n_s_BufferedRandom;
static PyObject *__pyx_n_s_BuiltinFunctionType;
static PyObject *__pyx_n_s_BytesIO;
static PyObject *__pyx_kp_u_Can_t_pickle_r;
static PyObject *__pyx_kp_u_Cannot_pickle_closed_files;
static PyObject *__pyx_kp_u_Cannot_pickle_file_s_as_it_canno;
static PyObject *__pyx_kp_u_Cannot_pickle_files_that_are_not;
static PyObject *__pyx_kp_u_Cannot_pickle_files_that_do_not;
static PyObject *__pyx_kp_u_Cannot_pickle_files_that_map_to;
static PyObject *__pyx_kp_u_Cannot_pickle_objects_of_type_s;
static PyObject *__pyx_kp_u_Cannot_pickle_standard_input;
static PyObject *__pyx_n_s_ClassType;
static PyObject *__pyx_n_s_CodeType;
static PyObject *__pyx_kp_u_Could_not_pickle_object_as_exces;
static PyObject *__pyx_n_s_DELETE_GLOBAL;
static PyObject *__pyx_n_u_DELETE_GLOBAL;
static PyObject *__pyx_n_s_Dummy;
static PyObject *__pyx_n_s_EXTENDED_ARG;
static PyObject *__pyx_n_s_Ellipsis;
static PyObject *__pyx_n_s_FunctionType;
static PyObject *__pyx_n_s_GLOBAL;
static PyObject *__pyx_n_s_GLOBAL_OPS;
static PyObject *__pyx_n_s_GeneratorType;
static PyObject *__pyx_n_s_HAVE_ARGUMENT;
static PyObject *__pyx_n_s_INST;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_InstanceType;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_LOAD_GLOBAL;
static PyObject *__pyx_n_u_LOAD_GLOBAL;
static PyObject *__pyx_n_s_MARK;
static PyObject *__pyx_n_s_MethodType;
static PyObject *__pyx_n_s_ModuleType;
static PyObject *__pyx_n_s_NEWOBJ;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_n_s_OBJ;
static PyObject *__pyx_n_s_PY3;
static PyObject *__pyx_n_s_PicklingError;
static PyObject *__pyx_n_s_REDUCE;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_STORE_GLOBAL;
static PyObject *__pyx_n_u_STORE_GLOBAL;
static PyObject *__pyx_n_s_StringIO;
static PyObject *__pyx_n_s_TUPLE;
static PyObject *__pyx_n_s_TextIOWrapper;
static PyObject *__pyx_n_s_WeakKeyDictionary;
static PyObject *__pyx_kp_u__10;
static PyObject *__pyx_kp_u__25;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arg;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_kp_u_args_0_from___newobj___args_has;
static PyObject *__pyx_kp_u_args_0_from___newobj___args_has_2;
static PyObject *__pyx_kp_u_args_from_reduce_should_be_a_tup;
static PyObject *__pyx_n_s_attrgetter;
static PyObject *__pyx_n_s_attrs;
static PyObject *__pyx_n_u_attrs;
static PyObject *__pyx_n_u_b;
static PyObject *__pyx_n_s_bases;
static PyObject *__pyx_n_s_batch_appends;
static PyObject *__pyx_n_s_batch_setitems;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_u_builtin;
static PyObject *__pyx_n_s_builtin_type;
static PyObject *__pyx_n_s_builtins;
static PyObject *__pyx_n_u_builtins;
static PyObject *__pyx_n_s_builtins_2;
static PyObject *__pyx_n_u_builtins_2;
static PyObject *__pyx_n_s_cStringIO;
static PyObject *__pyx_n_u_call;
static PyObject *__pyx_n_s_cell_contents;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_classmethod;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closed;
static PyObject *__pyx_n_s_closure;
static PyObject *__pyx_n_s_cloudpickle_cloudpickle;
static PyObject *__pyx_n_s_co;
static PyObject *__pyx_n_s_co_argcount;
static PyObject *__pyx_n_s_co_cellvars;
static PyObject *__pyx_n_s_co_code;
static PyObject *__pyx_n_u_co_code;
static PyObject *__pyx_n_s_co_consts;
static PyObject *__pyx_n_s_co_filename;
static PyObject *__pyx_n_u_co_filename;
static PyObject *__pyx_n_s_co_firstlineno;
static PyObject *__pyx_n_s_co_flags;
static PyObject *__pyx_n_s_co_freevars;
static PyObject *__pyx_n_s_co_kwonlyargcount;
static PyObject *__pyx_n_s_co_lnotab;
static PyObject *__pyx_n_s_co_name;
static PyObject *__pyx_n_s_co_names;
static PyObject *__pyx_n_s_co_nlocals;
static PyObject *__pyx_n_s_co_stacksize;
static PyObject *__pyx_n_s_co_varnames;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_u_code;
static PyObject *__pyx_n_s_code_2;
static PyObject *__pyx_n_s_const;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_copy_reg;
static PyObject *__pyx_n_s_copyreg;
static PyObject *__pyx_n_s_coroutine;
static PyObject *__pyx_n_s_cycloudpickle_cycloudpickle;
static PyObject *__pyx_n_s_defaults;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_u_dict;
static PyObject *__pyx_n_s_dictitems;
static PyObject *__pyx_n_s_dis;
static PyObject *__pyx_n_s_dispatch;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dump;
static PyObject *__pyx_n_s_dynamic_subimport;
static PyObject *__pyx_n_s_extended_arg;
static PyObject *__pyx_n_s_extract_code_globals;
static PyObject *__pyx_n_s_extract_code_globals_cache;
static PyObject *__pyx_n_s_extract_code_globals_locals_gene;
static PyObject *__pyx_n_s_extract_func_data;
static PyObject *__pyx_n_s_fdel;
static PyObject *__pyx_n_s_fget;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_fill_function;
static PyObject *__pyx_n_s_find_module;
static PyObject *__pyx_n_s_fset;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_func_2;
static PyObject *__pyx_kp_u_func_from_reduce_should_be_calla;
static PyObject *__pyx_n_s_functools;
static PyObject *__pyx_n_s_gen;
static PyObject *__pyx_n_s_gen_ellipsis;
static PyObject *__pyx_n_s_gen_not_implemented;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_genpartial;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_2;
static PyObject *__pyx_n_s_get_instructions;
static PyObject *__pyx_n_s_getattr;
static PyObject *__pyx_n_s_getattribute;
static PyObject *__pyx_n_s_getinitargs;
static PyObject *__pyx_n_u_getinitargs;
static PyObject *__pyx_n_s_getitem;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_getvalue;
static PyObject *__pyx_n_s_globals;
static PyObject *__pyx_kp_s_home_frens_jan_Workspaces_tgho;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_im_class;
static PyObject *__pyx_n_s_imp;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_u_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_inject_addons;
static PyObject *__pyx_n_u_input;
static PyObject *__pyx_n_s_instr;
static PyObject *__pyx_n_s_io;
static PyObject *__pyx_n_s_is_coroutine_function;
static PyObject *__pyx_n_u_is_coroutine_function;
static PyObject *__pyx_n_s_is_tornado_coroutine;
static PyObject *__pyx_n_s_isatty;
static PyObject *__pyx_n_u_isatty;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_s_itemgetter;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_keep_alive;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_keywords;
static PyObject *__pyx_kp_u_lambda;
static PyObject *__pyx_n_s_listitems;
static PyObject *__pyx_n_s_load;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_u_main;
static PyObject *__pyx_n_s_make_skel_func;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_memoize;
static PyObject *__pyx_n_s_memoryview;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_method_descriptor;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_u_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_u_module;
static PyObject *__pyx_n_s_modules;
static PyObject *__pyx_n_s_n;
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_names;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_u_new;
static PyObject *__pyx_n_u_newobj;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_objclass;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_op;
static PyObject *__pyx_n_s_oparg;
static PyObject *__pyx_n_s_opcode;
static PyObject *__pyx_n_s_operator;
static PyObject *__pyx_n_s_opname;
static PyObject *__pyx_n_s_ord;
static PyObject *__pyx_n_s_out_names;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_partial;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_protocol;
static PyObject *__pyx_n_u_pypy_version_info;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_u_r;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_rebuild_tornado_coroutine;
static PyObject *__pyx_n_s_reconstruct_closure;
static PyObject *__pyx_n_u_recursion;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_reduce_method_descriptor;
static PyObject *__pyx_n_s_restore_attr;
static PyObject *__pyx_n_s_save;
static PyObject *__pyx_n_s_save_attrgetter;
static PyObject *__pyx_n_s_save_attrgetter_locals_Dummy;
static PyObject *__pyx_n_s_save_attrgetter_locals_Dummy___g;
static PyObject *__pyx_n_s_save_attrgetter_locals_Dummy___i;
static PyObject *__pyx_n_s_save_buffer;
static PyObject *__pyx_n_s_save_builtin_function;
static PyObject *__pyx_n_s_save_classmethod;
static PyObject *__pyx_n_s_save_codeobject;
static PyObject *__pyx_n_s_save_ellipsis;
static PyObject *__pyx_n_s_save_file;
static PyObject *__pyx_n_s_save_function;
static PyObject *__pyx_n_s_save_function_tuple;
static PyObject *__pyx_n_s_save_global;
static PyObject *__pyx_n_s_save_inst;
static PyObject *__pyx_n_s_save_instancemethod;
static PyObject *__pyx_n_s_save_itemgetter;
static PyObject *__pyx_n_s_save_itemgetter_locals_Dummy;
static PyObject *__pyx_n_s_save_itemgetter_locals_Dummy___g;
static PyObject *__pyx_n_s_save_memoryview;
static PyObject *__pyx_n_s_save_module;
static PyObject *__pyx_n_s_save_not_implemented;
static PyObject *__pyx_n_s_save_partial;
static PyObject *__pyx_n_s_save_property;
static PyObject *__pyx_n_s_save_reduce;
static PyObject *__pyx_n_s_save_string;
static PyObject *__pyx_n_s_save_unsupported;
static PyObject *__pyx_n_s_seek;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_u_self;
static PyObject *__pyx_n_s_self_2;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_stderr;
static PyObject *__pyx_n_u_stderr;
static PyObject *__pyx_kp_u_stdin;
static PyObject *__pyx_n_s_stdin_2;
static PyObject *__pyx_n_s_stdout;
static PyObject *__pyx_n_u_stdout;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_subimport;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_tell;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_tornado;
static PyObject *__pyx_kp_u_tornado_gen;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_n_s_transient;
static PyObject *__pyx_n_u_transient;
static PyObject *__pyx_n_s_types;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_vars;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_n_s_walk_global_ops;
static PyObject *__pyx_n_u_weakref;
static PyObject *__pyx_n_s_weakref_2;
static PyObject *__pyx_n_s_whichmodule;
static PyObject *__pyx_n_s_wrapped;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle__builtin_type(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_2_walk_global_ops(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_5_walk_global_ops(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_20extract_code_globals_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_8extract_code_globals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_co); /* proto */
static int __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler___init__(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_protocol); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_2dump(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_4save_memoryview(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_6save_buffer(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_8save_unsupported(CYTHON_UNUSED struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_10save_module(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_12save_codeobject(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_14save_function(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_16save_function_tuple(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_18extract_func_data(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_20save_builtin_function(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_22save_global(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_pack); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_24save_instancemethod(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_26save_inst(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_28save_property(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_30save_classmethod(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_itemgetter_5Dummy___getitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_32save_itemgetter(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attrs, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_2__getattribute__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_34save_attrgetter(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_36save_reduce(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_state, PyObject *__pyx_v_listitems, PyObject *__pyx_v_dictitems, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_38save_partial(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_40save_file(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_42save_ellipsis(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_44save_not_implemented(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_46inject_addons(CYTHON_UNUSED struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_10is_tornado_coroutine(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12_rebuild_tornado_coroutine(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_14dump(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_file, PyObject *__pyx_v_protocol); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_16dumps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_protocol); /* proto */
static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_18_reduce_method_descriptor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle_CloudPickler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_256;
static PyObject *__pyx_int_65536;
static PyObject *__pyx_k__5;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_slice__20;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_codeobj__9;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__32;
static PyObject *__pyx_codeobj__35;
static PyObject *__pyx_codeobj__37;
static PyObject *__pyx_codeobj__40;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__45;
static PyObject *__pyx_codeobj__48;

/* "cycloudpickle/cycloudpickle.pyx":92
 * 
 * 
 * cdef islambda(object func):             # <<<<<<<<<<<<<<
 *     return getattr(func, '__name__') == '<lambda>'
 * 
 */

static PyObject *__pyx_f_13cycloudpickle_13cycloudpickle_islambda(PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("islambda", 0);

  /* "cycloudpickle/cycloudpickle.pyx":93
 * 
 * cdef islambda(object func):
 *     return getattr(func, '__name__') == '<lambda>'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetAttr(__pyx_v_func, __pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_kp_u_lambda, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":92
 * 
 * 
 * cdef islambda(object func):             # <<<<<<<<<<<<<<
 *     return getattr(func, '__name__') == '<lambda>'
 * 
 */

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

/* "cycloudpickle/cycloudpickle.pyx":102
 * 
 * 
 * def _builtin_type(name):             # <<<<<<<<<<<<<<
 *     return getattr(types, name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_1_builtin_type(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_1_builtin_type = {"_builtin_type", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_1_builtin_type, METH_O, 0};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_1_builtin_type(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_builtin_type (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle__builtin_type(__pyx_self, ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle__builtin_type(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("_builtin_type", 0);

  /* "cycloudpickle/cycloudpickle.pyx":103
 * 
 * def _builtin_type(name):
 *     return getattr(types, name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __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;

  /* "cycloudpickle/cycloudpickle.pyx":102
 * 
 * 
 * def _builtin_type(name):             # <<<<<<<<<<<<<<
 *     return getattr(types, name)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle._builtin_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_13cycloudpickle_13cycloudpickle_4generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "cycloudpickle/cycloudpickle.pyx":107
 * 
 * if sys.version_info < (3, 4):
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_3_walk_global_ops(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_2_walk_global_ops[] = "\n        Yield (opcode, argument number) tuples for all\n        global-referencing instructions in *code*.\n        ";
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_3_walk_global_ops = {"_walk_global_ops", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_3_walk_global_ops, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_2_walk_global_ops};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_3_walk_global_ops(PyObject *__pyx_self, PyObject *__pyx_v_code) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_walk_global_ops (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_2_walk_global_ops(__pyx_self, ((PyObject *)__pyx_v_code));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_2_walk_global_ops(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_walk_global_ops", 0);
  __pyx_cur_scope = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *)__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops(__pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_code = __pyx_v_code;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_code);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_13cycloudpickle_13cycloudpickle_4generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_walk_global_ops, __pyx_n_s_walk_global_ops, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!gen)) __PYX_ERR(0, 107, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle._walk_global_ops", __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_13cycloudpickle_13cycloudpickle_4generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *__pyx_cur_scope = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: 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, 107, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":112
 *         global-referencing instructions in *code*.
 *         """
 *         code = getattr(code, 'co_code', b'')             # <<<<<<<<<<<<<<
 *         if not PY3:
 *             code = map(ord, code)
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_cur_scope->__pyx_v_code, __pyx_n_u_co_code, __pyx_kp_b_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_code);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_code, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":113
 *         """
 *         code = getattr(code, 'co_code', b'')
 *         if not PY3:             # <<<<<<<<<<<<<<
 *             code = map(ord, code)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __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, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":114
 *         code = getattr(code, 'co_code', b'')
 *         if not PY3:
 *             code = map(ord, code)             # <<<<<<<<<<<<<<
 * 
 *         n = len(code)
 */
    __pyx_t_1 = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_code);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_cur_scope->__pyx_v_code);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_code);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_code, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":113
 *         """
 *         code = getattr(code, 'co_code', b'')
 *         if not PY3:             # <<<<<<<<<<<<<<
 *             code = map(ord, code)
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":116
 *             code = map(ord, code)
 * 
 *         n = len(code)             # <<<<<<<<<<<<<<
 *         i = 0
 *         extended_arg = 0
 */
  __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_code); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 116, __pyx_L1_error)
  __pyx_cur_scope->__pyx_v_n = __pyx_t_5;

  /* "cycloudpickle/cycloudpickle.pyx":117
 * 
 *         n = len(code)
 *         i = 0             # <<<<<<<<<<<<<<
 *         extended_arg = 0
 *         while i < n:
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_cur_scope->__pyx_v_i = __pyx_int_0;

  /* "cycloudpickle/cycloudpickle.pyx":118
 *         n = len(code)
 *         i = 0
 *         extended_arg = 0             # <<<<<<<<<<<<<<
 *         while i < n:
 *             op = code[i]
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_cur_scope->__pyx_v_extended_arg = __pyx_int_0;

  /* "cycloudpickle/cycloudpickle.pyx":119
 *         i = 0
 *         extended_arg = 0
 *         while i < n:             # <<<<<<<<<<<<<<
 *             op = code[i]
 *             i += 1
 */
  while (1) {
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_i, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_3) break;

    /* "cycloudpickle/cycloudpickle.pyx":120
 *         extended_arg = 0
 *         while i < n:
 *             op = code[i]             # <<<<<<<<<<<<<<
 *             i += 1
 *             if op >= HAVE_ARGUMENT:
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_code, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_op);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_op, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":121
 *         while i < n:
 *             op = code[i]
 *             i += 1             # <<<<<<<<<<<<<<
 *             if op >= HAVE_ARGUMENT:
 *                 oparg = code[i] + code[i + 1] * 256 + extended_arg
 */
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":122
 *             op = code[i]
 *             i += 1
 *             if op >= HAVE_ARGUMENT:             # <<<<<<<<<<<<<<
 *                 oparg = code[i] + code[i + 1] * 256 + extended_arg
 *                 extended_arg = 0
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_HAVE_ARGUMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_op, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
    __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, 122, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "cycloudpickle/cycloudpickle.pyx":123
 *             i += 1
 *             if op >= HAVE_ARGUMENT:
 *                 oparg = code[i] + code[i + 1] * 256 + extended_arg             # <<<<<<<<<<<<<<
 *                 extended_arg = 0
 *                 i += 2
 */
      __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_code, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_code, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Multiply(__pyx_t_6, __pyx_int_256); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_cur_scope->__pyx_v_extended_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_oparg);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_oparg, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":124
 *             if op >= HAVE_ARGUMENT:
 *                 oparg = code[i] + code[i + 1] * 256 + extended_arg
 *                 extended_arg = 0             # <<<<<<<<<<<<<<
 *                 i += 2
 *                 if op == EXTENDED_ARG:
 */
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extended_arg);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_extended_arg, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);

      /* "cycloudpickle/cycloudpickle.pyx":125
 *                 oparg = code[i] + code[i + 1] * 256 + extended_arg
 *                 extended_arg = 0
 *                 i += 2             # <<<<<<<<<<<<<<
 *                 if op == EXTENDED_ARG:
 *                     extended_arg = oparg * 65536
 */
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_2, 2, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_i);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":126
 *                 extended_arg = 0
 *                 i += 2
 *                 if op == EXTENDED_ARG:             # <<<<<<<<<<<<<<
 *                     extended_arg = oparg * 65536
 *                 if op in GLOBAL_OPS:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EXTENDED_ARG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_op, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_3) {

        /* "cycloudpickle/cycloudpickle.pyx":127
 *                 i += 2
 *                 if op == EXTENDED_ARG:
 *                     extended_arg = oparg * 65536             # <<<<<<<<<<<<<<
 *                 if op in GLOBAL_OPS:
 *                     yield op, oparg
 */
        __pyx_t_6 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_oparg, __pyx_int_65536); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extended_arg);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_extended_arg, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":126
 *                 extended_arg = 0
 *                 i += 2
 *                 if op == EXTENDED_ARG:             # <<<<<<<<<<<<<<
 *                     extended_arg = oparg * 65536
 *                 if op in GLOBAL_OPS:
 */
      }

      /* "cycloudpickle/cycloudpickle.pyx":128
 *                 if op == EXTENDED_ARG:
 *                     extended_arg = oparg * 65536
 *                 if op in GLOBAL_OPS:             # <<<<<<<<<<<<<<
 *                     yield op, oparg
 * 
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_GLOBAL_OPS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_op, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "cycloudpickle/cycloudpickle.pyx":129
 *                     extended_arg = oparg * 65536
 *                 if op in GLOBAL_OPS:
 *                     yield op, oparg             # <<<<<<<<<<<<<<
 * 
 * else:
 */
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_op);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_op);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_op);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oparg);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oparg);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_v_oparg);
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        /* return from generator, yielding value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L10_resume_from_yield:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 129, __pyx_L1_error)

        /* "cycloudpickle/cycloudpickle.pyx":128
 *                 if op == EXTENDED_ARG:
 *                     extended_arg = oparg * 65536
 *                 if op in GLOBAL_OPS:             # <<<<<<<<<<<<<<
 *                     yield op, oparg
 * 
 */
      }

      /* "cycloudpickle/cycloudpickle.pyx":122
 *             op = code[i]
 *             i += 1
 *             if op >= HAVE_ARGUMENT:             # <<<<<<<<<<<<<<
 *                 oparg = code[i] + code[i + 1] * 256 + extended_arg
 *                 extended_arg = 0
 */
    }
  }

  /* "cycloudpickle/cycloudpickle.pyx":107
 * 
 * if sys.version_info < (3, 4):
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_walk_global_ops", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_13cycloudpickle_13cycloudpickle_7generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "cycloudpickle/cycloudpickle.pyx":132
 * 
 * else:
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_6_walk_global_ops(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_5_walk_global_ops[] = "\n        Yield (opcode, argument number) tuples for all\n        global-referencing instructions in *code*.\n        ";
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_6_walk_global_ops = {"_walk_global_ops", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_6_walk_global_ops, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_5_walk_global_ops};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_6_walk_global_ops(PyObject *__pyx_self, PyObject *__pyx_v_code) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_walk_global_ops (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_5_walk_global_ops(__pyx_self, ((PyObject *)__pyx_v_code));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_5_walk_global_ops(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_walk_global_ops", 0);
  __pyx_cur_scope = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *)__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops(__pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_code = __pyx_v_code;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_code);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_13cycloudpickle_13cycloudpickle_7generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_walk_global_ops, __pyx_n_s_walk_global_ops, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!gen)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle._walk_global_ops", __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_13cycloudpickle_13cycloudpickle_7generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *__pyx_cur_scope = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *)__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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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, 132, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":137
 *         global-referencing instructions in *code*.
 *         """
 *         for instr in dis.get_instructions(code):             # <<<<<<<<<<<<<<
 *             op = instr.opcode
 *             if op in GLOBAL_OPS:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dis); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_instructions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_code);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_code);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_cur_scope->__pyx_v_code);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __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;
  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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __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, 137, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 137, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 137, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 137, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_instr);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_instr, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":138
 *         """
 *         for instr in dis.get_instructions(code):
 *             op = instr.opcode             # <<<<<<<<<<<<<<
 *             if op in GLOBAL_OPS:
 *                 yield op, instr.arg
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_instr, __pyx_n_s_opcode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_op);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_op, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":139
 *         for instr in dis.get_instructions(code):
 *             op = instr.opcode
 *             if op in GLOBAL_OPS:             # <<<<<<<<<<<<<<
 *                 yield op, instr.arg
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_GLOBAL_OPS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_op, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 139, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "cycloudpickle/cycloudpickle.pyx":140
 *             op = instr.opcode
 *             if op in GLOBAL_OPS:
 *                 yield op, instr.arg             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_instr, __pyx_n_s_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_op);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_op);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_op);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      __Pyx_XGIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
      __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
      __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_resume_from_yield:;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_3);
      __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, 140, __pyx_L1_error)

      /* "cycloudpickle/cycloudpickle.pyx":139
 *         for instr in dis.get_instructions(code):
 *             op = instr.opcode
 *             if op in GLOBAL_OPS:             # <<<<<<<<<<<<<<
 *                 yield op, instr.arg
 * 
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":137
 *         global-referencing instructions in *code*.
 *         """
 *         for instr in dis.get_instructions(code):             # <<<<<<<<<<<<<<
 *             op = instr.opcode
 *             if op in GLOBAL_OPS:
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":132
 * 
 * else:
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */

  /* 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_4);
  __Pyx_AddTraceback("_walk_global_ops", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":148
 *     else {})
 * 
 * def extract_code_globals(co):             # <<<<<<<<<<<<<<
 *     """
 *     Find all globals names read or written to by codeblock co
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_9extract_code_globals(PyObject *__pyx_self, PyObject *__pyx_v_co); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_8extract_code_globals[] = "\n    Find all globals names read or written to by codeblock co\n    ";
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_9extract_code_globals = {"extract_code_globals", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_9extract_code_globals, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_8extract_code_globals};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_9extract_code_globals(PyObject *__pyx_self, PyObject *__pyx_v_co) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extract_code_globals (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_8extract_code_globals(__pyx_self, ((PyObject *)__pyx_v_co));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_13cycloudpickle_13cycloudpickle_20extract_code_globals_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "cycloudpickle/cycloudpickle.pyx":160
 *             out_names = set()
 *         else:
 *             out_names = set(names[oparg]             # <<<<<<<<<<<<<<
 *                             for op, oparg in _walk_global_ops(co))
 * 
 */

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_20extract_code_globals_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *)__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr(__pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *) __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_13cycloudpickle_13cycloudpickle_20extract_code_globals_2generator2, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_extract_code_globals_locals_gene, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!gen)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.extract_code_globals.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_13cycloudpickle_13cycloudpickle_20extract_code_globals_2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *)__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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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, 160, __pyx_L1_error)
  __pyx_r = PySet_New(NULL); if (unlikely(!__pyx_r)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);

  /* "cycloudpickle/cycloudpickle.pyx":161
 *         else:
 *             out_names = set(names[oparg]
 *                             for op, oparg in _walk_global_ops(co))             # <<<<<<<<<<<<<<
 * 
 *             # see if nested function have any global refs
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_walk_global_ops); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_co)) { __Pyx_RaiseClosureNameError("co"); __PYX_ERR(0, 161, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_co); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_co);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_co);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_co);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __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_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, 161, __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, 161, __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_COMPILING_IN_CPYTHON
        __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, 161, __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, 161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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, 161, __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, 161, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 161, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 161, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      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, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __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_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
      __pyx_t_8 = 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_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 161, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_op);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_op, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_oparg);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_oparg, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":160
 *             out_names = set()
 *         else:
 *             out_names = set(names[oparg]             # <<<<<<<<<<<<<<
 *                             for op, oparg in _walk_global_ops(co))
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_names)) { __Pyx_RaiseClosureNameError("names"); __PYX_ERR(0, 160, __pyx_L1_error) }
    __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_names, __pyx_cur_scope->__pyx_v_oparg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PySet_Add(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":161
 *         else:
 *             out_names = set(names[oparg]
 *                             for op, oparg in _walk_global_ops(co))             # <<<<<<<<<<<<<<
 * 
 *             # see if nested function have any global refs
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":160
 *             out_names = set()
 *         else:
 *             out_names = set(names[oparg]             # <<<<<<<<<<<<<<
 *                             for op, oparg in _walk_global_ops(co))
 * 
 */

  /* 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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":148
 *     else {})
 * 
 * def extract_code_globals(co):             # <<<<<<<<<<<<<<
 *     """
 *     Find all globals names read or written to by codeblock co
 */

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_8extract_code_globals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_co) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *__pyx_cur_scope;
  PyObject *__pyx_v_out_names = 0;
  PyObject *__pyx_v_const = 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;
  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;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("extract_code_globals", 0);
  __pyx_cur_scope = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *)__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals(__pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_co = __pyx_v_co;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_co);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_co);

  /* "cycloudpickle/cycloudpickle.pyx":152
 *     Find all globals names read or written to by codeblock co
 *     """
 *     cdef set out_names = _extract_code_globals_cache.get(co)             # <<<<<<<<<<<<<<
 *     if out_names is None:
 *         try:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_extract_code_globals_cache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __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, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_co); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_co);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_co);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_cur_scope->__pyx_v_co);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __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;
  if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 152, __pyx_L1_error)
  __pyx_v_out_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":153
 *     """
 *     cdef set out_names = _extract_code_globals_cache.get(co)
 *     if out_names is None:             # <<<<<<<<<<<<<<
 *         try:
 *             names = co.co_names
 */
  __pyx_t_5 = (__pyx_v_out_names == ((PyObject*)Py_None));
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "cycloudpickle/cycloudpickle.pyx":154
 *     cdef set out_names = _extract_code_globals_cache.get(co)
 *     if out_names is None:
 *         try:             # <<<<<<<<<<<<<<
 *             names = co.co_names
 *         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:*/ {

        /* "cycloudpickle/cycloudpickle.pyx":155
 *     if out_names is None:
 *         try:
 *             names = co.co_names             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             # PyPy "builtin-code" object
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_co, __pyx_n_s_co_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_v_names = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":154
 *     cdef set out_names = _extract_code_globals_cache.get(co)
 *     if out_names is None:
 *         try:             # <<<<<<<<<<<<<<
 *             names = co.co_names
 *         except AttributeError:
 */
      }

      /* "cycloudpickle/cycloudpickle.pyx":160
 *             out_names = set()
 *         else:
 *             out_names = set(names[oparg]             # <<<<<<<<<<<<<<
 *                             for op, oparg in _walk_global_ops(co))
 * 
 */
      /*else:*/ {
        __pyx_t_1 = __pyx_pf_13cycloudpickle_13cycloudpickle_20extract_code_globals_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF_SET(__pyx_v_out_names, ((PyObject*)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":164
 * 
 *             # see if nested function have any global refs
 *             if co.co_consts:             # <<<<<<<<<<<<<<
 *                 for const in co.co_consts:
 *                     if type(const) is types.CodeType:
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_co, __pyx_n_s_co_consts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 164, __pyx_L6_except_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_6) {

          /* "cycloudpickle/cycloudpickle.pyx":165
 *             # see if nested function have any global refs
 *             if co.co_consts:
 *                 for const in co.co_consts:             # <<<<<<<<<<<<<<
 *                     if type(const) is types.CodeType:
 *                         out_names |= extract_code_globals(const)
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_co, __pyx_n_s_co_consts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          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_10 = 0;
            __pyx_t_11 = NULL;
          } else {
            __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L6_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L6_except_error)
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          for (;;) {
            if (likely(!__pyx_t_11)) {
              if (likely(PyList_CheckExact(__pyx_t_1))) {
                if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 165, __pyx_L6_except_error)
                #else
                __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L6_except_error)
                __Pyx_GOTREF(__pyx_t_3);
                #endif
              } else {
                if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 165, __pyx_L6_except_error)
                #else
                __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L6_except_error)
                __Pyx_GOTREF(__pyx_t_3);
                #endif
              }
            } else {
              __pyx_t_3 = __pyx_t_11(__pyx_t_1);
              if (unlikely(!__pyx_t_3)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                  else __PYX_ERR(0, 165, __pyx_L6_except_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_3);
            }
            __Pyx_XDECREF_SET(__pyx_v_const, __pyx_t_3);
            __pyx_t_3 = 0;

            /* "cycloudpickle/cycloudpickle.pyx":166
 *             if co.co_consts:
 *                 for const in co.co_consts:
 *                     if type(const) is types.CodeType:             # <<<<<<<<<<<<<<
 *                         out_names |= extract_code_globals(const)
 * 
 */
            __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L6_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CodeType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L6_except_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_6 = (((PyObject *)Py_TYPE(__pyx_v_const)) == __pyx_t_4);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_5 = (__pyx_t_6 != 0);
            if (__pyx_t_5) {

              /* "cycloudpickle/cycloudpickle.pyx":167
 *                 for const in co.co_consts:
 *                     if type(const) is types.CodeType:
 *                         out_names |= extract_code_globals(const)             # <<<<<<<<<<<<<<
 * 
 *         _extract_code_globals_cache[co] = out_names
 */
              __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_extract_code_globals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L6_except_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_2 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && 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);
                }
              }
              if (!__pyx_t_2) {
                __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_const); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L6_except_error)
                __Pyx_GOTREF(__pyx_t_4);
              } else {
                __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 167, __pyx_L6_except_error)
                __Pyx_GOTREF(__pyx_t_12);
                __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
                __Pyx_INCREF(__pyx_v_const);
                __Pyx_GIVEREF(__pyx_v_const);
                PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_const);
                __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L6_except_error)
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              }
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_out_names, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L6_except_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (!(likely(PySet_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 167, __pyx_L6_except_error)
              __Pyx_DECREF_SET(__pyx_v_out_names, ((PyObject*)__pyx_t_3));
              __pyx_t_3 = 0;

              /* "cycloudpickle/cycloudpickle.pyx":166
 *             if co.co_consts:
 *                 for const in co.co_consts:
 *                     if type(const) is types.CodeType:             # <<<<<<<<<<<<<<
 *                         out_names |= extract_code_globals(const)
 * 
 */
            }

            /* "cycloudpickle/cycloudpickle.pyx":165
 *             # see if nested function have any global refs
 *             if co.co_consts:
 *                 for const in co.co_consts:             # <<<<<<<<<<<<<<
 *                     if type(const) is types.CodeType:
 *                         out_names |= extract_code_globals(const)
 */
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "cycloudpickle/cycloudpickle.pyx":164
 * 
 *             # see if nested function have any global refs
 *             if co.co_consts:             # <<<<<<<<<<<<<<
 *                 for const in co.co_consts:
 *                     if type(const) is types.CodeType:
 */
        }
      }
      __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_L4_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":156
 *         try:
 *             names = co.co_names
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             # PyPy "builtin-code" object
 *             out_names = set()
 */
      __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
      if (__pyx_t_13) {
        __Pyx_AddTraceback("cycloudpickle.cycloudpickle.extract_code_globals", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 156, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_4);

        /* "cycloudpickle/cycloudpickle.pyx":158
 *         except AttributeError:
 *             # PyPy "builtin-code" object
 *             out_names = set()             # <<<<<<<<<<<<<<
 *         else:
 *             out_names = set(names[oparg]
 */
        __pyx_t_12 = PySet_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 158, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF_SET(__pyx_v_out_names, ((PyObject*)__pyx_t_12));
        __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L5_exception_handled;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;

      /* "cycloudpickle/cycloudpickle.pyx":154
 *     cdef set out_names = _extract_code_globals_cache.get(co)
 *     if out_names is None:
 *         try:             # <<<<<<<<<<<<<<
 *             names = co.co_names
 *         except AttributeError:
 */
      __Pyx_PyThreadState_assign
      __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_PyThreadState_assign
      __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_L11_try_end:;
    }

    /* "cycloudpickle/cycloudpickle.pyx":169
 *                         out_names |= extract_code_globals(const)
 * 
 *         _extract_code_globals_cache[co] = out_names             # <<<<<<<<<<<<<<
 * 
 *     return out_names
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_extract_code_globals_cache); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_co, __pyx_v_out_names) < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":153
 *     """
 *     cdef set out_names = _extract_code_globals_cache.get(co)
 *     if out_names is None:             # <<<<<<<<<<<<<<
 *         try:
 *             names = co.co_names
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":171
 *         _extract_code_globals_cache[co] = out_names
 * 
 *     return out_names             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out_names);
  __pyx_r = __pyx_v_out_names;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":148
 *     else {})
 * 
 * def extract_code_globals(co):             # <<<<<<<<<<<<<<
 *     """
 *     Find all globals names read or written to by codeblock co
 */

  /* 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_12);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.extract_code_globals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_names);
  __Pyx_XDECREF(__pyx_v_const);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":180
 *     dispatch = Pickler.dispatch.copy()
 * 
 *     def __init__(self, file, protocol=None):             # <<<<<<<<<<<<<<
 *         Pickler.__init__(self, file, protocol)
 *         # set of modules to unpickle
 */

/* Python wrapper */
static int __pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_protocol = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_file,&__pyx_n_s_protocol,0};
    PyObject* values[2] = {0,0};
    values[1] = ((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  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_protocol);
          if (value) { values[1] = 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, 180, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_file = values[0];
    __pyx_v_protocol = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler___init__(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), __pyx_v_file, __pyx_v_protocol);

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

static int __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler___init__(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_file, PyObject *__pyx_v_protocol) {
  int __pyx_r;
  __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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cycloudpickle/cycloudpickle.pyx":181
 * 
 *     def __init__(self, file, protocol=None):
 *         Pickler.__init__(self, file, protocol)             # <<<<<<<<<<<<<<
 *         # set of modules to unpickle
 *         self.modules = set()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __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(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_file);
  __Pyx_INCREF(__pyx_v_protocol);
  __Pyx_GIVEREF(__pyx_v_protocol);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_protocol);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __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;

  /* "cycloudpickle/cycloudpickle.pyx":183
 *         Pickler.__init__(self, file, protocol)
 *         # set of modules to unpickle
 *         self.modules = set()             # <<<<<<<<<<<<<<
 *         # map ids to dictionary. used to ensure that functions can share global env
 *         self.globals_ref = {}
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->modules);
  __Pyx_DECREF(__pyx_v_self->modules);
  __pyx_v_self->modules = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":185
 *         self.modules = set()
 *         # map ids to dictionary. used to ensure that functions can share global env
 *         self.globals_ref = {}             # <<<<<<<<<<<<<<
 * 
 *     def dump(self, obj):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->globals_ref);
  __Pyx_DECREF(__pyx_v_self->globals_ref);
  __pyx_v_self->globals_ref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":180
 *     dispatch = Pickler.dispatch.copy()
 * 
 *     def __init__(self, file, protocol=None):             # <<<<<<<<<<<<<<
 *         Pickler.__init__(self, file, protocol)
 *         # set of modules to unpickle
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":187
 *         self.globals_ref = {}
 * 
 *     def dump(self, obj):             # <<<<<<<<<<<<<<
 *         self.inject_addons()
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_3dump(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_3dump(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dump (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_2dump(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_2dump(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_e = NULL;
  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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  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;
  __Pyx_RefNannySetupContext("dump", 0);

  /* "cycloudpickle/cycloudpickle.pyx":188
 * 
 *     def dump(self, obj):
 *         self.inject_addons()             # <<<<<<<<<<<<<<
 *         try:
 *             return Pickler.dump(self, obj)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_inject_addons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __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;

  /* "cycloudpickle/cycloudpickle.pyx":189
 *     def dump(self, obj):
 *         self.inject_addons()
 *         try:             # <<<<<<<<<<<<<<
 *             return Pickler.dump(self, obj)
 *         except RuntimeError as e:
 */
  {
    __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:*/ {

      /* "cycloudpickle/cycloudpickle.pyx":190
 *         self.inject_addons()
 *         try:
 *             return Pickler.dump(self, obj)             # <<<<<<<<<<<<<<
 *         except RuntimeError as e:
 *             if 'recursion' in e.args[0]:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler), __pyx_n_s_dump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && 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_7 = 1;
        }
      }
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 190, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_obj);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L7_try_return;

      /* "cycloudpickle/cycloudpickle.pyx":189
 *     def dump(self, obj):
 *         self.inject_addons()
 *         try:             # <<<<<<<<<<<<<<
 *             return Pickler.dump(self, obj)
 *         except RuntimeError as e:
 */
    }
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":191
 *         try:
 *             return Pickler.dump(self, obj)
 *         except RuntimeError as e:             # <<<<<<<<<<<<<<
 *             if 'recursion' in e.args[0]:
 *                 msg = """Could not pickle object as excessively deep recursion required."""
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 191, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_e = __pyx_t_2;
      /*try:*/ {

        /* "cycloudpickle/cycloudpickle.pyx":192
 *             return Pickler.dump(self, obj)
 *         except RuntimeError as e:
 *             if 'recursion' in e.args[0]:             # <<<<<<<<<<<<<<
 *                 msg = """Could not pickle object as excessively deep recursion required."""
 *                 raise pickle.PicklingError(msg)
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_recursion, __pyx_t_10, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 192, __pyx_L16_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_12 = (__pyx_t_11 != 0);
        if (__pyx_t_12) {

          /* "cycloudpickle/cycloudpickle.pyx":193
 *         except RuntimeError as e:
 *             if 'recursion' in e.args[0]:
 *                 msg = """Could not pickle object as excessively deep recursion required."""             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(msg)
 * 
 */
          __Pyx_INCREF(__pyx_kp_u_Could_not_pickle_object_as_exces);
          __pyx_v_msg = __pyx_kp_u_Could_not_pickle_object_as_exces;

          /* "cycloudpickle/cycloudpickle.pyx":194
 *             if 'recursion' in e.args[0]:
 *                 msg = """Could not pickle object as excessively deep recursion required."""
 *                 raise pickle.PicklingError(msg)             # <<<<<<<<<<<<<<
 * 
 *     def save_memoryview(self, obj):
 */
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 194, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
            }
          }
          if (!__pyx_t_3) {
            __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_msg); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 194, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_10);
          } else {
            __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 194, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_v_msg);
            __Pyx_GIVEREF(__pyx_v_msg);
            PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_msg);
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 194, __pyx_L16_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_Raise(__pyx_t_10, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __PYX_ERR(0, 194, __pyx_L16_error)

          /* "cycloudpickle/cycloudpickle.pyx":192
 *             return Pickler.dump(self, obj)
 *         except RuntimeError as e:
 *             if 'recursion' in e.args[0]:             # <<<<<<<<<<<<<<
 *                 msg = """Could not pickle object as excessively deep recursion required."""
 *                 raise pickle.PicklingError(msg)
 */
        }
      }

      /* "cycloudpickle/cycloudpickle.pyx":191
 *         try:
 *             return Pickler.dump(self, obj)
 *         except RuntimeError as e:             # <<<<<<<<<<<<<<
 *             if 'recursion' in e.args[0]:
 *                 msg = """Could not pickle object as excessively deep recursion required."""
 */
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e);
          __pyx_v_e = NULL;
          goto __pyx_L17;
        }
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __pyx_L16_error:;
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __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_t_9 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e);
            __pyx_v_e = NULL;
          }
          __Pyx_PyThreadState_assign
          if (PY_MAJOR_VERSION >= 3) {
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L5_except_error;
        }
        __pyx_L17:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cycloudpickle/cycloudpickle.pyx":189
 *     def dump(self, obj):
 *         self.inject_addons()
 *         try:             # <<<<<<<<<<<<<<
 *             return Pickler.dump(self, obj)
 *         except RuntimeError as e:
 */
    __Pyx_PyThreadState_assign
    __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_try_return:;
    __Pyx_PyThreadState_assign
    __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_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __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);
  }

  /* "cycloudpickle/cycloudpickle.pyx":187
 *         self.globals_ref = {}
 * 
 *     def dump(self, obj):             # <<<<<<<<<<<<<<
 *         self.inject_addons()
 *         try:
 */

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":196
 *                 raise pickle.PicklingError(msg)
 * 
 *     def save_memoryview(self, obj):             # <<<<<<<<<<<<<<
 *         """Fallback to save_string"""
 *         Pickler.save_string(self, str(obj))
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_5save_memoryview(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_4save_memoryview[] = "Fallback to save_string";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_5save_memoryview(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_memoryview (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_4save_memoryview(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_4save_memoryview(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  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 = NULL;
  __Pyx_RefNannySetupContext("save_memoryview", 0);

  /* "cycloudpickle/cycloudpickle.pyx":198
 *     def save_memoryview(self, obj):
 *         """Fallback to save_string"""
 *         Pickler.save_string(self, str(obj))             # <<<<<<<<<<<<<<
 * 
 *     def save_buffer(self, obj):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler), __pyx_n_s_save_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __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_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":196
 *                 raise pickle.PicklingError(msg)
 * 
 *     def save_memoryview(self, obj):             # <<<<<<<<<<<<<<
 *         """Fallback to save_string"""
 *         Pickler.save_string(self, str(obj))
 */

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

/* "cycloudpickle/cycloudpickle.pyx":200
 *         Pickler.save_string(self, str(obj))
 * 
 *     def save_buffer(self, obj):             # <<<<<<<<<<<<<<
 *         """Fallback to save_string"""
 *         Pickler.save_string(self,str(obj))
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_7save_buffer(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_6save_buffer[] = "Fallback to save_string";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_7save_buffer(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_6save_buffer(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_6save_buffer(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  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 = NULL;
  __Pyx_RefNannySetupContext("save_buffer", 0);

  /* "cycloudpickle/cycloudpickle.pyx":202
 *     def save_buffer(self, obj):
 *         """Fallback to save_string"""
 *         Pickler.save_string(self,str(obj))             # <<<<<<<<<<<<<<
 *     if PY3:
 *         dispatch[memoryview] = save_memoryview
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler), __pyx_n_s_save_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __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_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":200
 *         Pickler.save_string(self, str(obj))
 * 
 *     def save_buffer(self, obj):             # <<<<<<<<<<<<<<
 *         """Fallback to save_string"""
 *         Pickler.save_string(self,str(obj))
 */

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

/* "cycloudpickle/cycloudpickle.pyx":208
 *         dispatch[buffer] = save_buffer
 * 
 *     def save_unsupported(self, obj):             # <<<<<<<<<<<<<<
 *         raise pickle.PicklingError("Cannot pickle objects of type %s" % type(obj))
 *     dispatch[types.GeneratorType] = save_unsupported
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_9save_unsupported(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_9save_unsupported(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_unsupported (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_8save_unsupported(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_8save_unsupported(CYTHON_UNUSED struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  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;
  __Pyx_RefNannySetupContext("save_unsupported", 0);

  /* "cycloudpickle/cycloudpickle.pyx":209
 * 
 *     def save_unsupported(self, obj):
 *         raise pickle.PicklingError("Cannot pickle objects of type %s" % type(obj))             # <<<<<<<<<<<<<<
 *     dispatch[types.GeneratorType] = save_unsupported
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Cannot_pickle_objects_of_type_s, ((PyObject *)Py_TYPE(__pyx_v_obj))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __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 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 209, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":208
 *         dispatch[buffer] = save_buffer
 * 
 *     def save_unsupported(self, obj):             # <<<<<<<<<<<<<<
 *         raise pickle.PicklingError("Cannot pickle objects of type %s" % type(obj))
 *     dispatch[types.GeneratorType] = save_unsupported
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_unsupported", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":217
 *             dispatch[v] = save_unsupported
 * 
 *     def save_module(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Save a module as an import
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_11save_module(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_10save_module[] = "\n        Save a module as an import\n        ";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_11save_module(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_module (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_10save_module(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_10save_module(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_mod_name = NULL;
  int __pyx_v_is_dynamic;
  PyObject *__pyx_v_v = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("save_module", 0);

  /* "cycloudpickle/cycloudpickle.pyx":221
 *         Save a module as an import
 *         """
 *         mod_name = obj.__name__             # <<<<<<<<<<<<<<
 *         # If module is successfully found then it is not a dynamically created module
 *         cdef bint is_dynamic = True
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_mod_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":223
 *         mod_name = obj.__name__
 *         # If module is successfully found then it is not a dynamically created module
 *         cdef bint is_dynamic = True             # <<<<<<<<<<<<<<
 *         try:
 *             _find_module(mod_name)
 */
  __pyx_v_is_dynamic = 1;

  /* "cycloudpickle/cycloudpickle.pyx":224
 *         # If module is successfully found then it is not a dynamically created module
 *         cdef bint is_dynamic = True
 *         try:             # <<<<<<<<<<<<<<
 *             _find_module(mod_name)
 *             is_dynamic = False
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __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:*/ {

      /* "cycloudpickle/cycloudpickle.pyx":225
 *         cdef bint is_dynamic = True
 *         try:
 *             _find_module(mod_name)             # <<<<<<<<<<<<<<
 *             is_dynamic = False
 *         except ImportError:
 */
      __pyx_t_1 = __pyx_f_13cycloudpickle_13cycloudpickle__find_module(__pyx_v_mod_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":226
 *         try:
 *             _find_module(mod_name)
 *             is_dynamic = False             # <<<<<<<<<<<<<<
 *         except ImportError:
 *             pass
 */
      __pyx_v_is_dynamic = 0;

      /* "cycloudpickle/cycloudpickle.pyx":224
 *         # If module is successfully found then it is not a dynamically created module
 *         cdef bint is_dynamic = True
 *         try:             # <<<<<<<<<<<<<<
 *             _find_module(mod_name)
 *             is_dynamic = False
 */
    }
    __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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":227
 *             _find_module(mod_name)
 *             is_dynamic = False
 *         except ImportError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cycloudpickle/cycloudpickle.pyx":224
 *         # If module is successfully found then it is not a dynamically created module
 *         cdef bint is_dynamic = True
 *         try:             # <<<<<<<<<<<<<<
 *             _find_module(mod_name)
 *             is_dynamic = False
 */
    __Pyx_PyThreadState_assign
    __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_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __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);
    __pyx_L10_try_end:;
  }

  /* "cycloudpickle/cycloudpickle.pyx":230
 *             pass
 * 
 *         self.modules.add(obj)             # <<<<<<<<<<<<<<
 *         if is_dynamic:
 *             v = vars(obj)
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->modules, __pyx_n_s_add); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_obj);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":231
 * 
 *         self.modules.add(obj)
 *         if is_dynamic:             # <<<<<<<<<<<<<<
 *             v = vars(obj)
 *             if v.get('__builtins__') is vars(builtins):
 */
  __pyx_t_9 = (__pyx_v_is_dynamic != 0);
  if (__pyx_t_9) {

    /* "cycloudpickle/cycloudpickle.pyx":232
 *         self.modules.add(obj)
 *         if is_dynamic:
 *             v = vars(obj)             # <<<<<<<<<<<<<<
 *             if v.get('__builtins__') is vars(builtins):
 *                 v = dict(v, __builtins__=builtins)
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_vars, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_v = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":233
 *         if is_dynamic:
 *             v = vars(obj)
 *             if v.get('__builtins__') is vars(builtins):             # <<<<<<<<<<<<<<
 *                 v = dict(v, __builtins__=builtins)
 *             self.save_reduce(dynamic_subimport, (obj.__name__, v), obj=obj)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_builtins_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_vars, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = (__pyx_t_1 == __pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (__pyx_t_10) {

      /* "cycloudpickle/cycloudpickle.pyx":234
 *             v = vars(obj)
 *             if v.get('__builtins__') is vars(builtins):
 *                 v = dict(v, __builtins__=builtins)             # <<<<<<<<<<<<<<
 *             self.save_reduce(dynamic_subimport, (obj.__name__, v), obj=obj)
 *         else:
 */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_v);
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_builtins_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_builtins, __pyx_t_8) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":233
 *         if is_dynamic:
 *             v = vars(obj)
 *             if v.get('__builtins__') is vars(builtins):             # <<<<<<<<<<<<<<
 *                 v = dict(v, __builtins__=builtins)
 *             self.save_reduce(dynamic_subimport, (obj.__name__, v), obj=obj)
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":235
 *             if v.get('__builtins__') is vars(builtins):
 *                 v = dict(v, __builtins__=builtins)
 *             self.save_reduce(dynamic_subimport, (obj.__name__, v), obj=obj)             # <<<<<<<<<<<<<<
 *         else:
 *             self.save_reduce(subimport, (obj.__name__,), obj=obj)
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dynamic_subimport); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_v);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_1 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 235, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":231
 * 
 *         self.modules.add(obj)
 *         if is_dynamic:             # <<<<<<<<<<<<<<
 *             v = vars(obj)
 *             if v.get('__builtins__') is vars(builtins):
 */
    goto __pyx_L11;
  }

  /* "cycloudpickle/cycloudpickle.pyx":237
 *             self.save_reduce(dynamic_subimport, (obj.__name__, v), obj=obj)
 *         else:
 *             self.save_reduce(subimport, (obj.__name__,), obj=obj)             # <<<<<<<<<<<<<<
 *     dispatch[types.ModuleType] = save_module
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_subimport); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8);
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 237, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __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_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_L11:;

  /* "cycloudpickle/cycloudpickle.pyx":217
 *             dispatch[v] = save_unsupported
 * 
 *     def save_module(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Save a module as an import
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_module", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mod_name);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":240
 *     dispatch[types.ModuleType] = save_module
 * 
 *     def save_codeobject(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Save a code object
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_13save_codeobject(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_12save_codeobject[] = "\n        Save a code object\n        ";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_13save_codeobject(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_codeobject (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_12save_codeobject(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_12save_codeobject(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_args = NULL;
  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;
  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;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  __Pyx_RefNannySetupContext("save_codeobject", 0);

  /* "cycloudpickle/cycloudpickle.pyx":244
 *         Save a code object
 *         """
 *         if PY3:             # <<<<<<<<<<<<<<
 *             args = (
 *                 obj.co_argcount, obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __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, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":246
 *         if PY3:
 *             args = (
 *                 obj.co_argcount, obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,             # <<<<<<<<<<<<<<
 *                 obj.co_flags, obj.co_code, obj.co_consts, obj.co_names, obj.co_varnames,
 *                 obj.co_filename, obj.co_name, obj.co_firstlineno, obj.co_lnotab, obj.co_freevars,
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_argcount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_kwonlyargcount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_nlocals); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_stacksize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "cycloudpickle/cycloudpickle.pyx":247
 *             args = (
 *                 obj.co_argcount, obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,
 *                 obj.co_flags, obj.co_code, obj.co_consts, obj.co_names, obj.co_varnames,             # <<<<<<<<<<<<<<
 *                 obj.co_filename, obj.co_name, obj.co_firstlineno, obj.co_lnotab, obj.co_freevars,
 *                 obj.co_cellvars
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_consts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_names); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_varnames); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "cycloudpickle/cycloudpickle.pyx":248
 *                 obj.co_argcount, obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,
 *                 obj.co_flags, obj.co_code, obj.co_consts, obj.co_names, obj.co_varnames,
 *                 obj.co_filename, obj.co_name, obj.co_firstlineno, obj.co_lnotab, obj.co_freevars,             # <<<<<<<<<<<<<<
 *                 obj.co_cellvars
 *             )
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_filename); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_firstlineno); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_lnotab); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_freevars); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);

    /* "cycloudpickle/cycloudpickle.pyx":249
 *                 obj.co_flags, obj.co_code, obj.co_consts, obj.co_names, obj.co_varnames,
 *                 obj.co_filename, obj.co_name, obj.co_firstlineno, obj.co_lnotab, obj.co_freevars,
 *                 obj.co_cellvars             # <<<<<<<<<<<<<<
 *             )
 *         else:
 */
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_cellvars); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);

    /* "cycloudpickle/cycloudpickle.pyx":246
 *         if PY3:
 *             args = (
 *                 obj.co_argcount, obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,             # <<<<<<<<<<<<<<
 *                 obj.co_flags, obj.co_code, obj.co_consts, obj.co_names, obj.co_varnames,
 *                 obj.co_filename, obj.co_name, obj.co_firstlineno, obj.co_lnotab, obj.co_freevars,
 */
    __pyx_t_17 = PyTuple_New(15); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_17, 7, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_17, 8, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_17, 9, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_17, 10, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_17, 11, __pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_17, 12, __pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_17, 13, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_16);
    PyTuple_SET_ITEM(__pyx_t_17, 14, __pyx_t_16);
    __pyx_t_1 = 0;
    __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_12 = 0;
    __pyx_t_13 = 0;
    __pyx_t_14 = 0;
    __pyx_t_15 = 0;
    __pyx_t_16 = 0;
    __pyx_v_args = ((PyObject*)__pyx_t_17);
    __pyx_t_17 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":244
 *         Save a code object
 *         """
 *         if PY3:             # <<<<<<<<<<<<<<
 *             args = (
 *                 obj.co_argcount, obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cycloudpickle.pyx":253
 *         else:
 *             args = (
 *                 obj.co_argcount, obj.co_nlocals, obj.co_stacksize, obj.co_flags, obj.co_code,             # <<<<<<<<<<<<<<
 *                 obj.co_consts, obj.co_names, obj.co_varnames, obj.co_filename, obj.co_name,
 *                 obj.co_firstlineno, obj.co_lnotab, obj.co_freevars, obj.co_cellvars
 */
  /*else*/ {
    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_argcount); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_nlocals); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_stacksize); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_flags); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_code); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);

    /* "cycloudpickle/cycloudpickle.pyx":254
 *             args = (
 *                 obj.co_argcount, obj.co_nlocals, obj.co_stacksize, obj.co_flags, obj.co_code,
 *                 obj.co_consts, obj.co_names, obj.co_varnames, obj.co_filename, obj.co_name,             # <<<<<<<<<<<<<<
 *                 obj.co_firstlineno, obj.co_lnotab, obj.co_freevars, obj.co_cellvars
 *             )
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_consts); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_names); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_varnames); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_filename); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "cycloudpickle/cycloudpickle.pyx":255
 *                 obj.co_argcount, obj.co_nlocals, obj.co_stacksize, obj.co_flags, obj.co_code,
 *                 obj.co_consts, obj.co_names, obj.co_varnames, obj.co_filename, obj.co_name,
 *                 obj.co_firstlineno, obj.co_lnotab, obj.co_freevars, obj.co_cellvars             # <<<<<<<<<<<<<<
 *             )
 *         self.save_reduce(types.CodeType, args, obj=obj)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_firstlineno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_lnotab); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_freevars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_co_cellvars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "cycloudpickle/cycloudpickle.pyx":253
 *         else:
 *             args = (
 *                 obj.co_argcount, obj.co_nlocals, obj.co_stacksize, obj.co_flags, obj.co_code,             # <<<<<<<<<<<<<<
 *                 obj.co_consts, obj.co_names, obj.co_varnames, obj.co_filename, obj.co_name,
 *                 obj.co_firstlineno, obj.co_lnotab, obj.co_freevars, obj.co_cellvars
 */
    __pyx_t_3 = PyTuple_New(14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_17);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_17);
    __Pyx_GIVEREF(__pyx_t_16);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_16);
    __Pyx_GIVEREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 12, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 13, __pyx_t_4);
    __pyx_t_17 = 0;
    __pyx_t_16 = 0;
    __pyx_t_15 = 0;
    __pyx_t_14 = 0;
    __pyx_t_13 = 0;
    __pyx_t_12 = 0;
    __pyx_t_11 = 0;
    __pyx_t_10 = 0;
    __pyx_t_9 = 0;
    __pyx_t_8 = 0;
    __pyx_t_7 = 0;
    __pyx_t_6 = 0;
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_v_args = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "cycloudpickle/cycloudpickle.pyx":257
 *                 obj.co_firstlineno, obj.co_lnotab, obj.co_freevars, obj.co_cellvars
 *             )
 *         self.save_reduce(types.CodeType, args, obj=obj)             # <<<<<<<<<<<<<<
 *     dispatch[types.CodeType] = save_codeobject
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CodeType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __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_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __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;

  /* "cycloudpickle/cycloudpickle.pyx":240
 *     dispatch[types.ModuleType] = save_module
 * 
 *     def save_codeobject(self, obj):             # <<<<<<<<<<<<<<
 *         """
 *         Save a code object
 */

  /* 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_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_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_codeobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":260
 *     dispatch[types.CodeType] = save_codeobject
 * 
 *     def save_function(self, obj, str name=None):             # <<<<<<<<<<<<<<
 *         """ Registered with the dispatch to handle all function types.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_14save_function[] = " Registered with the dispatch to handle all function types.\n\n        Determines what kind of function obj is (e.g. lambda, defined at\n        interactive prompt, etc) and handles the pickling appropriately.\n        ";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_function (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_name_2,0};
    PyObject* values[2] = {0,0};
    values[1] = ((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  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save_function") < 0)) __PYX_ERR(0, 260, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save_function", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 260, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 260, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_14save_function(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), __pyx_v_obj, __pyx_v_name);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_14save_function(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_modname = 0;
  PyObject *__pyx_v_themodule = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_v_klass = 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 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("save_function", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "cycloudpickle/cycloudpickle.pyx":266
 *         interactive prompt, etc) and handles the pickling appropriately.
 *         """
 *         write = self.write             # <<<<<<<<<<<<<<
 * 
 *         if name is None:
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.write;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":268
 *         write = self.write
 * 
 *         if name is None:             # <<<<<<<<<<<<<<
 *             name = obj.__name__
 *         cdef str modname = pickle.whichmodule(obj, name)
 */
  __pyx_t_2 = (__pyx_v_name == ((PyObject*)Py_None));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":269
 * 
 *         if name is None:
 *             name = obj.__name__             # <<<<<<<<<<<<<<
 *         cdef str modname = pickle.whichmodule(obj, name)
 *         # print('which gives %s %s %s' % (modname, obj, name))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 269, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":268
 *         write = self.write
 * 
 *         if name is None:             # <<<<<<<<<<<<<<
 *             name = obj.__name__
 *         cdef str modname = pickle.whichmodule(obj, name)
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":270
 *         if name is None:
 *             name = obj.__name__
 *         cdef str modname = pickle.whichmodule(obj, name)             # <<<<<<<<<<<<<<
 *         # print('which gives %s %s %s' % (modname, obj, name))
 *         try:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_whichmodule); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __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_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_obj);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __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;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 270, __pyx_L1_error)
  __pyx_v_modname = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":272
 *         cdef str modname = pickle.whichmodule(obj, name)
 *         # print('which gives %s %s %s' % (modname, obj, name))
 *         try:             # <<<<<<<<<<<<<<
 *             themodule = sys.modules[modname]
 *         except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "cycloudpickle/cycloudpickle.pyx":273
 *         # print('which gives %s %s %s' % (modname, obj, name))
 *         try:
 *             themodule = sys.modules[modname]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             # eval'd items such as namedtuple give invalid items for their function __module__
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modules); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetItem(__pyx_t_5, __pyx_v_modname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_themodule = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":272
 *         cdef str modname = pickle.whichmodule(obj, name)
 *         # print('which gives %s %s %s' % (modname, obj, name))
 *         try:             # <<<<<<<<<<<<<<
 *             themodule = sys.modules[modname]
 *         except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":274
 *         try:
 *             themodule = sys.modules[modname]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             # eval'd items such as namedtuple give invalid items for their function __module__
 *             modname = '__main__'
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 274, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cycloudpickle/cycloudpickle.pyx":276
 *         except KeyError:
 *             # eval'd items such as namedtuple give invalid items for their function __module__
 *             modname = '__main__'             # <<<<<<<<<<<<<<
 * 
 *         if modname == '__main__':
 */
      __Pyx_INCREF(__pyx_n_u_main);
      __Pyx_DECREF_SET(__pyx_v_modname, __pyx_n_u_main);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "cycloudpickle/cycloudpickle.pyx":272
 *         cdef str modname = pickle.whichmodule(obj, name)
 *         # print('which gives %s %s %s' % (modname, obj, name))
 *         try:             # <<<<<<<<<<<<<<
 *             themodule = sys.modules[modname]
 *         except KeyError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L11_try_end:;
  }

  /* "cycloudpickle/cycloudpickle.pyx":278
 *             modname = '__main__'
 * 
 *         if modname == '__main__':             # <<<<<<<<<<<<<<
 *             themodule = None
 * 
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_modname, __pyx_n_u_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":279
 * 
 *         if modname == '__main__':
 *             themodule = None             # <<<<<<<<<<<<<<
 * 
 *         if themodule:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF_SET(__pyx_v_themodule, Py_None);

    /* "cycloudpickle/cycloudpickle.pyx":278
 *             modname = '__main__'
 * 
 *         if modname == '__main__':             # <<<<<<<<<<<<<<
 *             themodule = None
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":281
 *             themodule = None
 * 
 *         if themodule:             # <<<<<<<<<<<<<<
 *             self.modules.add(themodule)
 *             if getattr(themodule, name, None) is obj:
 */
  if (unlikely(!__pyx_v_themodule)) { __Pyx_RaiseUnboundLocalError("themodule"); __PYX_ERR(0, 281, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_themodule); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 281, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":282
 * 
 *         if themodule:
 *             self.modules.add(themodule)             # <<<<<<<<<<<<<<
 *             if getattr(themodule, name, None) is obj:
 *                 return self.save_global(obj, name)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->modules, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_v_themodule)) { __Pyx_RaiseUnboundLocalError("themodule"); __PYX_ERR(0, 282, __pyx_L1_error) }
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_themodule); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_themodule);
      __Pyx_GIVEREF(__pyx_v_themodule);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_themodule);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":283
 *         if themodule:
 *             self.modules.add(themodule)
 *             if getattr(themodule, name, None) is obj:             # <<<<<<<<<<<<<<
 *                 return self.save_global(obj, name)
 * 
 */
    if (unlikely(!__pyx_v_themodule)) { __Pyx_RaiseUnboundLocalError("themodule"); __PYX_ERR(0, 283, __pyx_L1_error) }
    __pyx_t_7 = __Pyx_GetAttr3(__pyx_v_themodule, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = (__pyx_t_7 == __pyx_v_obj);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cycloudpickle/cycloudpickle.pyx":284
 *             self.modules.add(themodule)
 *             if getattr(themodule, name, None) is obj:
 *                 return self.save_global(obj, name)             # <<<<<<<<<<<<<<
 * 
 *         # a builtin_function_or_method which comes in as an attribute of some
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_global); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && 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;
        }
      }
      __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_v_obj);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_name);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "cycloudpickle/cycloudpickle.pyx":283
 *         if themodule:
 *             self.modules.add(themodule)
 *             if getattr(themodule, name, None) is obj:             # <<<<<<<<<<<<<<
 *                 return self.save_global(obj, name)
 * 
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":281
 *             themodule = None
 * 
 *         if themodule:             # <<<<<<<<<<<<<<
 *             self.modules.add(themodule)
 *             if getattr(themodule, name, None) is obj:
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":293
 *         # So we pickle them here using save_reduce; have to do it differently
 *         # for different python versions.
 *         if not hasattr(obj, '__code__'):             # <<<<<<<<<<<<<<
 *             if PY3:
 *                 if sys.version_info < (3, 4):
 */
  __pyx_t_3 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_u_code); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 293, __pyx_L1_error)
  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":294
 *         # for different python versions.
 *         if not hasattr(obj, '__code__'):
 *             if PY3:             # <<<<<<<<<<<<<<
 *                 if sys.version_info < (3, 4):
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "cycloudpickle/cycloudpickle.pyx":295
 *         if not hasattr(obj, '__code__'):
 *             if PY3:
 *                 if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 *                 else:
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_2) {

        /* "cycloudpickle/cycloudpickle.pyx":296
 *             if PY3:
 *                 if sys.version_info < (3, 4):
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)             # <<<<<<<<<<<<<<
 *                 else:
 *                     rv = obj.__reduce_ex__(self.proto)
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_Can_t_pickle_r, __pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && 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);
          }
        }
        if (!__pyx_t_4) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 296, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(0, 296, __pyx_L1_error)

        /* "cycloudpickle/cycloudpickle.pyx":295
 *         if not hasattr(obj, '__code__'):
 *             if PY3:
 *                 if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 *                 else:
 */
      }

      /* "cycloudpickle/cycloudpickle.pyx":298
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 *                 else:
 *                     rv = obj.__reduce_ex__(self.proto)             # <<<<<<<<<<<<<<
 *             else:
 *                 if hasattr(obj, '__self__'):
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_reduce_ex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.proto); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 298, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_5 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && 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);
          }
        }
        if (!__pyx_t_5) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else {
          __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_GIVEREF(__pyx_t_12);
          PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_12);
          __pyx_t_12 = 0;
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_rv = __pyx_t_7;
        __pyx_t_7 = 0;
      }

      /* "cycloudpickle/cycloudpickle.pyx":294
 *         # for different python versions.
 *         if not hasattr(obj, '__code__'):
 *             if PY3:             # <<<<<<<<<<<<<<
 *                 if sys.version_info < (3, 4):
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 */
      goto __pyx_L18;
    }

    /* "cycloudpickle/cycloudpickle.pyx":300
 *                     rv = obj.__reduce_ex__(self.proto)
 *             else:
 *                 if hasattr(obj, '__self__'):             # <<<<<<<<<<<<<<
 *                     rv = (getattr, (obj.__self__, name))
 *                 else:
 */
    /*else*/ {
      __pyx_t_2 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_u_self); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 300, __pyx_L1_error)
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "cycloudpickle/cycloudpickle.pyx":301
 *             else:
 *                 if hasattr(obj, '__self__'):
 *                     rv = (getattr, (obj.__self__, name))             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 */
        __pyx_t_7 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_name);
        __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
        __pyx_t_7 = 0;
        __pyx_t_4 = 0;
        __pyx_v_rv = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":300
 *                     rv = obj.__reduce_ex__(self.proto)
 *             else:
 *                 if hasattr(obj, '__self__'):             # <<<<<<<<<<<<<<
 *                     rv = (getattr, (obj.__self__, name))
 *                 else:
 */
        goto __pyx_L20;
      }

      /* "cycloudpickle/cycloudpickle.pyx":303
 *                     rv = (getattr, (obj.__self__, name))
 *                 else:
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)             # <<<<<<<<<<<<<<
 *             if isinstance(rv, tuple):
 *                 return Pickler.save_reduce(self, obj=obj, *rv)
 */
      /*else*/ {
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_Can_t_pickle_r, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_12) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __pyx_t_12 = NULL;
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 303, __pyx_L1_error)
      }
      __pyx_L20:;
    }
    __pyx_L18:;

    /* "cycloudpickle/cycloudpickle.pyx":304
 *                 else:
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 *             if isinstance(rv, tuple):             # <<<<<<<<<<<<<<
 *                 return Pickler.save_reduce(self, obj=obj, *rv)
 *             else:
 */
    __pyx_t_3 = PyTuple_Check(__pyx_v_rv); 
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cycloudpickle.pyx":305
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 *             if isinstance(rv, tuple):
 *                 return Pickler.save_reduce(self, obj=obj, *rv)             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.save_global(obj, rv)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_self));
      __pyx_t_5 = PySequence_Tuple(__pyx_v_rv); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 305, __pyx_L1_error)
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "cycloudpickle/cycloudpickle.pyx":304
 *                 else:
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 *             if isinstance(rv, tuple):             # <<<<<<<<<<<<<<
 *                 return Pickler.save_reduce(self, obj=obj, *rv)
 *             else:
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":307
 *                 return Pickler.save_reduce(self, obj=obj, *rv)
 *             else:
 *                 return self.save_global(obj, rv)             # <<<<<<<<<<<<<<
 * 
 *         # if func is lambda, def'ed at prompt, is in main, or is nested, then
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_global); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && 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;
        }
      }
      __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_v_obj);
      __Pyx_INCREF(__pyx_v_rv);
      __Pyx_GIVEREF(__pyx_v_rv);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_rv);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;
    }

    /* "cycloudpickle/cycloudpickle.pyx":293
 *         # So we pickle them here using save_reduce; have to do it differently
 *         # for different python versions.
 *         if not hasattr(obj, '__code__'):             # <<<<<<<<<<<<<<
 *             if PY3:
 *                 if sys.version_info < (3, 4):
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":312
 *         # we'll pickle the actual function object rather than simply saving a
 *         # reference (as is done in default pickler), via save_function_tuple.
 *         if (islambda(obj)             # <<<<<<<<<<<<<<
 *                 or getattr(obj.__code__, 'co_filename', None) == '<stdin>'
 *                 or themodule is None):
 */
  __pyx_t_7 = __pyx_f_13cycloudpickle_13cycloudpickle_islambda(__pyx_v_obj); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L23_bool_binop_done;
  }

  /* "cycloudpickle/cycloudpickle.pyx":313
 *         # reference (as is done in default pickler), via save_function_tuple.
 *         if (islambda(obj)
 *                 or getattr(obj.__code__, 'co_filename', None) == '<stdin>'             # <<<<<<<<<<<<<<
 *                 or themodule is None):
 *             self.save_function_tuple(obj)
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_code); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_u_co_filename, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_kp_u_stdin, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L23_bool_binop_done;
  }

  /* "cycloudpickle/cycloudpickle.pyx":314
 *         if (islambda(obj)
 *                 or getattr(obj.__code__, 'co_filename', None) == '<stdin>'
 *                 or themodule is None):             # <<<<<<<<<<<<<<
 *             self.save_function_tuple(obj)
 *             return
 */
  if (unlikely(!__pyx_v_themodule)) { __Pyx_RaiseUnboundLocalError("themodule"); __PYX_ERR(0, 314, __pyx_L1_error) }
  __pyx_t_3 = (__pyx_v_themodule == Py_None);
  __pyx_t_13 = (__pyx_t_3 != 0);
  __pyx_t_2 = __pyx_t_13;
  __pyx_L23_bool_binop_done:;

  /* "cycloudpickle/cycloudpickle.pyx":312
 *         # we'll pickle the actual function object rather than simply saving a
 *         # reference (as is done in default pickler), via save_function_tuple.
 *         if (islambda(obj)             # <<<<<<<<<<<<<<
 *                 or getattr(obj.__code__, 'co_filename', None) == '<stdin>'
 *                 or themodule is None):
 */
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":315
 *                 or getattr(obj.__code__, 'co_filename', None) == '<stdin>'
 *                 or themodule is None):
 *             self.save_function_tuple(obj)             # <<<<<<<<<<<<<<
 *             return
 *         else:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_function_tuple); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":316
 *                 or themodule is None):
 *             self.save_function_tuple(obj)
 *             return             # <<<<<<<<<<<<<<
 *         else:
 *             # func is nested
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cycloudpickle.pyx":312
 *         # we'll pickle the actual function object rather than simply saving a
 *         # reference (as is done in default pickler), via save_function_tuple.
 *         if (islambda(obj)             # <<<<<<<<<<<<<<
 *                 or getattr(obj.__code__, 'co_filename', None) == '<stdin>'
 *                 or themodule is None):
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":319
 *         else:
 *             # func is nested
 *             klass = getattr(themodule, name, None)             # <<<<<<<<<<<<<<
 *             if klass is None or klass is not obj:
 *                 self.save_function_tuple(obj)
 */
  /*else*/ {
    if (unlikely(!__pyx_v_themodule)) { __Pyx_RaiseUnboundLocalError("themodule"); __PYX_ERR(0, 319, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_themodule, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_klass = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":320
 *             # func is nested
 *             klass = getattr(themodule, name, None)
 *             if klass is None or klass is not obj:             # <<<<<<<<<<<<<<
 *                 self.save_function_tuple(obj)
 *                 return
 */
    __pyx_t_13 = (__pyx_v_klass == Py_None);
    __pyx_t_3 = (__pyx_t_13 != 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L27_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_klass != __pyx_v_obj);
    __pyx_t_13 = (__pyx_t_3 != 0);
    __pyx_t_2 = __pyx_t_13;
    __pyx_L27_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cycloudpickle/cycloudpickle.pyx":321
 *             klass = getattr(themodule, name, None)
 *             if klass is None or klass is not obj:
 *                 self.save_function_tuple(obj)             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_function_tuple); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_obj);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":322
 *             if klass is None or klass is not obj:
 *                 self.save_function_tuple(obj)
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         if obj.__dict__:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "cycloudpickle/cycloudpickle.pyx":320
 *             # func is nested
 *             klass = getattr(themodule, name, None)
 *             if klass is None or klass is not obj:             # <<<<<<<<<<<<<<
 *                 self.save_function_tuple(obj)
 *                 return
 */
    }
  }

  /* "cycloudpickle/cycloudpickle.pyx":324
 *                 return
 * 
 *         if obj.__dict__:             # <<<<<<<<<<<<<<
 *             # essentially save_reduce, but workaround needed to avoid recursion
 *             self.save(_restore_attr)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __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, 324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":326
 *         if obj.__dict__:
 *             # essentially save_reduce, but workaround needed to avoid recursion
 *             self.save(_restore_attr)             # <<<<<<<<<<<<<<
 *             write(pickle.MARK + pickle.GLOBAL + modname + '\n' + name + '\n')
 *             self.memoize(obj)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_restore_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":327
 *             # essentially save_reduce, but workaround needed to avoid recursion
 *             self.save(_restore_attr)
 *             write(pickle.MARK + pickle.GLOBAL + modname + '\n' + name + '\n')             # <<<<<<<<<<<<<<
 *             self.memoize(obj)
 *             self.save(obj.__dict__)
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_MARK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_GLOBAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_modname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_1 = __pyx_v_write; __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __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(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":328
 *             self.save(_restore_attr)
 *             write(pickle.MARK + pickle.GLOBAL + modname + '\n' + name + '\n')
 *             self.memoize(obj)             # <<<<<<<<<<<<<<
 *             self.save(obj.__dict__)
 *             write(pickle.TUPLE + pickle.REDUCE)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":329
 *             write(pickle.MARK + pickle.GLOBAL + modname + '\n' + name + '\n')
 *             self.memoize(obj)
 *             self.save(obj.__dict__)             # <<<<<<<<<<<<<<
 *             write(pickle.TUPLE + pickle.REDUCE)
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":330
 *             self.memoize(obj)
 *             self.save(obj.__dict__)
 *             write(pickle.TUPLE + pickle.REDUCE)             # <<<<<<<<<<<<<<
 *         else:
 *             write(pickle.GLOBAL + modname + '\n' + name + '\n')
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TUPLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_REDUCE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_7 = __pyx_v_write; __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":324
 *                 return
 * 
 *         if obj.__dict__:             # <<<<<<<<<<<<<<
 *             # essentially save_reduce, but workaround needed to avoid recursion
 *             self.save(_restore_attr)
 */
    goto __pyx_L29;
  }

  /* "cycloudpickle/cycloudpickle.pyx":332
 *             write(pickle.TUPLE + pickle.REDUCE)
 *         else:
 *             write(pickle.GLOBAL + modname + '\n' + name + '\n')             # <<<<<<<<<<<<<<
 *             self.memoize(obj)
 *     dispatch[types.FunctionType] = save_function
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_GLOBAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_v_modname); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_kp_u__4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_kp_u__4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_7 = __pyx_v_write; __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":333
 *         else:
 *             write(pickle.GLOBAL + modname + '\n' + name + '\n')
 *             self.memoize(obj)             # <<<<<<<<<<<<<<
 *     dispatch[types.FunctionType] = save_function
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L29:;

  /* "cycloudpickle/cycloudpickle.pyx":260
 *     dispatch[types.CodeType] = save_codeobject
 * 
 *     def save_function(self, obj, str name=None):             # <<<<<<<<<<<<<<
 *         """ Registered with the dispatch to handle all function types.
 * 
 */

  /* 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_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_modname);
  __Pyx_XDECREF(__pyx_v_themodule);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":336
 *     dispatch[types.FunctionType] = save_function
 * 
 *     def save_function_tuple(self, func):             # <<<<<<<<<<<<<<
 *         """  Pickles an actual func object.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_17save_function_tuple(PyObject *__pyx_v_self, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_16save_function_tuple[] = "  Pickles an actual func object.\n\n        A func comprises: code, globals, defaults, closure, and dict.  We\n        extract and save these, injecting reducing functions at certain points\n        to recreate the func object.  Keep in mind that some of these pieces\n        can contain a ref to the func itself.  Thus, a naive save on these\n        pieces could trigger an infinite loop of save's.  To get around that,\n        we first create a skeleton func object using just the code (this is\n        safe, since this won't contain a ref to the func), and memoize it as\n        soon as it's created.  The other stuff can then be filled in later.\n        ";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_17save_function_tuple(PyObject *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_function_tuple (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_16save_function_tuple(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_func));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_16save_function_tuple(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_code = NULL;
  PyObject *__pyx_v_f_globals = NULL;
  PyObject *__pyx_v_defaults = NULL;
  PyObject *__pyx_v_closure = NULL;
  PyObject *__pyx_v_dct = NULL;
  PyObject *__pyx_v_base_globals = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  __Pyx_RefNannySetupContext("save_function_tuple", 0);

  /* "cycloudpickle/cycloudpickle.pyx":348
 *         soon as it's created.  The other stuff can then be filled in later.
 *         """
 *         if is_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *             self.save_reduce(_rebuild_tornado_coroutine, (func.__wrapped__,),
 *                              obj=func)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_tornado_coroutine); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_func);
    __Pyx_GIVEREF(__pyx_v_func);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_func);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __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, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "cycloudpickle/cycloudpickle.pyx":349
 *         """
 *         if is_tornado_coroutine(func):
 *             self.save_reduce(_rebuild_tornado_coroutine, (func.__wrapped__,),             # <<<<<<<<<<<<<<
 *                              obj=func)
 *             return
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_rebuild_tornado_coroutine); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_wrapped); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":350
 *         if is_tornado_coroutine(func):
 *             self.save_reduce(_rebuild_tornado_coroutine, (func.__wrapped__,),
 *                              obj=func)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_obj, __pyx_v_func) < 0) __PYX_ERR(0, 350, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":349
 *         """
 *         if is_tornado_coroutine(func):
 *             self.save_reduce(_rebuild_tornado_coroutine, (func.__wrapped__,),             # <<<<<<<<<<<<<<
 *                              obj=func)
 *             return
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":351
 *             self.save_reduce(_rebuild_tornado_coroutine, (func.__wrapped__,),
 *                              obj=func)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         save = self.save
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "cycloudpickle/cycloudpickle.pyx":348
 *         soon as it's created.  The other stuff can then be filled in later.
 *         """
 *         if is_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *             self.save_reduce(_rebuild_tornado_coroutine, (func.__wrapped__,),
 *                              obj=func)
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":353
 *             return
 * 
 *         save = self.save             # <<<<<<<<<<<<<<
 *         write = self.write
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_save = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":354
 * 
 *         save = self.save
 *         write = self.write             # <<<<<<<<<<<<<<
 * 
 *         code, f_globals, defaults, closure, dct, base_globals = self.extract_func_data(func)
 */
  __pyx_t_2 = __pyx_v_self->__pyx_base.write;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_write = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":356
 *         write = self.write
 * 
 *         code, f_globals, defaults, closure, dct, base_globals = self.extract_func_data(func)             # <<<<<<<<<<<<<<
 * 
 *         save(_fill_function)  # skeleton function updater
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extract_func_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_func);
    __Pyx_GIVEREF(__pyx_v_func);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_func);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __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;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 6)) {
      if (size > 6) __Pyx_RaiseTooManyValuesError(6);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 356, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 5); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_8);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
      for (i=0; i < 6; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 356, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
    __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    for (index=0; index < 6; index++) {
      PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 6) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
    __pyx_t_10 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 356, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_code = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_f_globals = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_defaults = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_closure = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_dct = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_v_base_globals = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":358
 *         code, f_globals, defaults, closure, dct, base_globals = self.extract_func_data(func)
 * 
 *         save(_fill_function)  # skeleton function updater             # <<<<<<<<<<<<<<
 *         write(pickle.MARK)    # beginning of tuple that _fill_function expects
 * 
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_fill_function); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_save);
  __pyx_t_7 = __pyx_v_save; __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":359
 * 
 *         save(_fill_function)  # skeleton function updater
 *         write(pickle.MARK)    # beginning of tuple that _fill_function expects             # <<<<<<<<<<<<<<
 * 
 *         # create a skeleton function object and memoize it
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_MARK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_7 = __pyx_v_write; __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":362
 * 
 *         # create a skeleton function object and memoize it
 *         save(_make_skel_func)             # <<<<<<<<<<<<<<
 *         save((code, closure, base_globals))
 *         write(pickle.REDUCE)
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_make_skel_func); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_save);
  __pyx_t_6 = __pyx_v_save; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":363
 *         # create a skeleton function object and memoize it
 *         save(_make_skel_func)
 *         save((code, closure, base_globals))             # <<<<<<<<<<<<<<
 *         write(pickle.REDUCE)
 *         self.memoize(func)
 */
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_code);
  __Pyx_GIVEREF(__pyx_v_code);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_code);
  __Pyx_INCREF(__pyx_v_closure);
  __Pyx_GIVEREF(__pyx_v_closure);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_closure);
  __Pyx_INCREF(__pyx_v_base_globals);
  __Pyx_GIVEREF(__pyx_v_base_globals);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_base_globals);
  __Pyx_INCREF(__pyx_v_save);
  __pyx_t_8 = __pyx_v_save; __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":364
 *         save(_make_skel_func)
 *         save((code, closure, base_globals))
 *         write(pickle.REDUCE)             # <<<<<<<<<<<<<<
 *         self.memoize(func)
 * 
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_REDUCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_8 = __pyx_v_write; __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":365
 *         save((code, closure, base_globals))
 *         write(pickle.REDUCE)
 *         self.memoize(func)             # <<<<<<<<<<<<<<
 * 
 *         # save the rest of the func data needed by _fill_function
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __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+1, __pyx_v_func);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":368
 * 
 *         # save the rest of the func data needed by _fill_function
 *         save(f_globals)             # <<<<<<<<<<<<<<
 *         save(defaults)
 *         save(dct)
 */
  __Pyx_INCREF(__pyx_v_save);
  __pyx_t_8 = __pyx_v_save; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_f_globals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_f_globals);
    __Pyx_GIVEREF(__pyx_v_f_globals);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_f_globals);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":369
 *         # save the rest of the func data needed by _fill_function
 *         save(f_globals)
 *         save(defaults)             # <<<<<<<<<<<<<<
 *         save(dct)
 *         write(pickle.TUPLE)
 */
  __Pyx_INCREF(__pyx_v_save);
  __pyx_t_8 = __pyx_v_save; __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_defaults); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_v_defaults);
    __Pyx_GIVEREF(__pyx_v_defaults);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_defaults);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":370
 *         save(f_globals)
 *         save(defaults)
 *         save(dct)             # <<<<<<<<<<<<<<
 *         write(pickle.TUPLE)
 *         write(pickle.REDUCE)  # applies _fill_function on the tuple
 */
  __Pyx_INCREF(__pyx_v_save);
  __pyx_t_8 = __pyx_v_save; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_dct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_dct);
    __Pyx_GIVEREF(__pyx_v_dct);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_dct);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":371
 *         save(defaults)
 *         save(dct)
 *         write(pickle.TUPLE)             # <<<<<<<<<<<<<<
 *         write(pickle.REDUCE)  # applies _fill_function on the tuple
 * 
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_TUPLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_8 = __pyx_v_write; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":372
 *         save(dct)
 *         write(pickle.TUPLE)
 *         write(pickle.REDUCE)  # applies _fill_function on the tuple             # <<<<<<<<<<<<<<
 * 
 *     def extract_func_data(self, func):
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_REDUCE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_8 = __pyx_v_write; __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":336
 *     dispatch[types.FunctionType] = save_function
 * 
 *     def save_function_tuple(self, func):             # <<<<<<<<<<<<<<
 *         """  Pickles an actual func object.
 * 
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_function_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_f_globals);
  __Pyx_XDECREF(__pyx_v_defaults);
  __Pyx_XDECREF(__pyx_v_closure);
  __Pyx_XDECREF(__pyx_v_dct);
  __Pyx_XDECREF(__pyx_v_base_globals);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":374
 *         write(pickle.REDUCE)  # applies _fill_function on the tuple
 * 
 *     def extract_func_data(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the function into a tuple of data necessary to recreate it:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_19extract_func_data(PyObject *__pyx_v_self, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_18extract_func_data[] = "\n        Turn the function into a tuple of data necessary to recreate it:\n            code, globals, defaults, closure, dict\n        ";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_19extract_func_data(PyObject *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("extract_func_data (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_18extract_func_data(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_func));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_18extract_func_data(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_v_code = NULL;
  PyObject *__pyx_v_func_global_refs = NULL;
  PyObject *__pyx_v_f_globals = NULL;
  PyObject *__pyx_v_var = NULL;
  PyObject *__pyx_v_defaults = NULL;
  PyObject *__pyx_v_closure = NULL;
  PyObject *__pyx_v_dct = NULL;
  PyObject *__pyx_v_base_globals = 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 *);
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("extract_func_data", 0);

  /* "cycloudpickle/cycloudpickle.pyx":379
 *             code, globals, defaults, closure, dict
 *         """
 *         code = func.__code__             # <<<<<<<<<<<<<<
 * 
 *         # extract all global ref's
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_code = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":382
 * 
 *         # extract all global ref's
 *         func_global_refs = extract_code_globals(code)             # <<<<<<<<<<<<<<
 * 
 *         # process all variables referenced by global environment
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_extract_code_globals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_code);
    __Pyx_GIVEREF(__pyx_v_code);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_code);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_func_global_refs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":385
 * 
 *         # process all variables referenced by global environment
 *         f_globals = {}             # <<<<<<<<<<<<<<
 *         for var in func_global_refs:
 *             if var in func.__globals__:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_f_globals = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":386
 *         # process all variables referenced by global environment
 *         f_globals = {}
 *         for var in func_global_refs:             # <<<<<<<<<<<<<<
 *             if var in func.__globals__:
 *                 f_globals[var] = func.__globals__[var]
 */
  if (likely(PyList_CheckExact(__pyx_v_func_global_refs)) || PyTuple_CheckExact(__pyx_v_func_global_refs)) {
    __pyx_t_1 = __pyx_v_func_global_refs; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_func_global_refs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 386, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":387
 *         f_globals = {}
 *         for var in func_global_refs:
 *             if var in func.__globals__:             # <<<<<<<<<<<<<<
 *                 f_globals[var] = func.__globals__[var]
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_globals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_var, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 387, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = (__pyx_t_7 != 0);
    if (__pyx_t_8) {

      /* "cycloudpickle/cycloudpickle.pyx":388
 *         for var in func_global_refs:
 *             if var in func.__globals__:
 *                 f_globals[var] = func.__globals__[var]             # <<<<<<<<<<<<<<
 * 
 *         # defaults requires no processing
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_globals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyObject_GetItem(__pyx_t_2, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(PyDict_SetItem(__pyx_v_f_globals, __pyx_v_var, __pyx_t_4) < 0)) __PYX_ERR(0, 388, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":387
 *         f_globals = {}
 *         for var in func_global_refs:
 *             if var in func.__globals__:             # <<<<<<<<<<<<<<
 *                 f_globals[var] = func.__globals__[var]
 * 
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":386
 *         # process all variables referenced by global environment
 *         f_globals = {}
 *         for var in func_global_refs:             # <<<<<<<<<<<<<<
 *             if var in func.__globals__:
 *                 f_globals[var] = func.__globals__[var]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":391
 * 
 *         # defaults requires no processing
 *         defaults = func.__defaults__             # <<<<<<<<<<<<<<
 * 
 *         # process closure
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_defaults); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_defaults = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":394
 * 
 *         # process closure
 *         closure = [c.cell_contents for c in func.__closure__] if func.__closure__ else []             # <<<<<<<<<<<<<<
 * 
 *         # save the dict
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_closure); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __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, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_8) {
    { /* enter inner scope */
      PyObject *__pyx_8genexpr1__pyx_v_c = NULL;
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_closure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L8_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, 394, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L8_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_COMPILING_IN_CPYTHON
            __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, 394, __pyx_L8_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __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, 394, __pyx_L8_error)
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L8_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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 394, __pyx_L8_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_c, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_c, __pyx_n_s_cell_contents); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 394, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_c);
      goto __pyx_L11_exit_scope;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_c);
      goto __pyx_L1_error;
      __pyx_L11_exit_scope:;
    } /* exit inner scope */
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_v_closure = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":397
 * 
 *         # save the dict
 *         dct = func.__dict__             # <<<<<<<<<<<<<<
 * 
 *         base_globals = self.globals_ref.get(id(func.__globals__), {})
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":399
 *         dct = func.__dict__
 * 
 *         base_globals = self.globals_ref.get(id(func.__globals__), {})             # <<<<<<<<<<<<<<
 *         self.globals_ref[id(func.__globals__)] = base_globals
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->globals_ref, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_globals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_9) {
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_base_globals = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":400
 * 
 *         base_globals = self.globals_ref.get(id(func.__globals__), {})
 *         self.globals_ref[id(func.__globals__)] = base_globals             # <<<<<<<<<<<<<<
 * 
 *         return (code, f_globals, defaults, closure, dct, base_globals)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_globals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(PyObject_SetItem(__pyx_v_self->globals_ref, __pyx_t_1, __pyx_v_base_globals) < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":402
 *         self.globals_ref[id(func.__globals__)] = base_globals
 * 
 *         return (code, f_globals, defaults, closure, dct, base_globals)             # <<<<<<<<<<<<<<
 * 
 *     def save_builtin_function(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_code);
  __Pyx_GIVEREF(__pyx_v_code);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_code);
  __Pyx_INCREF(__pyx_v_f_globals);
  __Pyx_GIVEREF(__pyx_v_f_globals);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_f_globals);
  __Pyx_INCREF(__pyx_v_defaults);
  __Pyx_GIVEREF(__pyx_v_defaults);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_defaults);
  __Pyx_INCREF(__pyx_v_closure);
  __Pyx_GIVEREF(__pyx_v_closure);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_closure);
  __Pyx_INCREF(__pyx_v_dct);
  __Pyx_GIVEREF(__pyx_v_dct);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_dct);
  __Pyx_INCREF(__pyx_v_base_globals);
  __Pyx_GIVEREF(__pyx_v_base_globals);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_base_globals);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":374
 *         write(pickle.REDUCE)  # applies _fill_function on the tuple
 * 
 *     def extract_func_data(self, func):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the function into a tuple of data necessary to recreate it:
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.extract_func_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_func_global_refs);
  __Pyx_XDECREF(__pyx_v_f_globals);
  __Pyx_XDECREF(__pyx_v_var);
  __Pyx_XDECREF(__pyx_v_defaults);
  __Pyx_XDECREF(__pyx_v_closure);
  __Pyx_XDECREF(__pyx_v_dct);
  __Pyx_XDECREF(__pyx_v_base_globals);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":404
 *         return (code, f_globals, defaults, closure, dct, base_globals)
 * 
 *     def save_builtin_function(self, obj):             # <<<<<<<<<<<<<<
 *         if obj.__module__ == "__builtin__":
 *             return self.save_global(obj)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_21save_builtin_function(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_21save_builtin_function(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_builtin_function (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_20save_builtin_function(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_20save_builtin_function(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("save_builtin_function", 0);

  /* "cycloudpickle/cycloudpickle.pyx":405
 * 
 *     def save_builtin_function(self, obj):
 *         if obj.__module__ == "__builtin__":             # <<<<<<<<<<<<<<
 *             return self.save_global(obj)
 *         return self.save_function(obj)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_module); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_builtin, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":406
 *     def save_builtin_function(self, obj):
 *         if obj.__module__ == "__builtin__":
 *             return self.save_global(obj)             # <<<<<<<<<<<<<<
 *         return self.save_function(obj)
 *     dispatch[types.BuiltinFunctionType] = save_builtin_function
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_global); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __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 = NULL;
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_obj);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "cycloudpickle/cycloudpickle.pyx":405
 * 
 *     def save_builtin_function(self, obj):
 *         if obj.__module__ == "__builtin__":             # <<<<<<<<<<<<<<
 *             return self.save_global(obj)
 *         return self.save_function(obj)
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":407
 *         if obj.__module__ == "__builtin__":
 *             return self.save_global(obj)
 *         return self.save_function(obj)             # <<<<<<<<<<<<<<
 *     dispatch[types.BuiltinFunctionType] = save_builtin_function
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_function); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __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;

  /* "cycloudpickle/cycloudpickle.pyx":404
 *         return (code, f_globals, defaults, closure, dct, base_globals)
 * 
 *     def save_builtin_function(self, obj):             # <<<<<<<<<<<<<<
 *         if obj.__module__ == "__builtin__":
 *             return self.save_global(obj)
 */

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

/* "cycloudpickle/cycloudpickle.pyx":410
 *     dispatch[types.BuiltinFunctionType] = save_builtin_function
 * 
 *     def save_global(self, obj, str name=None, pack=struct.pack):             # <<<<<<<<<<<<<<
 *         cdef str modname = getattr(obj, "__module__", None)
 *         if modname == "__builtin__" or modname == "builtins":
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_23save_global(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_23save_global(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED PyObject *__pyx_v_pack = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_global (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_name_2,&__pyx_n_s_pack,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)Py_None);
    values[2] = __pyx_k__5;
    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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name_2);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pack);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save_global") < 0)) __PYX_ERR(0, 410, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_pack = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save_global", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 410, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_global", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(0, 410, __pyx_L1_error)
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_22save_global(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), __pyx_v_obj, __pyx_v_name, __pyx_v_pack);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_22save_global(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_pack) {
  PyObject *__pyx_v_modname = 0;
  PyObject *__pyx_v_themodule = NULL;
  PyTypeObject *__pyx_v_typ = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_new_override = 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;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("save_global", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "cycloudpickle/cycloudpickle.pyx":411
 * 
 *     def save_global(self, obj, str name=None, pack=struct.pack):
 *         cdef str modname = getattr(obj, "__module__", None)             # <<<<<<<<<<<<<<
 *         if modname == "__builtin__" or modname == "builtins":
 *             if obj in _BUILTIN_TYPE_NAMES:
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_module, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 411, __pyx_L1_error)
  __pyx_v_modname = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":412
 *     def save_global(self, obj, str name=None, pack=struct.pack):
 *         cdef str modname = getattr(obj, "__module__", None)
 *         if modname == "__builtin__" or modname == "builtins":             # <<<<<<<<<<<<<<
 *             if obj in _BUILTIN_TYPE_NAMES:
 *                 return self.save_reduce(_builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj)
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_modname, __pyx_n_u_builtin, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 412, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_modname, __pyx_n_u_builtins_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 412, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":413
 *         cdef str modname = getattr(obj, "__module__", None)
 *         if modname == "__builtin__" or modname == "builtins":
 *             if obj in _BUILTIN_TYPE_NAMES:             # <<<<<<<<<<<<<<
 *                 return self.save_reduce(_builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj)
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BUILTIN_TYPE_NAMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_obj, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "cycloudpickle/cycloudpickle.pyx":414
 *         if modname == "__builtin__" or modname == "builtins":
 *             if obj in _BUILTIN_TYPE_NAMES:
 *                 return self.save_reduce(_builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj)             # <<<<<<<<<<<<<<
 * 
 *         if name is None:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_builtin_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_BUILTIN_TYPE_NAMES); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_v_obj); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "cycloudpickle/cycloudpickle.pyx":413
 *         cdef str modname = getattr(obj, "__module__", None)
 *         if modname == "__builtin__" or modname == "builtins":
 *             if obj in _BUILTIN_TYPE_NAMES:             # <<<<<<<<<<<<<<
 *                 return self.save_reduce(_builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj)
 * 
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":412
 *     def save_global(self, obj, str name=None, pack=struct.pack):
 *         cdef str modname = getattr(obj, "__module__", None)
 *         if modname == "__builtin__" or modname == "builtins":             # <<<<<<<<<<<<<<
 *             if obj in _BUILTIN_TYPE_NAMES:
 *                 return self.save_reduce(_builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj)
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":416
 *                 return self.save_reduce(_builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj)
 * 
 *         if name is None:             # <<<<<<<<<<<<<<
 *             name = obj.__name__
 * 
 */
  __pyx_t_3 = (__pyx_v_name == ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":417
 * 
 *         if name is None:
 *             name = obj.__name__             # <<<<<<<<<<<<<<
 * 
 *         if modname is None:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":416
 *                 return self.save_reduce(_builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj)
 * 
 *         if name is None:             # <<<<<<<<<<<<<<
 *             name = obj.__name__
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":419
 *             name = obj.__name__
 * 
 *         if modname is None:             # <<<<<<<<<<<<<<
 *             modname = pickle.whichmodule(obj, name)
 * 
 */
  __pyx_t_2 = (__pyx_v_modname == ((PyObject*)Py_None));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":420
 * 
 *         if modname is None:
 *             modname = pickle.whichmodule(obj, name)             # <<<<<<<<<<<<<<
 * 
 *         if modname == '__main__':
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_whichmodule); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_v_obj);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_v_name);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_modname, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":419
 *             name = obj.__name__
 * 
 *         if modname is None:             # <<<<<<<<<<<<<<
 *             modname = pickle.whichmodule(obj, name)
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":422
 *             modname = pickle.whichmodule(obj, name)
 * 
 *         if modname == '__main__':             # <<<<<<<<<<<<<<
 *             themodule = None
 *         else:
 */
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_modname, __pyx_n_u_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":423
 * 
 *         if modname == '__main__':
 *             themodule = None             # <<<<<<<<<<<<<<
 *         else:
 *             __import__(modname)
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_themodule = Py_None;

    /* "cycloudpickle/cycloudpickle.pyx":422
 *             modname = pickle.whichmodule(obj, name)
 * 
 *         if modname == '__main__':             # <<<<<<<<<<<<<<
 *             themodule = None
 *         else:
 */
    goto __pyx_L9;
  }

  /* "cycloudpickle/cycloudpickle.pyx":425
 *             themodule = None
 *         else:
 *             __import__(modname)             # <<<<<<<<<<<<<<
 *             themodule = sys.modules[modname]
 *             self.modules.add(themodule)
 */
  /*else*/ {
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_modname);
    __Pyx_GIVEREF(__pyx_v_modname);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_modname);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":426
 *         else:
 *             __import__(modname)
 *             themodule = sys.modules[modname]             # <<<<<<<<<<<<<<
 *             self.modules.add(themodule)
 * 
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_modules); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_v_modname); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_themodule = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":427
 *             __import__(modname)
 *             themodule = sys.modules[modname]
 *             self.modules.add(themodule)             # <<<<<<<<<<<<<<
 * 
 *         if name == 'input':
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->modules, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_themodule); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_themodule);
      __Pyx_GIVEREF(__pyx_v_themodule);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_themodule);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_L9:;

  /* "cycloudpickle/cycloudpickle.pyx":429
 *             self.modules.add(themodule)
 * 
 *         if name == 'input':             # <<<<<<<<<<<<<<
 *             print(obj, name, modname)
 *             print(hasattr(themodule, name))
 */
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_input, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":430
 * 
 *         if name == 'input':
 *             print(obj, name, modname)             # <<<<<<<<<<<<<<
 *             print(hasattr(themodule, name))
 *             print(getattr(themodule, name))
 */
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_obj);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_modname);
    __Pyx_GIVEREF(__pyx_v_modname);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_modname);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":431
 *         if name == 'input':
 *             print(obj, name, modname)
 *             print(hasattr(themodule, name))             # <<<<<<<<<<<<<<
 *             print(getattr(themodule, name))
 * 
 */
    __pyx_t_3 = PyObject_HasAttr(__pyx_v_themodule, __pyx_v_name); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 431, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":432
 *             print(obj, name, modname)
 *             print(hasattr(themodule, name))
 *             print(getattr(themodule, name))             # <<<<<<<<<<<<<<
 * 
 *         if hasattr(themodule, name) and getattr(themodule, name) is obj:
 */
    __pyx_t_5 = __Pyx_GetAttr(__pyx_v_themodule, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":429
 *             self.modules.add(themodule)
 * 
 *         if name == 'input':             # <<<<<<<<<<<<<<
 *             print(obj, name, modname)
 *             print(hasattr(themodule, name))
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":434
 *             print(getattr(themodule, name))
 * 
 *         if hasattr(themodule, name) and getattr(themodule, name) is obj:             # <<<<<<<<<<<<<<
 *             return Pickler.save_global(self, obj, name)
 * 
 */
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_themodule, __pyx_v_name); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 434, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_GetAttr(__pyx_v_themodule, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = (__pyx_t_5 == __pyx_v_obj);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_4 != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":435
 * 
 *         if hasattr(themodule, name) and getattr(themodule, name) is obj:
 *             return Pickler.save_global(self, obj, name)             # <<<<<<<<<<<<<<
 * 
 *         typ = type(obj)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler), __pyx_n_s_save_global); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_1 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_v_obj);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_8, __pyx_v_name);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "cycloudpickle/cycloudpickle.pyx":434
 *             print(getattr(themodule, name))
 * 
 *         if hasattr(themodule, name) and getattr(themodule, name) is obj:             # <<<<<<<<<<<<<<
 *             return Pickler.save_global(self, obj, name)
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":437
 *             return Pickler.save_global(self, obj, name)
 * 
 *         typ = type(obj)             # <<<<<<<<<<<<<<
 *         if typ is not obj and isinstance(obj, (type, types.ClassType)):
 *             d = dict(obj.__dict__)  # copy dict proxy to a dict
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj)));
  __pyx_v_typ = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_obj)));

  /* "cycloudpickle/cycloudpickle.pyx":438
 * 
 *         typ = type(obj)
 *         if typ is not obj and isinstance(obj, (type, types.ClassType)):             # <<<<<<<<<<<<<<
 *             d = dict(obj.__dict__)  # copy dict proxy to a dict
 *             if not isinstance(d.get('__dict__', None), property):
 */
  __pyx_t_2 = (__pyx_v_typ != ((PyTypeObject*)__pyx_v_obj));
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ClassType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = PyType_Check(__pyx_v_obj); 
  __pyx_t_9 = (__pyx_t_2 != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_4 = __pyx_t_9;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_9 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_7); 
  __pyx_t_2 = (__pyx_t_9 != 0);
  __pyx_t_4 = __pyx_t_2;
  __pyx_L17_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = (__pyx_t_4 != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":439
 *         typ = type(obj)
 *         if typ is not obj and isinstance(obj, (type, types.ClassType)):
 *             d = dict(obj.__dict__)  # copy dict proxy to a dict             # <<<<<<<<<<<<<<
 *             if not isinstance(d.get('__dict__', None), property):
 *                 # don't extract dict that are properties
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_d = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":440
 *         if typ is not obj and isinstance(obj, (type, types.ClassType)):
 *             d = dict(obj.__dict__)  # copy dict proxy to a dict
 *             if not isinstance(d.get('__dict__', None), property):             # <<<<<<<<<<<<<<
 *                 # don't extract dict that are properties
 *                 d.pop('__dict__', None)
 */
    __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_d, __pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyObject_IsInstance(__pyx_t_7, __pyx_builtin_property); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cycloudpickle.pyx":442
 *             if not isinstance(d.get('__dict__', None), property):
 *                 # don't extract dict that are properties
 *                 d.pop('__dict__', None)             # <<<<<<<<<<<<<<
 *             d.pop('__weakref__', None)
 * 
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_pop); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":440
 *         if typ is not obj and isinstance(obj, (type, types.ClassType)):
 *             d = dict(obj.__dict__)  # copy dict proxy to a dict
 *             if not isinstance(d.get('__dict__', None), property):             # <<<<<<<<<<<<<<
 *                 # don't extract dict that are properties
 *                 d.pop('__dict__', None)
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":443
 *                 # don't extract dict that are properties
 *                 d.pop('__dict__', None)
 *             d.pop('__weakref__', None)             # <<<<<<<<<<<<<<
 * 
 *             # hack as __new__ is stored differently in the __dict__
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_pop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":446
 * 
 *             # hack as __new__ is stored differently in the __dict__
 *             new_override = d.get('__new__', None)             # <<<<<<<<<<<<<<
 *             if new_override:
 *                 d['__new__'] = obj.__new__
 */
    __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_d, __pyx_n_u_new, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_new_override = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":447
 *             # hack as __new__ is stored differently in the __dict__
 *             new_override = d.get('__new__', None)
 *             if new_override:             # <<<<<<<<<<<<<<
 *                 d['__new__'] = obj.__new__
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_new_override); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "cycloudpickle/cycloudpickle.pyx":448
 *             new_override = d.get('__new__', None)
 *             if new_override:
 *                 d['__new__'] = obj.__new__             # <<<<<<<<<<<<<<
 * 
 *             self.save_reduce(typ, (obj.__name__, obj.__bases__, d), obj=obj)
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_new); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_u_new, __pyx_t_7) < 0)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":447
 *             # hack as __new__ is stored differently in the __dict__
 *             new_override = d.get('__new__', None)
 *             if new_override:             # <<<<<<<<<<<<<<
 *                 d['__new__'] = obj.__new__
 * 
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":450
 *                 d['__new__'] = obj.__new__
 * 
 *             self.save_reduce(typ, (obj.__name__, obj.__bases__, d), obj=obj)             # <<<<<<<<<<<<<<
 *         else:
 *             raise pickle.PicklingError("Can't pickle %r" % obj)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_bases); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_d);
    __Pyx_GIVEREF(__pyx_v_d);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_d);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_typ));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_typ));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_typ));
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 450, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":438
 * 
 *         typ = type(obj)
 *         if typ is not obj and isinstance(obj, (type, types.ClassType)):             # <<<<<<<<<<<<<<
 *             d = dict(obj.__dict__)  # copy dict proxy to a dict
 *             if not isinstance(d.get('__dict__', None), property):
 */
    goto __pyx_L14;
  }

  /* "cycloudpickle/cycloudpickle.pyx":452
 *             self.save_reduce(typ, (obj.__name__, obj.__bases__, d), obj=obj)
 *         else:
 *             raise pickle.PicklingError("Can't pickle %r" % obj)             # <<<<<<<<<<<<<<
 * 
 *     dispatch[type] = save_global
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_Can_t_pickle_r, __pyx_v_obj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __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, 452, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "cycloudpickle/cycloudpickle.pyx":410
 *     dispatch[types.BuiltinFunctionType] = save_builtin_function
 * 
 *     def save_global(self, obj, str name=None, pack=struct.pack):             # <<<<<<<<<<<<<<
 *         cdef str modname = getattr(obj, "__module__", None)
 *         if modname == "__builtin__" or modname == "builtins":
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_global", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_modname);
  __Pyx_XDECREF(__pyx_v_themodule);
  __Pyx_XDECREF(__pyx_v_typ);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_new_override);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":457
 *     dispatch[types.ClassType] = save_global
 * 
 *     def save_instancemethod(self, obj):             # <<<<<<<<<<<<<<
 *         # Memoization rarely is ever useful due to python bounding
 *         if obj.__self__ is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_25save_instancemethod(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_25save_instancemethod(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_instancemethod (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_24save_instancemethod(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_24save_instancemethod(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  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;
  Py_ssize_t __pyx_t_9;
  __Pyx_RefNannySetupContext("save_instancemethod", 0);

  /* "cycloudpickle/cycloudpickle.pyx":459
 *     def save_instancemethod(self, obj):
 *         # Memoization rarely is ever useful due to python bounding
 *         if obj.__self__ is None:             # <<<<<<<<<<<<<<
 *             self.save_reduce(getattr, (obj.im_class, obj.__name__))
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __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) {

    /* "cycloudpickle/cycloudpickle.pyx":460
 *         # Memoization rarely is ever useful due to python bounding
 *         if obj.__self__ is None:
 *             self.save_reduce(getattr, (obj.im_class, obj.__name__))             # <<<<<<<<<<<<<<
 *         else:
 *             if PY3:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_im_class); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && 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_9 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_t_8);
    __pyx_t_5 = 0;
    __pyx_t_8 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":459
 *     def save_instancemethod(self, obj):
 *         # Memoization rarely is ever useful due to python bounding
 *         if obj.__self__ is None:             # <<<<<<<<<<<<<<
 *             self.save_reduce(getattr, (obj.im_class, obj.__name__))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cycloudpickle.pyx":462
 *             self.save_reduce(getattr, (obj.im_class, obj.__name__))
 *         else:
 *             if PY3:             # <<<<<<<<<<<<<<
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__), obj=obj)
 *             else:
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __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, 462, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_3) {

      /* "cycloudpickle/cycloudpickle.pyx":463
 *         else:
 *             if PY3:
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__), obj=obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__, obj.__self__.__class__),
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_MethodType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_func); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
      __pyx_t_4 = 0;
      __pyx_t_8 = 0;
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
      __pyx_t_6 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 463, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":462
 *             self.save_reduce(getattr, (obj.im_class, obj.__name__))
 *         else:
 *             if PY3:             # <<<<<<<<<<<<<<
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__), obj=obj)
 *             else:
 */
      goto __pyx_L4;
    }

    /* "cycloudpickle/cycloudpickle.pyx":465
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__), obj=obj)
 *             else:
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__, obj.__self__.__class__),             # <<<<<<<<<<<<<<
 *                          obj=obj)
 *     dispatch[types.MethodType] = save_instancemethod
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MethodType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_func); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_class); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7);
      __pyx_t_5 = 0;
      __pyx_t_1 = 0;
      __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
      __pyx_t_8 = 0;
      __pyx_t_4 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":466
 *             else:
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__, obj.__self__.__class__),
 *                          obj=obj)             # <<<<<<<<<<<<<<
 *     dispatch[types.MethodType] = save_instancemethod
 * 
 */
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 466, __pyx_L1_error)

      /* "cycloudpickle/cycloudpickle.pyx":465
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__), obj=obj)
 *             else:
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__, obj.__self__.__class__),             # <<<<<<<<<<<<<<
 *                          obj=obj)
 *     dispatch[types.MethodType] = save_instancemethod
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "cycloudpickle/cycloudpickle.pyx":457
 *     dispatch[types.ClassType] = save_global
 * 
 *     def save_instancemethod(self, obj):             # <<<<<<<<<<<<<<
 *         # Memoization rarely is ever useful due to python bounding
 *         if obj.__self__ 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_instancemethod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":469
 *     dispatch[types.MethodType] = save_instancemethod
 * 
 *     def save_inst(self, obj):             # <<<<<<<<<<<<<<
 *         """Inner logic to save instance. Based off pickle.save_inst
 *         Supports __transient__"""
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_27save_inst(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_26save_inst[] = "Inner logic to save instance. Based off pickle.save_inst\n        Supports __transient__";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_27save_inst(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_inst (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_26save_inst(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_26save_inst(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_v_memo = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_getstate = NULL;
  PyObject *__pyx_v_stuff = NULL;
  PyObject *__pyx_v_transient = NULL;
  PyObject *__pyx_v_k = 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 = 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("save_inst", 0);

  /* "cycloudpickle/cycloudpickle.pyx":472
 *         """Inner logic to save instance. Based off pickle.save_inst
 *         Supports __transient__"""
 *         cls = obj.__class__             # <<<<<<<<<<<<<<
 * 
 *         memo = self.memo
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cls = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":474
 *         cls = obj.__class__
 * 
 *         memo = self.memo             # <<<<<<<<<<<<<<
 *         write = self.write
 *         save = self.save
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.memo;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_memo = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":475
 * 
 *         memo = self.memo
 *         write = self.write             # <<<<<<<<<<<<<<
 *         save = self.save
 * 
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.write;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":476
 *         memo = self.memo
 *         write = self.write
 *         save = self.save             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple args
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_save = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":479
 * 
 *         cdef tuple args
 *         if hasattr(obj, '__getinitargs__'):             # <<<<<<<<<<<<<<
 *             args = obj.__getinitargs__()
 *             len(args)  # XXX Assert it's a sequence
 */
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_u_getinitargs); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 479, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":480
 *         cdef tuple args
 *         if hasattr(obj, '__getinitargs__'):
 *             args = obj.__getinitargs__()             # <<<<<<<<<<<<<<
 *             len(args)  # XXX Assert it's a sequence
 *             pickle._keep_alive(args, memo)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_getinitargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 480, __pyx_L1_error)
    __pyx_v_args = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":481
 *         if hasattr(obj, '__getinitargs__'):
 *             args = obj.__getinitargs__()
 *             len(args)  # XXX Assert it's a sequence             # <<<<<<<<<<<<<<
 *             pickle._keep_alive(args, memo)
 *         else:
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 481, __pyx_L1_error)
    }
    __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 481, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":482
 *             args = obj.__getinitargs__()
 *             len(args)  # XXX Assert it's a sequence
 *             pickle._keep_alive(args, memo)             # <<<<<<<<<<<<<<
 *         else:
 *             args = ()
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_keep_alive); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && 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_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 482, __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_args);
    __Pyx_GIVEREF(__pyx_v_args);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_args);
    __Pyx_INCREF(__pyx_v_memo);
    __Pyx_GIVEREF(__pyx_v_memo);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_memo);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":479
 * 
 *         cdef tuple args
 *         if hasattr(obj, '__getinitargs__'):             # <<<<<<<<<<<<<<
 *             args = obj.__getinitargs__()
 *             len(args)  # XXX Assert it's a sequence
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cycloudpickle.pyx":484
 *             pickle._keep_alive(args, memo)
 *         else:
 *             args = ()             # <<<<<<<<<<<<<<
 * 
 *         write(pickle.MARK)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_empty_tuple);
    __pyx_v_args = __pyx_empty_tuple;
  }
  __pyx_L3:;

  /* "cycloudpickle/cycloudpickle.pyx":486
 *             args = ()
 * 
 *         write(pickle.MARK)             # <<<<<<<<<<<<<<
 * 
 *         if self.bin:
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MARK); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_5 = __pyx_v_write; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":488
 *         write(pickle.MARK)
 * 
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             save(cls)
 *             for arg in args:
 */
  __pyx_t_3 = (__pyx_v_self->__pyx_base.bin != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":489
 * 
 *         if self.bin:
 *             save(cls)             # <<<<<<<<<<<<<<
 *             for arg in args:
 *                 save(arg)
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_5 = __pyx_v_save; __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(__pyx_v_cls);
      __Pyx_GIVEREF(__pyx_v_cls);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_cls);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":490
 *         if self.bin:
 *             save(cls)
 *             for arg in args:             # <<<<<<<<<<<<<<
 *                 save(arg)
 *             write(pickle.OBJ)
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 490, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    for (;;) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 490, __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, 490, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":491
 *             save(cls)
 *             for arg in args:
 *                 save(arg)             # <<<<<<<<<<<<<<
 *             write(pickle.OBJ)
 *         else:
 */
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_7 = __pyx_v_save; __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_arg);
        __Pyx_GIVEREF(__pyx_v_arg);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_arg);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":490
 *         if self.bin:
 *             save(cls)
 *             for arg in args:             # <<<<<<<<<<<<<<
 *                 save(arg)
 *             write(pickle.OBJ)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":492
 *             for arg in args:
 *                 save(arg)
 *             write(pickle.OBJ)             # <<<<<<<<<<<<<<
 *         else:
 *             for arg in args:
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_OBJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_5 = __pyx_v_write; __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":488
 *         write(pickle.MARK)
 * 
 *         if self.bin:             # <<<<<<<<<<<<<<
 *             save(cls)
 *             for arg in args:
 */
    goto __pyx_L4;
  }

  /* "cycloudpickle/cycloudpickle.pyx":494
 *             write(pickle.OBJ)
 *         else:
 *             for arg in args:             # <<<<<<<<<<<<<<
 *                 save(arg)
 *             write(pickle.INST + cls.__module__ + '\n' + cls.__name__ + '\n')
 */
  /*else*/ {
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 494, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    for (;;) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 494, __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, 494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":495
 *         else:
 *             for arg in args:
 *                 save(arg)             # <<<<<<<<<<<<<<
 *             write(pickle.INST + cls.__module__ + '\n' + cls.__name__ + '\n')
 * 
 */
      __Pyx_INCREF(__pyx_v_save);
      __pyx_t_8 = __pyx_v_save; __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_arg);
        __Pyx_GIVEREF(__pyx_v_arg);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_arg);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":494
 *             write(pickle.OBJ)
 *         else:
 *             for arg in args:             # <<<<<<<<<<<<<<
 *                 save(arg)
 *             write(pickle.INST + cls.__module__ + '\n' + cls.__name__ + '\n')
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":496
 *             for arg in args:
 *                 save(arg)
 *             write(pickle.INST + cls.__module__ + '\n' + cls.__name__ + '\n')             # <<<<<<<<<<<<<<
 * 
 *         self.memoize(obj)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_INST); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_module); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_kp_u__4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_8 = __pyx_v_write; __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "cycloudpickle/cycloudpickle.pyx":498
 *             write(pickle.INST + cls.__module__ + '\n' + cls.__name__ + '\n')
 * 
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":500
 *         self.memoize(obj)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             getstate = obj.__getstate__
 *         except AttributeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "cycloudpickle/cycloudpickle.pyx":501
 * 
 *         try:
 *             getstate = obj.__getstate__             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             stuff = obj.__dict__
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_getstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_getstate = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":500
 *         self.memoize(obj)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             getstate = obj.__getstate__
 *         except AttributeError:
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":512
 *                         del stuff[k]
 *         else:
 *             stuff = getstate()             # <<<<<<<<<<<<<<
 *             pickle._keep_alive(stuff, memo)
 *         save(stuff)
 */
    /*else:*/ {
      __Pyx_INCREF(__pyx_v_getstate);
      __pyx_t_8 = __pyx_v_getstate; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L11_except_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L11_except_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_stuff = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":513
 *         else:
 *             stuff = getstate()
 *             pickle._keep_alive(stuff, memo)             # <<<<<<<<<<<<<<
 *         save(stuff)
 *         write(pickle.BUILD)
 */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 513, __pyx_L11_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_keep_alive); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L11_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L11_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_INCREF(__pyx_v_stuff);
      __Pyx_GIVEREF(__pyx_v_stuff);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_stuff);
      __Pyx_INCREF(__pyx_v_memo);
      __Pyx_GIVEREF(__pyx_v_memo);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_memo);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L11_except_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_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L16_try_end;
    __pyx_L9_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":502
 *         try:
 *             getstate = obj.__getstate__
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             stuff = obj.__dict__
 *             #remove items if transient
 */
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_inst", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 502, __pyx_L11_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cycloudpickle/cycloudpickle.pyx":503
 *             getstate = obj.__getstate__
 *         except AttributeError:
 *             stuff = obj.__dict__             # <<<<<<<<<<<<<<
 *             #remove items if transient
 *             if hasattr(obj, '__transient__'):
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __pyx_L11_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_stuff = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":505
 *             stuff = obj.__dict__
 *             #remove items if transient
 *             if hasattr(obj, '__transient__'):             # <<<<<<<<<<<<<<
 *                 transient = obj.__transient__
 *                 stuff = stuff.copy()
 */
      __pyx_t_3 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_u_transient); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 505, __pyx_L11_except_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "cycloudpickle/cycloudpickle.pyx":506
 *             #remove items if transient
 *             if hasattr(obj, '__transient__'):
 *                 transient = obj.__transient__             # <<<<<<<<<<<<<<
 *                 stuff = stuff.copy()
 *                 for k in list(stuff.keys()):
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_transient); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 506, __pyx_L11_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_v_transient = __pyx_t_8;
        __pyx_t_8 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":507
 *             if hasattr(obj, '__transient__'):
 *                 transient = obj.__transient__
 *                 stuff = stuff.copy()             # <<<<<<<<<<<<<<
 *                 for k in list(stuff.keys()):
 *                     if k in transient:
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_stuff, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L11_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (__pyx_t_13) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 507, __pyx_L11_except_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else {
          __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 507, __pyx_L11_except_error)
        }
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_stuff, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":508
 *                 transient = obj.__transient__
 *                 stuff = stuff.copy()
 *                 for k in list(stuff.keys()):             # <<<<<<<<<<<<<<
 *                     if k in transient:
 *                         del stuff[k]
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_stuff, __pyx_n_s_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L11_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
          }
        }
        if (__pyx_t_13) {
          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 508, __pyx_L11_except_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else {
          __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 508, __pyx_L11_except_error)
        }
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L11_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __pyx_t_5; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 508, __pyx_L11_except_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
          __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "cycloudpickle/cycloudpickle.pyx":509
 *                 stuff = stuff.copy()
 *                 for k in list(stuff.keys()):
 *                     if k in transient:             # <<<<<<<<<<<<<<
 *                         del stuff[k]
 *         else:
 */
          __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_transient, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 509, __pyx_L11_except_error)
          __pyx_t_3 = (__pyx_t_2 != 0);
          if (__pyx_t_3) {

            /* "cycloudpickle/cycloudpickle.pyx":510
 *                 for k in list(stuff.keys()):
 *                     if k in transient:
 *                         del stuff[k]             # <<<<<<<<<<<<<<
 *         else:
 *             stuff = getstate()
 */
            if (unlikely(PyObject_DelItem(__pyx_v_stuff, __pyx_v_k) < 0)) __PYX_ERR(0, 510, __pyx_L11_except_error)

            /* "cycloudpickle/cycloudpickle.pyx":509
 *                 stuff = stuff.copy()
 *                 for k in list(stuff.keys()):
 *                     if k in transient:             # <<<<<<<<<<<<<<
 *                         del stuff[k]
 *         else:
 */
          }

          /* "cycloudpickle/cycloudpickle.pyx":508
 *                 transient = obj.__transient__
 *                 stuff = stuff.copy()
 *                 for k in list(stuff.keys()):             # <<<<<<<<<<<<<<
 *                     if k in transient:
 *                         del stuff[k]
 */
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":505
 *             stuff = obj.__dict__
 *             #remove items if transient
 *             if hasattr(obj, '__transient__'):             # <<<<<<<<<<<<<<
 *                 transient = obj.__transient__
 *                 stuff = stuff.copy()
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L10_exception_handled;
    }
    goto __pyx_L11_except_error;
    __pyx_L11_except_error:;

    /* "cycloudpickle/cycloudpickle.pyx":500
 *         self.memoize(obj)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             getstate = obj.__getstate__
 *         except AttributeError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L10_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    __pyx_L16_try_end:;
  }

  /* "cycloudpickle/cycloudpickle.pyx":514
 *             stuff = getstate()
 *             pickle._keep_alive(stuff, memo)
 *         save(stuff)             # <<<<<<<<<<<<<<
 *         write(pickle.BUILD)
 * 
 */
  __Pyx_INCREF(__pyx_v_save);
  __pyx_t_4 = __pyx_v_save; __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_stuff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_stuff);
    __Pyx_GIVEREF(__pyx_v_stuff);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_stuff);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":515
 *             pickle._keep_alive(stuff, memo)
 *         save(stuff)
 *         write(pickle.BUILD)             # <<<<<<<<<<<<<<
 * 
 *     if not PY3:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_BUILD); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_v_write);
  __pyx_t_4 = __pyx_v_write; __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":469
 *     dispatch[types.MethodType] = save_instancemethod
 * 
 *     def save_inst(self, obj):             # <<<<<<<<<<<<<<
 *         """Inner logic to save instance. Based off pickle.save_inst
 *         Supports __transient__"""
 */

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_inst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XDECREF(__pyx_v_memo);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_getstate);
  __Pyx_XDECREF(__pyx_v_stuff);
  __Pyx_XDECREF(__pyx_v_transient);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":520
 *         dispatch[types.InstanceType] = save_inst
 * 
 *     def save_property(self, obj):             # <<<<<<<<<<<<<<
 *         # properties not correctly saved in python
 *         self.save_reduce(property, (obj.fget, obj.fset, obj.fdel, obj.__doc__), obj=obj)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_29save_property(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_29save_property(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_property (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_28save_property(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_28save_property(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  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;
  __Pyx_RefNannySetupContext("save_property", 0);

  /* "cycloudpickle/cycloudpickle.pyx":522
 *     def save_property(self, obj):
 *         # properties not correctly saved in python
 *         self.save_reduce(property, (obj.fget, obj.fset, obj.fdel, obj.__doc__), obj=obj)             # <<<<<<<<<<<<<<
 *     dispatch[property] = save_property
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_fget); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_fset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_fdel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_doc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_builtin_property);
  __Pyx_GIVEREF(__pyx_builtin_property);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_builtin_property);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 522, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":520
 *         dispatch[types.InstanceType] = save_inst
 * 
 *     def save_property(self, obj):             # <<<<<<<<<<<<<<
 *         # properties not correctly saved in python
 *         self.save_reduce(property, (obj.fget, obj.fset, obj.fdel, obj.__doc__), obj=obj)
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_property", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":525
 *     dispatch[property] = save_property
 * 
 *     def save_classmethod(self, obj):             # <<<<<<<<<<<<<<
 *         try:
 *             orig_func = obj.__func__
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_31save_classmethod(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_31save_classmethod(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_classmethod (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_30save_classmethod(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_30save_classmethod(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_orig_func = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("save_classmethod", 0);

  /* "cycloudpickle/cycloudpickle.pyx":526
 * 
 *     def save_classmethod(self, obj):
 *         try:             # <<<<<<<<<<<<<<
 *             orig_func = obj.__func__
 *         except AttributeError:  # Python 2.6
 */
  {
    __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:*/ {

      /* "cycloudpickle/cycloudpickle.pyx":527
 *     def save_classmethod(self, obj):
 *         try:
 *             orig_func = obj.__func__             # <<<<<<<<<<<<<<
 *         except AttributeError:  # Python 2.6
 *             orig_func = obj.__get__(None, object)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_func); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_orig_func = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":526
 * 
 *     def save_classmethod(self, obj):
 *         try:             # <<<<<<<<<<<<<<
 *             orig_func = obj.__func__
 *         except AttributeError:  # Python 2.6
 */
    }
    __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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":528
 *         try:
 *             orig_func = obj.__func__
 *         except AttributeError:  # Python 2.6             # <<<<<<<<<<<<<<
 *             orig_func = obj.__get__(None, object)
 *             if isinstance(obj, classmethod):
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_classmethod", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 528, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cycloudpickle/cycloudpickle.pyx":529
 *             orig_func = obj.__func__
 *         except AttributeError:  # Python 2.6
 *             orig_func = obj.__get__(None, object)             # <<<<<<<<<<<<<<
 *             if isinstance(obj, classmethod):
 *                 orig_func = orig_func.__func__  # Unbind
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_get_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 529, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 529, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, Py_None);
      __Pyx_INCREF(__pyx_builtin_object);
      __Pyx_GIVEREF(__pyx_builtin_object);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_builtin_object);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_orig_func, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":530
 *         except AttributeError:  # Python 2.6
 *             orig_func = obj.__get__(None, object)
 *             if isinstance(obj, classmethod):             # <<<<<<<<<<<<<<
 *                 orig_func = orig_func.__func__  # Unbind
 *         self.save_reduce(type(obj), (orig_func,), obj=obj)
 */
      __pyx_t_13 = PyObject_IsInstance(__pyx_v_obj, __pyx_builtin_classmethod); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 530, __pyx_L5_except_error)
      __pyx_t_14 = (__pyx_t_13 != 0);
      if (__pyx_t_14) {

        /* "cycloudpickle/cycloudpickle.pyx":531
 *             orig_func = obj.__get__(None, object)
 *             if isinstance(obj, classmethod):
 *                 orig_func = orig_func.__func__  # Unbind             # <<<<<<<<<<<<<<
 *         self.save_reduce(type(obj), (orig_func,), obj=obj)
 *     dispatch[builtins.classmethod] = save_classmethod
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_orig_func, __pyx_n_s_func); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 531, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF_SET(__pyx_v_orig_func, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":530
 *         except AttributeError:  # Python 2.6
 *             orig_func = obj.__get__(None, object)
 *             if isinstance(obj, classmethod):             # <<<<<<<<<<<<<<
 *                 orig_func = orig_func.__func__  # Unbind
 *         self.save_reduce(type(obj), (orig_func,), obj=obj)
 */
      }
      __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_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "cycloudpickle/cycloudpickle.pyx":526
 * 
 *     def save_classmethod(self, obj):
 *         try:             # <<<<<<<<<<<<<<
 *             orig_func = obj.__func__
 *         except AttributeError:  # Python 2.6
 */
    __Pyx_PyThreadState_assign
    __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_PyThreadState_assign
    __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_L10_try_end:;
  }

  /* "cycloudpickle/cycloudpickle.pyx":532
 *             if isinstance(obj, classmethod):
 *                 orig_func = orig_func.__func__  # Unbind
 *         self.save_reduce(type(obj), (orig_func,), obj=obj)             # <<<<<<<<<<<<<<
 *     dispatch[builtins.classmethod] = save_classmethod
 *     dispatch[builtins.staticmethod] = save_classmethod
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_orig_func);
  __Pyx_GIVEREF(__pyx_v_orig_func);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_orig_func);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_obj)));
  __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_obj)));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_obj)));
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 532, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":525
 *     dispatch[property] = save_property
 * 
 *     def save_classmethod(self, obj):             # <<<<<<<<<<<<<<
 *         try:
 *             orig_func = obj.__func__
 */

  /* 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_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_12);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_classmethod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_orig_func);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":536
 *     dispatch[builtins.staticmethod] = save_classmethod
 * 
 *     def save_itemgetter(self, obj):             # <<<<<<<<<<<<<<
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_33save_itemgetter(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_32save_itemgetter[] = "itemgetter serializer (needed for namedtuple support)";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_33save_itemgetter(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_itemgetter (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_32save_itemgetter(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

/* "cycloudpickle/cycloudpickle.pyx":539
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:
 *             def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *                 return item
 *         items = obj(Dummy())
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_itemgetter_5Dummy_1__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_itemgetter_5Dummy_1__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_itemgetter_5Dummy_1__getitem__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_itemgetter_5Dummy_1__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self_2,&__pyx_n_s_item,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 539, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 539, __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_item = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_itemgetter.Dummy.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_itemgetter_5Dummy___getitem__(__pyx_self, __pyx_v_self, __pyx_v_item);

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_itemgetter_5Dummy___getitem__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "cycloudpickle/cycloudpickle.pyx":540
 *         class Dummy:
 *             def __getitem__(self, item):
 *                 return item             # <<<<<<<<<<<<<<
 *         items = obj(Dummy())
 *         if not isinstance(items, tuple):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_item);
  __pyx_r = __pyx_v_item;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":539
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:
 *             def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *                 return item
 *         items = obj(Dummy())
 */

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

/* "cycloudpickle/cycloudpickle.pyx":536
 *     dispatch[builtins.staticmethod] = save_classmethod
 * 
 *     def save_itemgetter(self, obj):             # <<<<<<<<<<<<<<
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:
 */

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_32save_itemgetter(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_Dummy = NULL;
  PyObject *__pyx_v_items = 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;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("save_itemgetter", 0);

  /* "cycloudpickle/cycloudpickle.pyx":538
 *     def save_itemgetter(self, obj):
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:             # <<<<<<<<<<<<<<
 *             def __getitem__(self, item):
 *                 return item
 */
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Dummy, __pyx_n_s_save_itemgetter_locals_Dummy, (PyObject *) NULL, __pyx_n_s_cycloudpickle_cycloudpickle, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "cycloudpickle/cycloudpickle.pyx":539
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:
 *             def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *                 return item
 *         items = obj(Dummy())
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_itemgetter_5Dummy_1__getitem__, 0, __pyx_n_s_save_itemgetter_locals_Dummy___g, NULL, __pyx_n_s_cycloudpickle_cycloudpickle, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_getitem, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":538
 *     def save_itemgetter(self, obj):
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:             # <<<<<<<<<<<<<<
 *             def __getitem__(self, item):
 *                 return item
 */
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Dummy, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_Dummy = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":541
 *             def __getitem__(self, item):
 *                 return item
 *         items = obj(Dummy())             # <<<<<<<<<<<<<<
 *         if not isinstance(items, tuple):
 *             items = (items,)
 */
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_v_Dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_t_3 = __pyx_v_obj; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __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 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_items = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":542
 *                 return item
 *         items = obj(Dummy())
 *         if not isinstance(items, tuple):             # <<<<<<<<<<<<<<
 *             items = (items,)
 *         return self.save_reduce(operator.itemgetter, items)
 */
  __pyx_t_6 = PyTuple_Check(__pyx_v_items); 
  __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
  if (__pyx_t_7) {

    /* "cycloudpickle/cycloudpickle.pyx":543
 *         items = obj(Dummy())
 *         if not isinstance(items, tuple):
 *             items = (items,)             # <<<<<<<<<<<<<<
 *         return self.save_reduce(operator.itemgetter, items)
 * 
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_items);
    __Pyx_GIVEREF(__pyx_v_items);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_items);
    __Pyx_DECREF_SET(__pyx_v_items, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":542
 *                 return item
 *         items = obj(Dummy())
 *         if not isinstance(items, tuple):             # <<<<<<<<<<<<<<
 *             items = (items,)
 *         return self.save_reduce(operator.itemgetter, items)
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":544
 *         if not isinstance(items, tuple):
 *             items = (items,)
 *         return self.save_reduce(operator.itemgetter, items)             # <<<<<<<<<<<<<<
 * 
 *     if type(operator.itemgetter) is type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_8 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_items);
  __Pyx_GIVEREF(__pyx_v_items);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_v_items);
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __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;

  /* "cycloudpickle/cycloudpickle.pyx":536
 *     dispatch[builtins.staticmethod] = save_classmethod
 * 
 *     def save_itemgetter(self, obj):             # <<<<<<<<<<<<<<
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_itemgetter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Dummy);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":549
 *         dispatch[operator.itemgetter] = save_itemgetter
 * 
 *     def save_attrgetter(self, obj):             # <<<<<<<<<<<<<<
 *         """attrgetter serializer"""
 *         class Dummy(object):
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_35save_attrgetter(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_34save_attrgetter[] = "attrgetter serializer";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_35save_attrgetter(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_attrgetter (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_34save_attrgetter(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

/* "cycloudpickle/cycloudpickle.pyx":552
 *         """attrgetter serializer"""
 *         class Dummy(object):
 *             def __init__(self, attrs, index=None):             # <<<<<<<<<<<<<<
 *                 self.attrs = attrs
 *                 self.index = index
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_1__init__ = {"__init__", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_attrs = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self_2,&__pyx_n_s_attrs,&__pyx_n_s_index,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);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 552, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[2] = 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, 552, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_attrs = values[1];
    __pyx_v_index = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 552, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_attrgetter.Dummy.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy___init__(__pyx_self, __pyx_v_self, __pyx_v_attrs, __pyx_v_index);

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attrs, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "cycloudpickle/cycloudpickle.pyx":553
 *         class Dummy(object):
 *             def __init__(self, attrs, index=None):
 *                 self.attrs = attrs             # <<<<<<<<<<<<<<
 *                 self.index = index
 *             def __getattribute__(self, item):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_attrs, __pyx_v_attrs) < 0) __PYX_ERR(0, 553, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":554
 *             def __init__(self, attrs, index=None):
 *                 self.attrs = attrs
 *                 self.index = index             # <<<<<<<<<<<<<<
 *             def __getattribute__(self, item):
 *                 attrs = object.__getattribute__(self, "attrs")
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index, __pyx_v_index) < 0) __PYX_ERR(0, 554, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":552
 *         """attrgetter serializer"""
 *         class Dummy(object):
 *             def __init__(self, attrs, index=None):             # <<<<<<<<<<<<<<
 *                 self.attrs = attrs
 *                 self.index = index
 */

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

/* "cycloudpickle/cycloudpickle.pyx":555
 *                 self.attrs = attrs
 *                 self.index = index
 *             def __getattribute__(self, item):             # <<<<<<<<<<<<<<
 *                 attrs = object.__getattribute__(self, "attrs")
 *                 index = object.__getattribute__(self, "index")
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_3__getattribute__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_3__getattribute__ = {"__getattribute__", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_3__getattribute__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_3__getattribute__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattribute__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self_2,&__pyx_n_s_item,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);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattribute__", 1, 2, 2, 1); __PYX_ERR(0, 555, __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, 555, __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_item = 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, 555, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_attrgetter.Dummy.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_2__getattribute__(__pyx_self, __pyx_v_self, __pyx_v_item);

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_2__getattribute__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_attrs = NULL;
  PyObject *__pyx_v_index = 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;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__getattribute__", 0);

  /* "cycloudpickle/cycloudpickle.pyx":556
 *                 self.index = index
 *             def __getattribute__(self, item):
 *                 attrs = object.__getattribute__(self, "attrs")             # <<<<<<<<<<<<<<
 *                 index = object.__getattribute__(self, "index")
 *                 if index is None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __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_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_n_u_attrs);
  __Pyx_GIVEREF(__pyx_n_u_attrs);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_u_attrs);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __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_attrs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":557
 *             def __getattribute__(self, item):
 *                 attrs = object.__getattribute__(self, "attrs")
 *                 index = object.__getattribute__(self, "index")             # <<<<<<<<<<<<<<
 *                 if index is None:
 *                     index = len(attrs)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_4 = 1;
    }
  }
  __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __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_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_n_u_index);
  __Pyx_GIVEREF(__pyx_n_u_index);
  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_n_u_index);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_index = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":558
 *                 attrs = object.__getattribute__(self, "attrs")
 *                 index = object.__getattribute__(self, "index")
 *                 if index is None:             # <<<<<<<<<<<<<<
 *                     index = len(attrs)
 *                     attrs.append(item)
 */
  __pyx_t_6 = (__pyx_v_index == Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "cycloudpickle/cycloudpickle.pyx":559
 *                 index = object.__getattribute__(self, "index")
 *                 if index is None:
 *                     index = len(attrs)             # <<<<<<<<<<<<<<
 *                     attrs.append(item)
 *                 else:
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_attrs); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 559, __pyx_L1_error)
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":560
 *                 if index is None:
 *                     index = len(attrs)
 *                     attrs.append(item)             # <<<<<<<<<<<<<<
 *                 else:
 *                     attrs[index] = ".".join([attrs[index], item])
 */
    __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_attrs, __pyx_v_item); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 560, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":558
 *                 attrs = object.__getattribute__(self, "attrs")
 *                 index = object.__getattribute__(self, "index")
 *                 if index is None:             # <<<<<<<<<<<<<<
 *                     index = len(attrs)
 *                     attrs.append(item)
 */
    goto __pyx_L3;
  }

  /* "cycloudpickle/cycloudpickle.pyx":562
 *                     attrs.append(item)
 *                 else:
 *                     attrs[index] = ".".join([attrs[index], item])             # <<<<<<<<<<<<<<
 *                 return type(self)(attrs, index)
 *         attrs = []
 */
  /*else*/ {
    __pyx_t_1 = PyObject_GetItem(__pyx_v_attrs, __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_item);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__10, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(PyObject_SetItem(__pyx_v_attrs, __pyx_v_index, __pyx_t_1) < 0)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "cycloudpickle/cycloudpickle.pyx":563
 *                 else:
 *                     attrs[index] = ".".join([attrs[index], item])
 *                 return type(self)(attrs, index)             # <<<<<<<<<<<<<<
 *         attrs = []
 *         obj(Dummy(attrs))
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_self)));
  __pyx_t_2 = ((PyObject *)Py_TYPE(__pyx_v_self)); __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __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_attrs);
  __Pyx_GIVEREF(__pyx_v_attrs);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_attrs);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_index);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":555
 *                 self.attrs = attrs
 *                 self.index = index
 *             def __getattribute__(self, item):             # <<<<<<<<<<<<<<
 *                 attrs = object.__getattribute__(self, "attrs")
 *                 index = object.__getattribute__(self, "index")
 */

  /* 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("cycloudpickle.cycloudpickle.CloudPickler.save_attrgetter.Dummy.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attrs);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":549
 *         dispatch[operator.itemgetter] = save_itemgetter
 * 
 *     def save_attrgetter(self, obj):             # <<<<<<<<<<<<<<
 *         """attrgetter serializer"""
 *         class Dummy(object):
 */

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_34save_attrgetter(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_Dummy = NULL;
  PyObject *__pyx_v_attrs = 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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("save_attrgetter", 0);

  /* "cycloudpickle/cycloudpickle.pyx":551
 *     def save_attrgetter(self, obj):
 *         """attrgetter serializer"""
 *         class Dummy(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, attrs, index=None):
 *                 self.attrs = attrs
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Dummy, __pyx_n_s_save_attrgetter_locals_Dummy, (PyObject *) NULL, __pyx_n_s_cycloudpickle_cycloudpickle, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "cycloudpickle/cycloudpickle.pyx":552
 *         """attrgetter serializer"""
 *         class Dummy(object):
 *             def __init__(self, attrs, index=None):             # <<<<<<<<<<<<<<
 *                 self.attrs = attrs
 *                 self.index = index
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_1__init__, 0, __pyx_n_s_save_attrgetter_locals_Dummy___i, NULL, __pyx_n_s_cycloudpickle_cycloudpickle, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__13);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":555
 *                 self.attrs = attrs
 *                 self.index = index
 *             def __getattribute__(self, item):             # <<<<<<<<<<<<<<
 *                 attrs = object.__getattribute__(self, "attrs")
 *                 index = object.__getattribute__(self, "index")
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_attrgetter_5Dummy_3__getattribute__, 0, __pyx_n_s_save_attrgetter_locals_Dummy___g, NULL, __pyx_n_s_cycloudpickle_cycloudpickle, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getattribute, __pyx_t_4) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":551
 *     def save_attrgetter(self, obj):
 *         """attrgetter serializer"""
 *         class Dummy(object):             # <<<<<<<<<<<<<<
 *             def __init__(self, attrs, index=None):
 *                 self.attrs = attrs
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Dummy, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_Dummy = __pyx_t_4;
  __pyx_t_4 = 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;

  /* "cycloudpickle/cycloudpickle.pyx":564
 *                     attrs[index] = ".".join([attrs[index], item])
 *                 return type(self)(attrs, index)
 *         attrs = []             # <<<<<<<<<<<<<<
 *         obj(Dummy(attrs))
 *         return self.save_reduce(operator.attrgetter, tuple(attrs))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_attrs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":565
 *                 return type(self)(attrs, index)
 *         attrs = []
 *         obj(Dummy(attrs))             # <<<<<<<<<<<<<<
 *         return self.save_reduce(operator.attrgetter, tuple(attrs))
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_attrs);
  __Pyx_GIVEREF(__pyx_v_attrs);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_attrs);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_Dummy, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_t_2 = __pyx_v_obj; __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __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 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __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;

  /* "cycloudpickle/cycloudpickle.pyx":566
 *         attrs = []
 *         obj(Dummy(attrs))
 *         return self.save_reduce(operator.attrgetter, tuple(attrs))             # <<<<<<<<<<<<<<
 * 
 *     if type(operator.attrgetter) is type:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyList_AsTuple(__pyx_v_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":549
 *         dispatch[operator.itemgetter] = save_itemgetter
 * 
 *     def save_attrgetter(self, obj):             # <<<<<<<<<<<<<<
 *         """attrgetter serializer"""
 *         class Dummy(object):
 */

  /* 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_7);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_attrgetter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Dummy);
  __Pyx_XDECREF(__pyx_v_attrs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":571
 *         dispatch[operator.attrgetter] = save_attrgetter
 * 
 *     def save_reduce(self, func, args, state=None,             # <<<<<<<<<<<<<<
 *                     listitems=None, dictitems=None, obj=None):
 *         """Modified to support __transient__ on new objects
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_37save_reduce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_36save_reduce[] = "Modified to support __transient__ on new objects\n        Change only affects protocol level 2 (which is always used by PiCloud";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_37save_reduce(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v_listitems = 0;
  PyObject *__pyx_v_dictitems = 0;
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_reduce (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func_2,&__pyx_n_s_args,&__pyx_n_s_state,&__pyx_n_s_listitems,&__pyx_n_s_dictitems,&__pyx_n_s_obj,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[2] = ((PyObject *)Py_None);

    /* "cycloudpickle/cycloudpickle.pyx":572
 * 
 *     def save_reduce(self, func, args, state=None,
 *                     listitems=None, dictitems=None, obj=None):             # <<<<<<<<<<<<<<
 *         """Modified to support __transient__ on new objects
 *         Change only affects protocol level 2 (which is always used by PiCloud"""
 */
    values[3] = ((PyObject *)Py_None);
    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);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func_2)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("save_reduce", 0, 2, 6, 1); __PYX_ERR(0, 571, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_listitems);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dictitems);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "save_reduce") < 0)) __PYX_ERR(0, 571, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_func = values[0];
    __pyx_v_args = values[1];
    __pyx_v_state = values[2];
    __pyx_v_listitems = values[3];
    __pyx_v_dictitems = values[4];
    __pyx_v_obj = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("save_reduce", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 571, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_reduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_36save_reduce(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), __pyx_v_func, __pyx_v_args, __pyx_v_state, __pyx_v_listitems, __pyx_v_dictitems, __pyx_v_obj);

  /* "cycloudpickle/cycloudpickle.pyx":571
 *         dispatch[operator.attrgetter] = save_attrgetter
 * 
 *     def save_reduce(self, func, args, state=None,             # <<<<<<<<<<<<<<
 *                     listitems=None, dictitems=None, obj=None):
 *         """Modified to support __transient__ on new objects
 */

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_36save_reduce(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_state, PyObject *__pyx_v_listitems, PyObject *__pyx_v_dictitems, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_save = NULL;
  PyObject *__pyx_v_write = NULL;
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_v_transient = NULL;
  PyObject *__pyx_v_k = 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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("save_reduce", 0);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_state);

  /* "cycloudpickle/cycloudpickle.pyx":576
 *         Change only affects protocol level 2 (which is always used by PiCloud"""
 *         # Assert that args is a tuple or None
 *         if not isinstance(args, tuple):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("args from reduce() should be a tuple")
 * 
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_args); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":577
 *         # Assert that args is a tuple or None
 *         if not isinstance(args, tuple):
 *             raise pickle.PicklingError("args from reduce() should be a tuple")             # <<<<<<<<<<<<<<
 * 
 *         # Assert that func is callable
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __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, 577, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":576
 *         Change only affects protocol level 2 (which is always used by PiCloud"""
 *         # Assert that args is a tuple or None
 *         if not isinstance(args, tuple):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("args from reduce() should be a tuple")
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":580
 * 
 *         # Assert that func is callable
 *         if not hasattr(func, '__call__'):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("func from reduce should be callable")
 * 
 */
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_func, __pyx_n_u_call); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 580, __pyx_L1_error)
  __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cycloudpickle.pyx":581
 *         # Assert that func is callable
 *         if not hasattr(func, '__call__'):
 *             raise pickle.PicklingError("func from reduce should be callable")             # <<<<<<<<<<<<<<
 * 
 *         save = self.save
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __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, 581, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":580
 * 
 *         # Assert that func is callable
 *         if not hasattr(func, '__call__'):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("func from reduce should be callable")
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":583
 *             raise pickle.PicklingError("func from reduce should be callable")
 * 
 *         save = self.save             # <<<<<<<<<<<<<<
 *         write = self.write
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_save = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":584
 * 
 *         save = self.save
 *         write = self.write             # <<<<<<<<<<<<<<
 * 
 *         # Protocol 2 special case: if func's name is __newobj__, use NEWOBJ
 */
  __pyx_t_3 = __pyx_v_self->__pyx_base.write;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_write = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":587
 * 
 *         # Protocol 2 special case: if func's name is __newobj__, use NEWOBJ
 *         if self.proto >= 2 and getattr(func, "__name__", "") == "__newobj__":             # <<<<<<<<<<<<<<
 *             # Added fix to allow transient
 *             cls = args[0]
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.proto >= 2) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_u_name, __pyx_kp_u_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_newobj, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cycloudpickle/cycloudpickle.pyx":589
 *         if self.proto >= 2 and getattr(func, "__name__", "") == "__newobj__":
 *             # Added fix to allow transient
 *             cls = args[0]             # <<<<<<<<<<<<<<
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError(
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_cls = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":590
 *             # Added fix to allow transient
 *             cls = args[0]
 *             if not hasattr(cls, "__new__"):             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has no __new__")
 */
    __pyx_t_1 = PyObject_HasAttr(__pyx_v_cls, __pyx_n_u_new); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 590, __pyx_L1_error)
    __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
    if (__pyx_t_2) {

      /* "cycloudpickle/cycloudpickle.pyx":591
 *             cls = args[0]
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __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, 591, __pyx_L1_error)

      /* "cycloudpickle/cycloudpickle.pyx":590
 *             # Added fix to allow transient
 *             cls = args[0]
 *             if not hasattr(cls, "__new__"):             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has no __new__")
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":593
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has the wrong class")
 */
    __pyx_t_1 = (__pyx_v_obj != Py_None);
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = (__pyx_v_cls != __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_5 != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_2) {

      /* "cycloudpickle/cycloudpickle.pyx":594
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __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, 594, __pyx_L1_error)

      /* "cycloudpickle/cycloudpickle.pyx":593
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:             # <<<<<<<<<<<<<<
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has the wrong class")
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":596
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]             # <<<<<<<<<<<<<<
 *             save(cls)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_args, 1, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":597
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]
 *             save(cls)             # <<<<<<<<<<<<<<
 * 
 *             # Don't pickle transient entries
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_4 = __pyx_v_save; __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_cls); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_cls);
      __Pyx_GIVEREF(__pyx_v_cls);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_cls);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __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;

    /* "cycloudpickle/cycloudpickle.pyx":600
 * 
 *             # Don't pickle transient entries
 *             if hasattr(obj, '__transient__'):             # <<<<<<<<<<<<<<
 *                 transient = obj.__transient__
 *                 state = state.copy()
 */
    __pyx_t_2 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_u_transient); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 600, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cycloudpickle/cycloudpickle.pyx":601
 *             # Don't pickle transient entries
 *             if hasattr(obj, '__transient__'):
 *                 transient = obj.__transient__             # <<<<<<<<<<<<<<
 *                 state = state.copy()
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_transient); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_transient = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":602
 *             if hasattr(obj, '__transient__'):
 *                 transient = obj.__transient__
 *                 state = state.copy()             # <<<<<<<<<<<<<<
 * 
 *                 for k in list(state.keys()):
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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);
        }
      }
      if (__pyx_t_7) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":604
 *                 state = state.copy()
 * 
 *                 for k in list(state.keys()):             # <<<<<<<<<<<<<<
 *                     if k in transient:
 *                         del state[k]
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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);
        }
      }
      if (__pyx_t_7) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      for (;;) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":605
 * 
 *                 for k in list(state.keys()):
 *                     if k in transient:             # <<<<<<<<<<<<<<
 *                         del state[k]
 * 
 */
        __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_transient, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 605, __pyx_L1_error)
        __pyx_t_2 = (__pyx_t_1 != 0);
        if (__pyx_t_2) {

          /* "cycloudpickle/cycloudpickle.pyx":606
 *                 for k in list(state.keys()):
 *                     if k in transient:
 *                         del state[k]             # <<<<<<<<<<<<<<
 * 
 *             save(args)
 */
          if (unlikely(PyObject_DelItem(__pyx_v_state, __pyx_v_k) < 0)) __PYX_ERR(0, 606, __pyx_L1_error)

          /* "cycloudpickle/cycloudpickle.pyx":605
 * 
 *                 for k in list(state.keys()):
 *                     if k in transient:             # <<<<<<<<<<<<<<
 *                         del state[k]
 * 
 */
        }

        /* "cycloudpickle/cycloudpickle.pyx":604
 *                 state = state.copy()
 * 
 *                 for k in list(state.keys()):             # <<<<<<<<<<<<<<
 *                     if k in transient:
 *                         del state[k]
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":600
 * 
 *             # Don't pickle transient entries
 *             if hasattr(obj, '__transient__'):             # <<<<<<<<<<<<<<
 *                 transient = obj.__transient__
 *                 state = state.copy()
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":608
 *                         del state[k]
 * 
 *             save(args)             # <<<<<<<<<<<<<<
 *             write(pickle.NEWOBJ)
 *         else:
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_4 = __pyx_v_save; __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_args);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":609
 * 
 *             save(args)
 *             write(pickle.NEWOBJ)             # <<<<<<<<<<<<<<
 *         else:
 *             save(func)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NEWOBJ); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_4 = __pyx_v_write; __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":587
 * 
 *         # Protocol 2 special case: if func's name is __newobj__, use NEWOBJ
 *         if self.proto >= 2 and getattr(func, "__name__", "") == "__newobj__":             # <<<<<<<<<<<<<<
 *             # Added fix to allow transient
 *             cls = args[0]
 */
    goto __pyx_L5;
  }

  /* "cycloudpickle/cycloudpickle.pyx":611
 *             write(pickle.NEWOBJ)
 *         else:
 *             save(func)             # <<<<<<<<<<<<<<
 *             save(args)
 *             write(pickle.REDUCE)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_4 = __pyx_v_save; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_func);
      __Pyx_GIVEREF(__pyx_v_func);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_func);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); 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_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":612
 *         else:
 *             save(func)
 *             save(args)             # <<<<<<<<<<<<<<
 *             write(pickle.REDUCE)
 * 
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_4 = __pyx_v_save; __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_args);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":613
 *             save(func)
 *             save(args)
 *             write(pickle.REDUCE)             # <<<<<<<<<<<<<<
 * 
 *         if obj is not None:
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_REDUCE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_4 = __pyx_v_write; __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __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;
  }
  __pyx_L5:;

  /* "cycloudpickle/cycloudpickle.pyx":615
 *             write(pickle.REDUCE)
 * 
 *         if obj is not None:             # <<<<<<<<<<<<<<
 *             self.memoize(obj)
 * 
 */
  __pyx_t_2 = (__pyx_v_obj != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cycloudpickle.pyx":616
 * 
 *         if obj is not None:
 *             self.memoize(obj)             # <<<<<<<<<<<<<<
 * 
 *         # More new special cases (that work with older protocols as
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_obj);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":615
 *             write(pickle.REDUCE)
 * 
 *         if obj is not None:             # <<<<<<<<<<<<<<
 *             self.memoize(obj)
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":623
 *         # items and dict items (as (key, value) tuples), or None.
 * 
 *         if listitems is not None:             # <<<<<<<<<<<<<<
 *             self._batch_appends(listitems)
 * 
 */
  __pyx_t_1 = (__pyx_v_listitems != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":624
 * 
 *         if listitems is not None:
 *             self._batch_appends(listitems)             # <<<<<<<<<<<<<<
 * 
 *         if dictitems is not None:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_batch_appends); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_listitems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_listitems);
      __Pyx_GIVEREF(__pyx_v_listitems);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_listitems);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __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;

    /* "cycloudpickle/cycloudpickle.pyx":623
 *         # items and dict items (as (key, value) tuples), or None.
 * 
 *         if listitems is not None:             # <<<<<<<<<<<<<<
 *             self._batch_appends(listitems)
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":626
 *             self._batch_appends(listitems)
 * 
 *         if dictitems is not None:             # <<<<<<<<<<<<<<
 *             self._batch_setitems(dictitems)
 * 
 */
  __pyx_t_2 = (__pyx_v_dictitems != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cycloudpickle.pyx":627
 * 
 *         if dictitems is not None:
 *             self._batch_setitems(dictitems)             # <<<<<<<<<<<<<<
 * 
 *         if state is not None:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_batch_setitems); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_dictitems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_dictitems);
      __Pyx_GIVEREF(__pyx_v_dictitems);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_dictitems);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":626
 *             self._batch_appends(listitems)
 * 
 *         if dictitems is not None:             # <<<<<<<<<<<<<<
 *             self._batch_setitems(dictitems)
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":629
 *             self._batch_setitems(dictitems)
 * 
 *         if state is not None:             # <<<<<<<<<<<<<<
 *             save(state)
 *             write(pickle.BUILD)
 */
  __pyx_t_1 = (__pyx_v_state != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":630
 * 
 *         if state is not None:
 *             save(state)             # <<<<<<<<<<<<<<
 *             write(pickle.BUILD)
 * 
 */
    __Pyx_INCREF(__pyx_v_save);
    __pyx_t_4 = __pyx_v_save; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_INCREF(__pyx_v_state);
      __Pyx_GIVEREF(__pyx_v_state);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_state);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __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;

    /* "cycloudpickle/cycloudpickle.pyx":631
 *         if state is not None:
 *             save(state)
 *             write(pickle.BUILD)             # <<<<<<<<<<<<<<
 * 
 *     def save_partial(self, obj):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_BUILD); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_v_write);
    __pyx_t_4 = __pyx_v_write; __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_9) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":629
 *             self._batch_setitems(dictitems)
 * 
 *         if state is not None:             # <<<<<<<<<<<<<<
 *             save(state)
 *             write(pickle.BUILD)
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":571
 *         dispatch[operator.attrgetter] = save_attrgetter
 * 
 *     def save_reduce(self, func, args, state=None,             # <<<<<<<<<<<<<<
 *                     listitems=None, dictitems=None, obj=None):
 *         """Modified to support __transient__ on new objects
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_reduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_save);
  __Pyx_XDECREF(__pyx_v_write);
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XDECREF(__pyx_v_transient);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":633
 *             write(pickle.BUILD)
 * 
 *     def save_partial(self, obj):             # <<<<<<<<<<<<<<
 *         """Partial objects do not serialize correctly in python2.x -- this fixes the bugs"""
 *         self.save_reduce(_genpartial, (obj.func, obj.args, obj.keywords))
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_39save_partial(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_38save_partial[] = "Partial objects do not serialize correctly in python2.x -- this fixes the bugs";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_39save_partial(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_partial (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_38save_partial(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_38save_partial(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  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;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("save_partial", 0);

  /* "cycloudpickle/cycloudpickle.pyx":635
 *     def save_partial(self, obj):
 *         """Partial objects do not serialize correctly in python2.x -- this fixes the bugs"""
 *         self.save_reduce(_genpartial, (obj.func, obj.args, obj.keywords))             # <<<<<<<<<<<<<<
 * 
 *     if sys.version_info < (2,7):  # 2.7 supports partial pickling
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_genpartial); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_func_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_keywords); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_8 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_7);
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __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;

  /* "cycloudpickle/cycloudpickle.pyx":633
 *             write(pickle.BUILD)
 * 
 *     def save_partial(self, obj):             # <<<<<<<<<<<<<<
 *         """Partial objects do not serialize correctly in python2.x -- this fixes the bugs"""
 *         self.save_reduce(_genpartial, (obj.func, obj.args, obj.keywords))
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_partial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":641
 * 
 * 
 *     def save_file(self, obj):             # <<<<<<<<<<<<<<
 *         """Save a file"""
 *         if not hasattr(obj, 'name') or  not hasattr(obj, 'mode'):
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_41save_file(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_40save_file[] = "Save a file";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_41save_file(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_file (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_40save_file(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_40save_file(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_retval = NULL;
  PyObject *__pyx_v_StringIO = NULL;
  PyObject *__pyx_v_curloc = NULL;
  PyObject *__pyx_v_contents = 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;
  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;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("save_file", 0);

  /* "cycloudpickle/cycloudpickle.pyx":643
 *     def save_file(self, obj):
 *         """Save a file"""
 *         if not hasattr(obj, 'name') or  not hasattr(obj, 'mode'):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle files that do not map to an actual file")
 *         if obj is sys.stdout:
 */
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_u_name_2); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 643, __pyx_L1_error)
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_u_mode); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 643, __pyx_L1_error)
  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "cycloudpickle/cycloudpickle.pyx":644
 *         """Save a file"""
 *         if not hasattr(obj, 'name') or  not hasattr(obj, 'mode'):
 *             raise pickle.PicklingError("Cannot pickle files that do not map to an actual file")             # <<<<<<<<<<<<<<
 *         if obj is sys.stdout:
 *             return self.save_reduce(getattr, (sys, 'stdout'), obj=obj)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 644, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":643
 *     def save_file(self, obj):
 *         """Save a file"""
 *         if not hasattr(obj, 'name') or  not hasattr(obj, 'mode'):             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle files that do not map to an actual file")
 *         if obj is sys.stdout:
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":645
 *         if not hasattr(obj, 'name') or  not hasattr(obj, 'mode'):
 *             raise pickle.PicklingError("Cannot pickle files that do not map to an actual file")
 *         if obj is sys.stdout:             # <<<<<<<<<<<<<<
 *             return self.save_reduce(getattr, (sys, 'stdout'), obj=obj)
 *         if obj is sys.stderr:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdout); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__pyx_v_obj == __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":646
 *             raise pickle.PicklingError("Cannot pickle files that do not map to an actual file")
 *         if obj is sys.stdout:
 *             return self.save_reduce(getattr, (sys, 'stdout'), obj=obj)             # <<<<<<<<<<<<<<
 *         if obj is sys.stderr:
 *             return self.save_reduce(getattr, (sys, 'stderr'), obj=obj)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_n_u_stdout);
    __Pyx_GIVEREF(__pyx_n_u_stdout);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_u_stdout);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_4 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 646, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __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_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cycloudpickle/cycloudpickle.pyx":645
 *         if not hasattr(obj, 'name') or  not hasattr(obj, 'mode'):
 *             raise pickle.PicklingError("Cannot pickle files that do not map to an actual file")
 *         if obj is sys.stdout:             # <<<<<<<<<<<<<<
 *             return self.save_reduce(getattr, (sys, 'stdout'), obj=obj)
 *         if obj is sys.stderr:
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":647
 *         if obj is sys.stdout:
 *             return self.save_reduce(getattr, (sys, 'stdout'), obj=obj)
 *         if obj is sys.stderr:             # <<<<<<<<<<<<<<
 *             return self.save_reduce(getattr, (sys, 'stderr'), obj=obj)
 *         if obj is sys.stdin:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stderr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_v_obj == __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "cycloudpickle/cycloudpickle.pyx":648
 *             return self.save_reduce(getattr, (sys, 'stdout'), obj=obj)
 *         if obj is sys.stderr:
 *             return self.save_reduce(getattr, (sys, 'stderr'), obj=obj)             # <<<<<<<<<<<<<<
 *         if obj is sys.stdin:
 *             raise pickle.PicklingError("Cannot pickle standard input")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 648, __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_n_u_stderr);
    __Pyx_GIVEREF(__pyx_n_u_stderr);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_u_stderr);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_obj, __pyx_v_obj) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "cycloudpickle/cycloudpickle.pyx":647
 *         if obj is sys.stdout:
 *             return self.save_reduce(getattr, (sys, 'stdout'), obj=obj)
 *         if obj is sys.stderr:             # <<<<<<<<<<<<<<
 *             return self.save_reduce(getattr, (sys, 'stderr'), obj=obj)
 *         if obj is sys.stdin:
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":649
 *         if obj is sys.stderr:
 *             return self.save_reduce(getattr, (sys, 'stderr'), obj=obj)
 *         if obj is sys.stdin:             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle standard input")
 *         if obj.closed:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stdin_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__pyx_v_obj == __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":650
 *             return self.save_reduce(getattr, (sys, 'stderr'), obj=obj)
 *         if obj is sys.stdin:
 *             raise pickle.PicklingError("Cannot pickle standard input")             # <<<<<<<<<<<<<<
 *         if obj.closed:
 *             raise pickle.PicklingError("Cannot pickle closed files")
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 650, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":649
 *         if obj is sys.stderr:
 *             return self.save_reduce(getattr, (sys, 'stderr'), obj=obj)
 *         if obj is sys.stdin:             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle standard input")
 *         if obj.closed:
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":651
 *         if obj is sys.stdin:
 *             raise pickle.PicklingError("Cannot pickle standard input")
 *         if obj.closed:             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle closed files")
 *         if hasattr(obj, 'isatty') and obj.isatty():
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_closed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __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, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":652
 *             raise pickle.PicklingError("Cannot pickle standard input")
 *         if obj.closed:
 *             raise pickle.PicklingError("Cannot pickle closed files")             # <<<<<<<<<<<<<<
 *         if hasattr(obj, 'isatty') and obj.isatty():
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 652, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":651
 *         if obj is sys.stdin:
 *             raise pickle.PicklingError("Cannot pickle standard input")
 *         if obj.closed:             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle closed files")
 *         if hasattr(obj, 'isatty') and obj.isatty():
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":653
 *         if obj.closed:
 *             raise pickle.PicklingError("Cannot pickle closed files")
 *         if hasattr(obj, 'isatty') and obj.isatty():             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")
 *         if 'r' not in obj.mode and '+' not in obj.mode:
 */
  __pyx_t_1 = PyObject_HasAttr(__pyx_v_obj, __pyx_n_u_isatty); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 653, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_isatty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __pyx_t_3;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":654
 *             raise pickle.PicklingError("Cannot pickle closed files")
 *         if hasattr(obj, 'isatty') and obj.isatty():
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")             # <<<<<<<<<<<<<<
 *         if 'r' not in obj.mode and '+' not in obj.mode:
 *             raise pickle.PicklingError("Cannot pickle files that are not opened for reading: %s" % obj.mode)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 654, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":653
 *         if obj.closed:
 *             raise pickle.PicklingError("Cannot pickle closed files")
 *         if hasattr(obj, 'isatty') and obj.isatty():             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")
 *         if 'r' not in obj.mode and '+' not in obj.mode:
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":655
 *         if hasattr(obj, 'isatty') and obj.isatty():
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")
 *         if 'r' not in obj.mode and '+' not in obj.mode:             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle files that are not opened for reading: %s" % obj.mode)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_r, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__25, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_2) {

    /* "cycloudpickle/cycloudpickle.pyx":656
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")
 *         if 'r' not in obj.mode and '+' not in obj.mode:
 *             raise pickle.PicklingError("Cannot pickle files that are not opened for reading: %s" % obj.mode)             # <<<<<<<<<<<<<<
 * 
 *         name = obj.name
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_Cannot_pickle_files_that_are_not, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 656, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 656, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 656, __pyx_L1_error)

    /* "cycloudpickle/cycloudpickle.pyx":655
 *         if hasattr(obj, 'isatty') and obj.isatty():
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")
 *         if 'r' not in obj.mode and '+' not in obj.mode:             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle files that are not opened for reading: %s" % obj.mode)
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":658
 *             raise pickle.PicklingError("Cannot pickle files that are not opened for reading: %s" % obj.mode)
 * 
 *         name = obj.name             # <<<<<<<<<<<<<<
 * 
 *         if 'b' in obj.mode:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_name = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":660
 *         name = obj.name
 * 
 *         if 'b' in obj.mode:             # <<<<<<<<<<<<<<
 *             retval = io.BytesIO()
 *         else:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_b, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":661
 * 
 *         if 'b' in obj.mode:
 *             retval = io.BytesIO()             # <<<<<<<<<<<<<<
 *         else:
 *             try:
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_io); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_retval = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":660
 *         name = obj.name
 * 
 *         if 'b' in obj.mode:             # <<<<<<<<<<<<<<
 *             retval = io.BytesIO()
 *         else:
 */
    goto __pyx_L16;
  }

  /* "cycloudpickle/cycloudpickle.pyx":663
 *             retval = io.BytesIO()
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 import StringIO
 *                 retval = StringIO()
 */
  /*else*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "cycloudpickle/cycloudpickle.pyx":664
 *         else:
 *             try:
 *                 import StringIO             # <<<<<<<<<<<<<<
 *                 retval = StringIO()
 *             except ImportError:
 */
        __pyx_t_5 = __Pyx_Import(__pyx_n_s_StringIO, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_v_StringIO = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":665
 *             try:
 *                 import StringIO
 *                 retval = StringIO()             # <<<<<<<<<<<<<<
 *             except ImportError:
 *                 retval = io.StringIO()
 */
        __Pyx_INCREF(__pyx_v_StringIO);
        __pyx_t_8 = __pyx_v_StringIO; __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        if (__pyx_t_6) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L17_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L17_error)
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_retval = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":663
 *             retval = io.BytesIO()
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 import StringIO
 *                 retval = StringIO()
 */
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L24_try_end;
      __pyx_L17_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":666
 *                 import StringIO
 *                 retval = StringIO()
 *             except ImportError:             # <<<<<<<<<<<<<<
 *                 retval = io.StringIO()
 * 
 */
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
      if (__pyx_t_12) {
        __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 666, __pyx_L19_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);

        /* "cycloudpickle/cycloudpickle.pyx":667
 *                 retval = StringIO()
 *             except ImportError:
 *                 retval = io.StringIO()             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_io); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L19_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 667, __pyx_L19_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        if (__pyx_t_4) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L19_except_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        } else {
          __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 667, __pyx_L19_except_error)
        }
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF_SET(__pyx_v_retval, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L18_exception_handled;
      }
      goto __pyx_L19_except_error;
      __pyx_L19_except_error:;

      /* "cycloudpickle/cycloudpickle.pyx":663
 *             retval = io.BytesIO()
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 import StringIO
 *                 retval = StringIO()
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L18_exception_handled:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_L24_try_end:;
    }
  }
  __pyx_L16:;

  /* "cycloudpickle/cycloudpickle.pyx":669
 *                 retval = io.StringIO()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             # Read the whole file
 *             curloc = obj.tell()
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "cycloudpickle/cycloudpickle.pyx":671
 *         try:
 *             # Read the whole file
 *             curloc = obj.tell()             # <<<<<<<<<<<<<<
 *             obj.seek(0)
 *             contents = obj.read()
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_tell); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L27_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L27_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L27_error)
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_curloc = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":672
 *             # Read the whole file
 *             curloc = obj.tell()
 *             obj.seek(0)             # <<<<<<<<<<<<<<
 *             contents = obj.read()
 *             obj.seek(curloc)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L27_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 672, __pyx_L27_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":673
 *             curloc = obj.tell()
 *             obj.seek(0)
 *             contents = obj.read()             # <<<<<<<<<<<<<<
 *             obj.seek(curloc)
 *         except IOError:
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L27_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 673, __pyx_L27_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 673, __pyx_L27_error)
      }
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_contents = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":674
 *             obj.seek(0)
 *             contents = obj.read()
 *             obj.seek(curloc)             # <<<<<<<<<<<<<<
 *         except IOError:
 *             raise pickle.PicklingError("Cannot pickle file %s as it cannot be read" % name)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 674, __pyx_L27_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_curloc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 674, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_8);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_curloc);
        __Pyx_GIVEREF(__pyx_v_curloc);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_curloc);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 674, __pyx_L27_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":669
 *                 retval = io.StringIO()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             # Read the whole file
 *             curloc = obj.tell()
 */
    }
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L34_try_end;
    __pyx_L27_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":675
 *             contents = obj.read()
 *             obj.seek(curloc)
 *         except IOError:             # <<<<<<<<<<<<<<
 *             raise pickle.PicklingError("Cannot pickle file %s as it cannot be read" % name)
 *         retval.write(contents)
 */
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IOError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 675, __pyx_L29_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cycloudpickle/cycloudpickle.pyx":676
 *             obj.seek(curloc)
 *         except IOError:
 *             raise pickle.PicklingError("Cannot pickle file %s as it cannot be read" % name)             # <<<<<<<<<<<<<<
 *         retval.write(contents)
 *         retval.seek(curloc)
 */
      __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 676, __pyx_L29_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_PicklingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L29_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyUnicode_Format(__pyx_kp_u_Cannot_pickle_file_s_as_it_canno, __pyx_v_name); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 676, __pyx_L29_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_14) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L29_except_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 676, __pyx_L29_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __pyx_t_14 = NULL;
        __Pyx_GIVEREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_13);
        __pyx_t_13 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L29_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 676, __pyx_L29_except_error)
    }
    goto __pyx_L29_except_error;
    __pyx_L29_except_error:;

    /* "cycloudpickle/cycloudpickle.pyx":669
 *                 retval = io.StringIO()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             # Read the whole file
 *             curloc = obj.tell()
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L34_try_end:;
  }

  /* "cycloudpickle/cycloudpickle.pyx":677
 *         except IOError:
 *             raise pickle.PicklingError("Cannot pickle file %s as it cannot be read" % name)
 *         retval.write(contents)             # <<<<<<<<<<<<<<
 *         retval.seek(curloc)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_retval, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_contents); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_v_contents);
    __Pyx_GIVEREF(__pyx_v_contents);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_contents);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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;

  /* "cycloudpickle/cycloudpickle.pyx":678
 *             raise pickle.PicklingError("Cannot pickle file %s as it cannot be read" % name)
 *         retval.write(contents)
 *         retval.seek(curloc)             # <<<<<<<<<<<<<<
 * 
 *         retval.name = name
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_retval, __pyx_n_s_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_curloc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_curloc);
    __Pyx_GIVEREF(__pyx_v_curloc);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_curloc);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":680
 *         retval.seek(curloc)
 * 
 *         retval.name = name             # <<<<<<<<<<<<<<
 *         self.save(retval)
 *         self.memoize(obj)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_retval, __pyx_n_s_name_2, __pyx_v_name) < 0) __PYX_ERR(0, 680, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":681
 * 
 *         retval.name = name
 *         self.save(retval)             # <<<<<<<<<<<<<<
 *         self.memoize(obj)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_retval); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
    __Pyx_INCREF(__pyx_v_retval);
    __Pyx_GIVEREF(__pyx_v_retval);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_retval);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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;

  /* "cycloudpickle/cycloudpickle.pyx":682
 *         retval.name = name
 *         self.save(retval)
 *         self.memoize(obj)             # <<<<<<<<<<<<<<
 * 
 *     dispatch[io.BufferedRandom] = save_file
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memoize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_obj); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_obj);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":641
 * 
 * 
 *     def save_file(self, obj):             # <<<<<<<<<<<<<<
 *         """Save a file"""
 *         if not hasattr(obj, 'name') or  not hasattr(obj, 'mode'):
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.CloudPickler.save_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_retval);
  __Pyx_XDECREF(__pyx_v_StringIO);
  __Pyx_XDECREF(__pyx_v_curloc);
  __Pyx_XDECREF(__pyx_v_contents);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":689
 *         dispatch[file] = save_file
 * 
 *     def save_ellipsis(self, obj):             # <<<<<<<<<<<<<<
 *         self.save_reduce(_gen_ellipsis, ())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_43save_ellipsis(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_43save_ellipsis(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_ellipsis (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_42save_ellipsis(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_42save_ellipsis(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj) {
  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 = NULL;
  __Pyx_RefNannySetupContext("save_ellipsis", 0);

  /* "cycloudpickle/cycloudpickle.pyx":690
 * 
 *     def save_ellipsis(self, obj):
 *         self.save_reduce(_gen_ellipsis, ())             # <<<<<<<<<<<<<<
 * 
 *     def save_not_implemented(self, obj):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gen_ellipsis); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __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_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_empty_tuple);
  __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, 690, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":689
 *         dispatch[file] = save_file
 * 
 *     def save_ellipsis(self, obj):             # <<<<<<<<<<<<<<
 *         self.save_reduce(_gen_ellipsis, ())
 * 
 */

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

/* "cycloudpickle/cycloudpickle.pyx":692
 *         self.save_reduce(_gen_ellipsis, ())
 * 
 *     def save_not_implemented(self, obj):             # <<<<<<<<<<<<<<
 *         self.save_reduce(_gen_not_implemented, ())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_45save_not_implemented(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_45save_not_implemented(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_not_implemented (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_44save_not_implemented(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_44save_not_implemented(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_obj) {
  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 = NULL;
  __Pyx_RefNannySetupContext("save_not_implemented", 0);

  /* "cycloudpickle/cycloudpickle.pyx":693
 * 
 *     def save_not_implemented(self, obj):
 *         self.save_reduce(_gen_not_implemented, ())             # <<<<<<<<<<<<<<
 * 
 *     dispatch[type(Ellipsis)] = save_ellipsis
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_save_reduce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gen_not_implemented); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && 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_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __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_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_empty_tuple);
  __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, 693, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":692
 *         self.save_reduce(_gen_ellipsis, ())
 * 
 *     def save_not_implemented(self, obj):             # <<<<<<<<<<<<<<
 *         self.save_reduce(_gen_not_implemented, ())
 * 
 */

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

/* "cycloudpickle/cycloudpickle.pyx":699
 * 
 *     """Special functions for Add-on libraries"""
 *     def inject_addons(self):             # <<<<<<<<<<<<<<
 *         """Plug in system. Register additional pickling functions if modules already loaded"""
 *         pass
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_47inject_addons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_46inject_addons[] = "Plug in system. Register additional pickling functions if modules already loaded";
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_47inject_addons(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inject_addons (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_46inject_addons(((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_v_self));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12CloudPickler_46inject_addons(CYTHON_UNUSED struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inject_addons", 0);

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

/* "cycloudpickle/cycloudpickle.pyx":706
 * # Tornado support
 * 
 * def is_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *     """
 *     Return whether *func* is a Tornado coroutine function.
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_11is_tornado_coroutine(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/
static char __pyx_doc_13cycloudpickle_13cycloudpickle_10is_tornado_coroutine[] = "\n    Return whether *func* is a Tornado coroutine function.\n    Running coroutines are not supported.\n    ";
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_11is_tornado_coroutine = {"is_tornado_coroutine", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_11is_tornado_coroutine, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_10is_tornado_coroutine};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_11is_tornado_coroutine(PyObject *__pyx_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_tornado_coroutine (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_10is_tornado_coroutine(__pyx_self, ((PyObject *)__pyx_v_func));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_10is_tornado_coroutine(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_v_gen = 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("is_tornado_coroutine", 0);

  /* "cycloudpickle/cycloudpickle.pyx":711
 *     Running coroutines are not supported.
 *     """
 *     if 'tornado.gen' not in sys.modules:             # <<<<<<<<<<<<<<
 *         return False
 *     gen = sys.modules['tornado.gen']
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modules); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_tornado_gen, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cycloudpickle/cycloudpickle.pyx":712
 *     """
 *     if 'tornado.gen' not in sys.modules:
 *         return False             # <<<<<<<<<<<<<<
 *     gen = sys.modules['tornado.gen']
 *     if not hasattr(gen, "is_coroutine_function"):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cycloudpickle/cycloudpickle.pyx":711
 *     Running coroutines are not supported.
 *     """
 *     if 'tornado.gen' not in sys.modules:             # <<<<<<<<<<<<<<
 *         return False
 *     gen = sys.modules['tornado.gen']
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":713
 *     if 'tornado.gen' not in sys.modules:
 *         return False
 *     gen = sys.modules['tornado.gen']             # <<<<<<<<<<<<<<
 *     if not hasattr(gen, "is_coroutine_function"):
 *         # Tornado version is too old
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_modules); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_tornado_gen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_gen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":714
 *         return False
 *     gen = sys.modules['tornado.gen']
 *     if not hasattr(gen, "is_coroutine_function"):             # <<<<<<<<<<<<<<
 *         # Tornado version is too old
 *         return False
 */
  __pyx_t_4 = PyObject_HasAttr(__pyx_v_gen, __pyx_n_u_is_coroutine_function); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 714, __pyx_L1_error)
  __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":716
 *     if not hasattr(gen, "is_coroutine_function"):
 *         # Tornado version is too old
 *         return False             # <<<<<<<<<<<<<<
 *     return gen.is_coroutine_function(func)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "cycloudpickle/cycloudpickle.pyx":714
 *         return False
 *     gen = sys.modules['tornado.gen']
 *     if not hasattr(gen, "is_coroutine_function"):             # <<<<<<<<<<<<<<
 *         # Tornado version is too old
 *         return False
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":717
 *         # Tornado version is too old
 *         return False
 *     return gen.is_coroutine_function(func)             # <<<<<<<<<<<<<<
 * 
 * def _rebuild_tornado_coroutine(func):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gen, __pyx_n_s_is_coroutine_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __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 = NULL;
    __Pyx_INCREF(__pyx_v_func);
    __Pyx_GIVEREF(__pyx_v_func);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_func);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":706
 * # Tornado support
 * 
 * def is_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *     """
 *     Return whether *func* is a Tornado coroutine function.
 */

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

/* "cycloudpickle/cycloudpickle.pyx":719
 *     return gen.is_coroutine_function(func)
 * 
 * def _rebuild_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *     from tornado import gen
 *     return gen.coroutine(func)
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_13_rebuild_tornado_coroutine(PyObject *__pyx_self, PyObject *__pyx_v_func); /*proto*/
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_13_rebuild_tornado_coroutine = {"_rebuild_tornado_coroutine", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_13_rebuild_tornado_coroutine, METH_O, 0};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_13_rebuild_tornado_coroutine(PyObject *__pyx_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_rebuild_tornado_coroutine (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_12_rebuild_tornado_coroutine(__pyx_self, ((PyObject *)__pyx_v_func));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_12_rebuild_tornado_coroutine(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func) {
  PyObject *__pyx_v_gen = 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("_rebuild_tornado_coroutine", 0);

  /* "cycloudpickle/cycloudpickle.pyx":720
 * 
 * def _rebuild_tornado_coroutine(func):
 *     from tornado import gen             # <<<<<<<<<<<<<<
 *     return gen.coroutine(func)
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_gen);
  __Pyx_GIVEREF(__pyx_n_s_gen);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gen);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_tornado, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __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_gen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_gen = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":721
 * def _rebuild_tornado_coroutine(func):
 *     from tornado import gen
 *     return gen.coroutine(func)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_gen, __pyx_n_s_coroutine); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_func);
    __Pyx_GIVEREF(__pyx_v_func);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_func);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":719
 *     return gen.is_coroutine_function(func)
 * 
 * def _rebuild_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *     from tornado import gen
 *     return gen.coroutine(func)
 */

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

/* "cycloudpickle/cycloudpickle.pyx":726
 * # Shorthands for legacy support
 * 
 * cpdef dump(obj, file, protocol=2):             # <<<<<<<<<<<<<<
 *     CloudPickler(file, protocol).dump(obj)
 * 
 */

static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_15dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_13cycloudpickle_13cycloudpickle_dump(PyObject *__pyx_v_obj, PyObject *__pyx_v_file, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dump *__pyx_optional_args) {
  PyObject *__pyx_v_protocol = ((PyObject *)__pyx_int_2);
  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("dump", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_protocol = __pyx_optional_args->protocol;
    }
  }

  /* "cycloudpickle/cycloudpickle.pyx":727
 * 
 * cpdef dump(obj, file, protocol=2):
 *     CloudPickler(file, protocol).dump(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_file);
  __Pyx_INCREF(__pyx_v_protocol);
  __Pyx_GIVEREF(__pyx_v_protocol);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_protocol);
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":726
 * # Shorthands for legacy support
 * 
 * cpdef dump(obj, file, protocol=2):             # <<<<<<<<<<<<<<
 *     CloudPickler(file, protocol).dump(obj)
 * 
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_15dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_15dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_v_protocol = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dump (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_file,&__pyx_n_s_protocol,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_int_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  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dump", 0, 2, 3, 1); __PYX_ERR(0, 726, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_protocol);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dump") < 0)) __PYX_ERR(0, 726, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_obj = values[0];
    __pyx_v_file = values[1];
    __pyx_v_protocol = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dump", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 726, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_14dump(__pyx_self, __pyx_v_obj, __pyx_v_file, __pyx_v_protocol);

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_14dump(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_file, PyObject *__pyx_v_protocol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dump __pyx_t_2;
  __Pyx_RefNannySetupContext("dump", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.protocol = __pyx_v_protocol;
  __pyx_t_1 = __pyx_f_13cycloudpickle_13cycloudpickle_dump(__pyx_v_obj, __pyx_v_file, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cycloudpickle/cycloudpickle.pyx":730
 * 
 * 
 * cpdef dumps(obj, protocol=2):             # <<<<<<<<<<<<<<
 *     file = StringIO()
 * 
 */

static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_17dumps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_13cycloudpickle_13cycloudpickle_dumps(PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dumps *__pyx_optional_args) {
  PyObject *__pyx_v_protocol = ((PyObject *)__pyx_int_2);
  PyObject *__pyx_v_file = NULL;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *__pyx_v_cp = 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("dumps", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_protocol = __pyx_optional_args->protocol;
    }
  }

  /* "cycloudpickle/cycloudpickle.pyx":731
 * 
 * cpdef dumps(obj, protocol=2):
 *     file = StringIO()             # <<<<<<<<<<<<<<
 * 
 *     cp = CloudPickler(file, protocol)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_StringIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_file = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":733
 *     file = StringIO()
 * 
 *     cp = CloudPickler(file, protocol)             # <<<<<<<<<<<<<<
 *     cp.dump(obj)
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file);
  __Pyx_INCREF(__pyx_v_protocol);
  __Pyx_GIVEREF(__pyx_v_protocol);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_protocol);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cp = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":734
 * 
 *     cp = CloudPickler(file, protocol)
 *     cp.dump(obj)             # <<<<<<<<<<<<<<
 * 
 *     return file.getvalue()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cp), __pyx_n_s_dump); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_obj);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":736
 *     cp.dump(obj)
 * 
 *     return file.getvalue()             # <<<<<<<<<<<<<<
 * 
 * # including pickles unloading functions in this namespace
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_file, __pyx_n_s_getvalue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __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;

  /* "cycloudpickle/cycloudpickle.pyx":730
 * 
 * 
 * cpdef dumps(obj, protocol=2):             # <<<<<<<<<<<<<<
 *     file = StringIO()
 * 
 */

  /* 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("cycloudpickle.cycloudpickle.dumps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF((PyObject *)__pyx_v_cp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_17dumps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_17dumps(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_v_protocol = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dumps (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_protocol,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_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  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_protocol);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dumps") < 0)) __PYX_ERR(0, 730, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_protocol = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dumps", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 730, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle.dumps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_16dumps(__pyx_self, __pyx_v_obj, __pyx_v_protocol);

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_16dumps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_protocol) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_13cycloudpickle_13cycloudpickle_dumps __pyx_t_2;
  __Pyx_RefNannySetupContext("dumps", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.protocol = __pyx_v_protocol;
  __pyx_t_1 = __pyx_f_13cycloudpickle_13cycloudpickle_dumps(__pyx_v_obj, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

/* "cycloudpickle/cycloudpickle.pyx":744
 * 
 * # hack for __import__ not working as desired
 * cdef _find_module(mod_name):             # <<<<<<<<<<<<<<
 *     """
 *     Iterate over each part instead of calling imp.find_module directly.
 */

static PyObject *__pyx_f_13cycloudpickle_13cycloudpickle__find_module(PyObject *__pyx_v_mod_name) {
  PyObject *__pyx_v_path = NULL;
  PyObject *__pyx_v_part = NULL;
  PyObject *__pyx_v_file = NULL;
  PyObject *__pyx_v_description = 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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  __Pyx_RefNannySetupContext("_find_module", 0);

  /* "cycloudpickle/cycloudpickle.pyx":749
 *     This function is able to find submodules (e.g. sickit.tree)
 *     """
 *     path = None             # <<<<<<<<<<<<<<
 *     for part in mod_name.split('.'):
 *         if path is not None:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_path = Py_None;

  /* "cycloudpickle/cycloudpickle.pyx":750
 *     """
 *     path = None
 *     for part in mod_name.split('.'):             # <<<<<<<<<<<<<<
 *         if path is not None:
 *             path = [path]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mod_name, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 750, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 750, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 750, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":751
 *     path = None
 *     for part in mod_name.split('.'):
 *         if path is not None:             # <<<<<<<<<<<<<<
 *             path = [path]
 *         file, path, description = imp.find_module(part, path)
 */
    __pyx_t_5 = (__pyx_v_path != Py_None);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "cycloudpickle/cycloudpickle.pyx":752
 *     for part in mod_name.split('.'):
 *         if path is not None:
 *             path = [path]             # <<<<<<<<<<<<<<
 *         file, path, description = imp.find_module(part, path)
 *     return file, path, description
 */
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
      __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":751
 *     path = None
 *     for part in mod_name.split('.'):
 *         if path is not None:             # <<<<<<<<<<<<<<
 *             path = [path]
 *         file, path, description = imp.find_module(part, path)
 */
    }

    /* "cycloudpickle/cycloudpickle.pyx":753
 *         if path is not None:
 *             path = [path]
 *         file, path, description = imp.find_module(part, path)             # <<<<<<<<<<<<<<
 *     return file, path, description
 * 
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_imp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_find_module); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_9 = 1;
      }
    }
    __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_part);
    __Pyx_GIVEREF(__pyx_v_part);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_part);
    __Pyx_INCREF(__pyx_v_path);
    __Pyx_GIVEREF(__pyx_v_path);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_path);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 753, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
      index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      index = 2; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 753, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_file, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_description, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":750
 *     """
 *     path = None
 *     for part in mod_name.split('.'):             # <<<<<<<<<<<<<<
 *         if path is not None:
 *             path = [path]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":754
 *             path = [path]
 *         file, path, description = imp.find_module(part, path)
 *     return file, path, description             # <<<<<<<<<<<<<<
 * 
 * """Constructors for 3rd party libraries
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_file)) { __Pyx_RaiseUnboundLocalError("file"); __PYX_ERR(0, 754, __pyx_L1_error) }
  if (unlikely(!__pyx_v_description)) { __Pyx_RaiseUnboundLocalError("description"); __PYX_ERR(0, 754, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_file);
  __Pyx_GIVEREF(__pyx_v_file);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file);
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path);
  __Pyx_INCREF(__pyx_v_description);
  __Pyx_GIVEREF(__pyx_v_description);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_description);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":744
 * 
 * # hack for __import__ not working as desired
 * cdef _find_module(mod_name):             # <<<<<<<<<<<<<<
 *     """
 *     Iterate over each part instead of calling imp.find_module directly.
 */

  /* 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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("cycloudpickle.cycloudpickle._find_module", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_XDECREF(__pyx_v_part);
  __Pyx_XDECREF(__pyx_v_file);
  __Pyx_XDECREF(__pyx_v_description);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cycloudpickle/cycloudpickle.pyx":764
 *     method_descriptor = type(str.upper)
 * 
 *     def _reduce_method_descriptor(obj):             # <<<<<<<<<<<<<<
 *         return (getattr, (obj.__objclass__, obj.__name__))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_19_reduce_method_descriptor(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static PyMethodDef __pyx_mdef_13cycloudpickle_13cycloudpickle_19_reduce_method_descriptor = {"_reduce_method_descriptor", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_19_reduce_method_descriptor, METH_O, 0};
static PyObject *__pyx_pw_13cycloudpickle_13cycloudpickle_19_reduce_method_descriptor(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reduce_method_descriptor (wrapper)", 0);
  __pyx_r = __pyx_pf_13cycloudpickle_13cycloudpickle_18_reduce_method_descriptor(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_13cycloudpickle_13cycloudpickle_18_reduce_method_descriptor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  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("_reduce_method_descriptor", 0);

  /* "cycloudpickle/cycloudpickle.pyx":765
 * 
 *     def _reduce_method_descriptor(obj):
 *         return (getattr, (obj.__objclass__, obj.__name__))             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetBuiltinName(__pyx_n_s_getattr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_objclass); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cycloudpickle/cycloudpickle.pyx":764
 *     method_descriptor = type(str.upper)
 * 
 *     def _reduce_method_descriptor(obj):             # <<<<<<<<<<<<<<
 *         return (getattr, (obj.__objclass__, obj.__name__))
 * 
 */

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

static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle_CloudPickler(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *p;
  PyObject *o = __pyx_ptype_13cycloudpickle_8cypickle_Pickler->tp_new(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)o);
  p->modules = Py_None; Py_INCREF(Py_None);
  p->globals_ref = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_13cycloudpickle_13cycloudpickle_CloudPickler(PyObject *o) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->modules);
  Py_CLEAR(p->globals_ref);
  PyObject_GC_Track(o);
  if (likely(__pyx_ptype_13cycloudpickle_8cypickle_Pickler)) __pyx_ptype_13cycloudpickle_8cypickle_Pickler->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_13cycloudpickle_13cycloudpickle_CloudPickler);
}

static int __pyx_tp_traverse_13cycloudpickle_13cycloudpickle_CloudPickler(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)o;
  e = ((likely(__pyx_ptype_13cycloudpickle_8cypickle_Pickler)) ? ((__pyx_ptype_13cycloudpickle_8cypickle_Pickler->tp_traverse) ? __pyx_ptype_13cycloudpickle_8cypickle_Pickler->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_13cycloudpickle_13cycloudpickle_CloudPickler)); if (e) return e;
  if (p->modules) {
    e = (*v)(p->modules, a); if (e) return e;
  }
  if (p->globals_ref) {
    e = (*v)(p->globals_ref, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_13cycloudpickle_13cycloudpickle_CloudPickler(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler *)o;
  if (likely(__pyx_ptype_13cycloudpickle_8cypickle_Pickler)) { if (__pyx_ptype_13cycloudpickle_8cypickle_Pickler->tp_clear) __pyx_ptype_13cycloudpickle_8cypickle_Pickler->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_13cycloudpickle_13cycloudpickle_CloudPickler);
  tmp = ((PyObject*)p->modules);
  p->modules = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->globals_ref);
  p->globals_ref = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_13cycloudpickle_13cycloudpickle_CloudPickler[] = {
  {"dump", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_3dump, METH_O, 0},
  {"save_memoryview", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_5save_memoryview, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_4save_memoryview},
  {"save_buffer", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_7save_buffer, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_6save_buffer},
  {"save_unsupported", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_9save_unsupported, METH_O, 0},
  {"save_module", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_11save_module, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_10save_module},
  {"save_codeobject", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_13save_codeobject, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_12save_codeobject},
  {"save_function", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_15save_function, METH_VARARGS|METH_KEYWORDS, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_14save_function},
  {"save_function_tuple", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_17save_function_tuple, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_16save_function_tuple},
  {"extract_func_data", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_19extract_func_data, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_18extract_func_data},
  {"save_builtin_function", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_21save_builtin_function, METH_O, 0},
  {"save_global", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_23save_global, METH_VARARGS|METH_KEYWORDS, 0},
  {"save_instancemethod", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_25save_instancemethod, METH_O, 0},
  {"save_inst", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_27save_inst, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_26save_inst},
  {"save_property", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_29save_property, METH_O, 0},
  {"save_classmethod", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_31save_classmethod, METH_O, 0},
  {"save_itemgetter", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_33save_itemgetter, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_32save_itemgetter},
  {"save_attrgetter", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_35save_attrgetter, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_34save_attrgetter},
  {"save_reduce", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_37save_reduce, METH_VARARGS|METH_KEYWORDS, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_36save_reduce},
  {"save_partial", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_39save_partial, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_38save_partial},
  {"save_file", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_41save_file, METH_O, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_40save_file},
  {"save_ellipsis", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_43save_ellipsis, METH_O, 0},
  {"save_not_implemented", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_45save_not_implemented, METH_O, 0},
  {"inject_addons", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_47inject_addons, METH_NOARGS, __pyx_doc_13cycloudpickle_13cycloudpickle_12CloudPickler_46inject_addons},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_13cycloudpickle_13cycloudpickle_CloudPickler = {
  PyVarObject_HEAD_INIT(0, 0)
  "cycloudpickle.cycloudpickle.CloudPickler", /*tp_name*/
  sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle_CloudPickler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cycloudpickle_13cycloudpickle_CloudPickler, /*tp_dealloc*/
  0, /*tp_print*/
  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_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_13cycloudpickle_13cycloudpickle_CloudPickler, /*tp_traverse*/
  __pyx_tp_clear_13cycloudpickle_13cycloudpickle_CloudPickler, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_13cycloudpickle_13cycloudpickle_CloudPickler, /*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*/
  __pyx_pw_13cycloudpickle_13cycloudpickle_12CloudPickler_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_13cycloudpickle_13cycloudpickle_CloudPickler, /*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
};

static struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *__pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops[8];
static int __pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops = 0;

static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops)))) {
    o = (PyObject*)__pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops[--__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops];
    memset(o, 0, sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops));
    (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_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops(PyObject *o) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_code);
  Py_CLEAR(p->__pyx_v_extended_arg);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_v_op);
  Py_CLEAR(p->__pyx_v_oparg);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops)))) {
    __pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops[__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops++] = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *)o;
  if (p->__pyx_v_code) {
    e = (*v)(p->__pyx_v_code, a); if (e) return e;
  }
  if (p->__pyx_v_extended_arg) {
    e = (*v)(p->__pyx_v_extended_arg, a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_v_op) {
    e = (*v)(p->__pyx_v_op, a); if (e) return e;
  }
  if (p->__pyx_v_oparg) {
    e = (*v)(p->__pyx_v_oparg, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops *)o;
  tmp = ((PyObject*)p->__pyx_v_code);
  p->__pyx_v_code = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_extended_arg);
  p->__pyx_v_extended_arg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_i);
  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_op);
  p->__pyx_v_op = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_oparg);
  p->__pyx_v_oparg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops = {
  PyVarObject_HEAD_INIT(0, 0)
  "cycloudpickle.cycloudpickle.__pyx_scope_struct___walk_global_ops", /*tp_name*/
  sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops, /*tp_dealloc*/
  0, /*tp_print*/
  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_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops, /*tp_traverse*/
  __pyx_tp_clear_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops, /*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_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops, /*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
};

static struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *__pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops[8];
static int __pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops = 0;

static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops)))) {
    o = (PyObject*)__pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops[--__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops];
    memset(o, 0, sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops));
    (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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops(PyObject *o) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_code);
  Py_CLEAR(p->__pyx_v_instr);
  Py_CLEAR(p->__pyx_v_op);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops)))) {
    __pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops[__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops++] = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *)o;
  if (p->__pyx_v_code) {
    e = (*v)(p->__pyx_v_code, a); if (e) return e;
  }
  if (p->__pyx_v_instr) {
    e = (*v)(p->__pyx_v_instr, a); if (e) return e;
  }
  if (p->__pyx_v_op) {
    e = (*v)(p->__pyx_v_op, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops *)o;
  tmp = ((PyObject*)p->__pyx_v_code);
  p->__pyx_v_code = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_instr);
  p->__pyx_v_instr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_op);
  p->__pyx_v_op = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops = {
  PyVarObject_HEAD_INIT(0, 0)
  "cycloudpickle.cycloudpickle.__pyx_scope_struct_1__walk_global_ops", /*tp_name*/
  sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops, /*tp_dealloc*/
  0, /*tp_print*/
  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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops, /*tp_traverse*/
  __pyx_tp_clear_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops, /*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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops, /*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
};

static struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *__pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals[8];
static int __pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals = 0;

static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals)))) {
    o = (PyObject*)__pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals[--__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals];
    memset(o, 0, sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals));
    (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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals(PyObject *o) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_co);
  Py_CLEAR(p->__pyx_v_names);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals)))) {
    __pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals[__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals++] = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *)o;
  if (p->__pyx_v_co) {
    e = (*v)(p->__pyx_v_co, a); if (e) return e;
  }
  if (p->__pyx_v_names) {
    e = (*v)(p->__pyx_v_names, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *)o;
  tmp = ((PyObject*)p->__pyx_v_co);
  p->__pyx_v_co = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_names);
  p->__pyx_v_names = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals = {
  PyVarObject_HEAD_INIT(0, 0)
  "cycloudpickle.cycloudpickle.__pyx_scope_struct_2_extract_code_globals", /*tp_name*/
  sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals, /*tp_dealloc*/
  0, /*tp_print*/
  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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals, /*tp_traverse*/
  __pyx_tp_clear_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals, /*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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals, /*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
};

static struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *__pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr[8];
static int __pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr = 0;

static PyObject *__pyx_tp_new_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr)))) {
    o = (PyObject*)__pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr[--__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_op);
  Py_CLEAR(p->__pyx_v_oparg);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr)))) {
    __pyx_freelist_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr[__pyx_freecount_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_op) {
    e = (*v)(p->__pyx_v_op, a); if (e) return e;
  }
  if (p->__pyx_v_oparg) {
    e = (*v)(p->__pyx_v_oparg, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_op);
  p->__pyx_v_op = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_oparg);
  p->__pyx_v_oparg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "cycloudpickle.cycloudpickle.__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  __pyx_tp_clear_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr, /*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_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_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
};

static PyMethodDef __pyx_methods[] = {
  {"dump", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_15dump, METH_VARARGS|METH_KEYWORDS, 0},
  {"dumps", (PyCFunction)__pyx_pw_13cycloudpickle_13cycloudpickle_17dumps, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "cycloudpickle",
    __pyx_k_This_file_is_an_adaptation_of_c, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0},
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s_BUILD, __pyx_k_BUILD, sizeof(__pyx_k_BUILD), 0, 0, 1, 1},
  {&__pyx_n_s_BUILTIN_TYPE_NAMES, __pyx_k_BUILTIN_TYPE_NAMES, sizeof(__pyx_k_BUILTIN_TYPE_NAMES), 0, 0, 1, 1},
  {&__pyx_n_s_BufferedRandom, __pyx_k_BufferedRandom, sizeof(__pyx_k_BufferedRandom), 0, 0, 1, 1},
  {&__pyx_n_s_BuiltinFunctionType, __pyx_k_BuiltinFunctionType, sizeof(__pyx_k_BuiltinFunctionType), 0, 0, 1, 1},
  {&__pyx_n_s_BytesIO, __pyx_k_BytesIO, sizeof(__pyx_k_BytesIO), 0, 0, 1, 1},
  {&__pyx_kp_u_Can_t_pickle_r, __pyx_k_Can_t_pickle_r, sizeof(__pyx_k_Can_t_pickle_r), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pickle_closed_files, __pyx_k_Cannot_pickle_closed_files, sizeof(__pyx_k_Cannot_pickle_closed_files), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pickle_file_s_as_it_canno, __pyx_k_Cannot_pickle_file_s_as_it_canno, sizeof(__pyx_k_Cannot_pickle_file_s_as_it_canno), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pickle_files_that_are_not, __pyx_k_Cannot_pickle_files_that_are_not, sizeof(__pyx_k_Cannot_pickle_files_that_are_not), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pickle_files_that_do_not, __pyx_k_Cannot_pickle_files_that_do_not, sizeof(__pyx_k_Cannot_pickle_files_that_do_not), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pickle_files_that_map_to, __pyx_k_Cannot_pickle_files_that_map_to, sizeof(__pyx_k_Cannot_pickle_files_that_map_to), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pickle_objects_of_type_s, __pyx_k_Cannot_pickle_objects_of_type_s, sizeof(__pyx_k_Cannot_pickle_objects_of_type_s), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_pickle_standard_input, __pyx_k_Cannot_pickle_standard_input, sizeof(__pyx_k_Cannot_pickle_standard_input), 0, 1, 0, 0},
  {&__pyx_n_s_ClassType, __pyx_k_ClassType, sizeof(__pyx_k_ClassType), 0, 0, 1, 1},
  {&__pyx_n_s_CodeType, __pyx_k_CodeType, sizeof(__pyx_k_CodeType), 0, 0, 1, 1},
  {&__pyx_kp_u_Could_not_pickle_object_as_exces, __pyx_k_Could_not_pickle_object_as_exces, sizeof(__pyx_k_Could_not_pickle_object_as_exces), 0, 1, 0, 0},
  {&__pyx_n_s_DELETE_GLOBAL, __pyx_k_DELETE_GLOBAL, sizeof(__pyx_k_DELETE_GLOBAL), 0, 0, 1, 1},
  {&__pyx_n_u_DELETE_GLOBAL, __pyx_k_DELETE_GLOBAL, sizeof(__pyx_k_DELETE_GLOBAL), 0, 1, 0, 1},
  {&__pyx_n_s_Dummy, __pyx_k_Dummy, sizeof(__pyx_k_Dummy), 0, 0, 1, 1},
  {&__pyx_n_s_EXTENDED_ARG, __pyx_k_EXTENDED_ARG, sizeof(__pyx_k_EXTENDED_ARG), 0, 0, 1, 1},
  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
  {&__pyx_n_s_FunctionType, __pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 0, 1, 1},
  {&__pyx_n_s_GLOBAL, __pyx_k_GLOBAL, sizeof(__pyx_k_GLOBAL), 0, 0, 1, 1},
  {&__pyx_n_s_GLOBAL_OPS, __pyx_k_GLOBAL_OPS, sizeof(__pyx_k_GLOBAL_OPS), 0, 0, 1, 1},
  {&__pyx_n_s_GeneratorType, __pyx_k_GeneratorType, sizeof(__pyx_k_GeneratorType), 0, 0, 1, 1},
  {&__pyx_n_s_HAVE_ARGUMENT, __pyx_k_HAVE_ARGUMENT, sizeof(__pyx_k_HAVE_ARGUMENT), 0, 0, 1, 1},
  {&__pyx_n_s_INST, __pyx_k_INST, sizeof(__pyx_k_INST), 0, 0, 1, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_n_s_InstanceType, __pyx_k_InstanceType, sizeof(__pyx_k_InstanceType), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_LOAD_GLOBAL, __pyx_k_LOAD_GLOBAL, sizeof(__pyx_k_LOAD_GLOBAL), 0, 0, 1, 1},
  {&__pyx_n_u_LOAD_GLOBAL, __pyx_k_LOAD_GLOBAL, sizeof(__pyx_k_LOAD_GLOBAL), 0, 1, 0, 1},
  {&__pyx_n_s_MARK, __pyx_k_MARK, sizeof(__pyx_k_MARK), 0, 0, 1, 1},
  {&__pyx_n_s_MethodType, __pyx_k_MethodType, sizeof(__pyx_k_MethodType), 0, 0, 1, 1},
  {&__pyx_n_s_ModuleType, __pyx_k_ModuleType, sizeof(__pyx_k_ModuleType), 0, 0, 1, 1},
  {&__pyx_n_s_NEWOBJ, __pyx_k_NEWOBJ, sizeof(__pyx_k_NEWOBJ), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
  {&__pyx_n_s_OBJ, __pyx_k_OBJ, sizeof(__pyx_k_OBJ), 0, 0, 1, 1},
  {&__pyx_n_s_PY3, __pyx_k_PY3, sizeof(__pyx_k_PY3), 0, 0, 1, 1},
  {&__pyx_n_s_PicklingError, __pyx_k_PicklingError, sizeof(__pyx_k_PicklingError), 0, 0, 1, 1},
  {&__pyx_n_s_REDUCE, __pyx_k_REDUCE, sizeof(__pyx_k_REDUCE), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_STORE_GLOBAL, __pyx_k_STORE_GLOBAL, sizeof(__pyx_k_STORE_GLOBAL), 0, 0, 1, 1},
  {&__pyx_n_u_STORE_GLOBAL, __pyx_k_STORE_GLOBAL, sizeof(__pyx_k_STORE_GLOBAL), 0, 1, 0, 1},
  {&__pyx_n_s_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 0, 0, 1, 1},
  {&__pyx_n_s_TUPLE, __pyx_k_TUPLE, sizeof(__pyx_k_TUPLE), 0, 0, 1, 1},
  {&__pyx_n_s_TextIOWrapper, __pyx_k_TextIOWrapper, sizeof(__pyx_k_TextIOWrapper), 0, 0, 1, 1},
  {&__pyx_n_s_WeakKeyDictionary, __pyx_k_WeakKeyDictionary, sizeof(__pyx_k_WeakKeyDictionary), 0, 0, 1, 1},
  {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
  {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0},
  {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 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_kp_u_args_0_from___newobj___args_has, __pyx_k_args_0_from___newobj___args_has, sizeof(__pyx_k_args_0_from___newobj___args_has), 0, 1, 0, 0},
  {&__pyx_kp_u_args_0_from___newobj___args_has_2, __pyx_k_args_0_from___newobj___args_has_2, sizeof(__pyx_k_args_0_from___newobj___args_has_2), 0, 1, 0, 0},
  {&__pyx_kp_u_args_from_reduce_should_be_a_tup, __pyx_k_args_from_reduce_should_be_a_tup, sizeof(__pyx_k_args_from_reduce_should_be_a_tup), 0, 1, 0, 0},
  {&__pyx_n_s_attrgetter, __pyx_k_attrgetter, sizeof(__pyx_k_attrgetter), 0, 0, 1, 1},
  {&__pyx_n_s_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1},
  {&__pyx_n_u_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 1, 0, 1},
  {&__pyx_n_u_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 1, 0, 1},
  {&__pyx_n_s_bases, __pyx_k_bases, sizeof(__pyx_k_bases), 0, 0, 1, 1},
  {&__pyx_n_s_batch_appends, __pyx_k_batch_appends, sizeof(__pyx_k_batch_appends), 0, 0, 1, 1},
  {&__pyx_n_s_batch_setitems, __pyx_k_batch_setitems, sizeof(__pyx_k_batch_setitems), 0, 0, 1, 1},
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {&__pyx_n_u_builtin, __pyx_k_builtin, sizeof(__pyx_k_builtin), 0, 1, 0, 1},
  {&__pyx_n_s_builtin_type, __pyx_k_builtin_type, sizeof(__pyx_k_builtin_type), 0, 0, 1, 1},
  {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1},
  {&__pyx_n_u_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 1, 0, 1},
  {&__pyx_n_s_builtins_2, __pyx_k_builtins_2, sizeof(__pyx_k_builtins_2), 0, 0, 1, 1},
  {&__pyx_n_u_builtins_2, __pyx_k_builtins_2, sizeof(__pyx_k_builtins_2), 0, 1, 0, 1},
  {&__pyx_n_s_cStringIO, __pyx_k_cStringIO, sizeof(__pyx_k_cStringIO), 0, 0, 1, 1},
  {&__pyx_n_u_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 1, 0, 1},
  {&__pyx_n_s_cell_contents, __pyx_k_cell_contents, sizeof(__pyx_k_cell_contents), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_classmethod, __pyx_k_classmethod, sizeof(__pyx_k_classmethod), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
  {&__pyx_n_s_closure, __pyx_k_closure, sizeof(__pyx_k_closure), 0, 0, 1, 1},
  {&__pyx_n_s_cloudpickle_cloudpickle, __pyx_k_cloudpickle_cloudpickle, sizeof(__pyx_k_cloudpickle_cloudpickle), 0, 0, 1, 1},
  {&__pyx_n_s_co, __pyx_k_co, sizeof(__pyx_k_co), 0, 0, 1, 1},
  {&__pyx_n_s_co_argcount, __pyx_k_co_argcount, sizeof(__pyx_k_co_argcount), 0, 0, 1, 1},
  {&__pyx_n_s_co_cellvars, __pyx_k_co_cellvars, sizeof(__pyx_k_co_cellvars), 0, 0, 1, 1},
  {&__pyx_n_s_co_code, __pyx_k_co_code, sizeof(__pyx_k_co_code), 0, 0, 1, 1},
  {&__pyx_n_u_co_code, __pyx_k_co_code, sizeof(__pyx_k_co_code), 0, 1, 0, 1},
  {&__pyx_n_s_co_consts, __pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 0, 1, 1},
  {&__pyx_n_s_co_filename, __pyx_k_co_filename, sizeof(__pyx_k_co_filename), 0, 0, 1, 1},
  {&__pyx_n_u_co_filename, __pyx_k_co_filename, sizeof(__pyx_k_co_filename), 0, 1, 0, 1},
  {&__pyx_n_s_co_firstlineno, __pyx_k_co_firstlineno, sizeof(__pyx_k_co_firstlineno), 0, 0, 1, 1},
  {&__pyx_n_s_co_flags, __pyx_k_co_flags, sizeof(__pyx_k_co_flags), 0, 0, 1, 1},
  {&__pyx_n_s_co_freevars, __pyx_k_co_freevars, sizeof(__pyx_k_co_freevars), 0, 0, 1, 1},
  {&__pyx_n_s_co_kwonlyargcount, __pyx_k_co_kwonlyargcount, sizeof(__pyx_k_co_kwonlyargcount), 0, 0, 1, 1},
  {&__pyx_n_s_co_lnotab, __pyx_k_co_lnotab, sizeof(__pyx_k_co_lnotab), 0, 0, 1, 1},
  {&__pyx_n_s_co_name, __pyx_k_co_name, sizeof(__pyx_k_co_name), 0, 0, 1, 1},
  {&__pyx_n_s_co_names, __pyx_k_co_names, sizeof(__pyx_k_co_names), 0, 0, 1, 1},
  {&__pyx_n_s_co_nlocals, __pyx_k_co_nlocals, sizeof(__pyx_k_co_nlocals), 0, 0, 1, 1},
  {&__pyx_n_s_co_stacksize, __pyx_k_co_stacksize, sizeof(__pyx_k_co_stacksize), 0, 0, 1, 1},
  {&__pyx_n_s_co_varnames, __pyx_k_co_varnames, sizeof(__pyx_k_co_varnames), 0, 0, 1, 1},
  {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
  {&__pyx_n_u_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 1, 0, 1},
  {&__pyx_n_s_code_2, __pyx_k_code_2, sizeof(__pyx_k_code_2), 0, 0, 1, 1},
  {&__pyx_n_s_const, __pyx_k_const, sizeof(__pyx_k_const), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_copy_reg, __pyx_k_copy_reg, sizeof(__pyx_k_copy_reg), 0, 0, 1, 1},
  {&__pyx_n_s_copyreg, __pyx_k_copyreg, sizeof(__pyx_k_copyreg), 0, 0, 1, 1},
  {&__pyx_n_s_coroutine, __pyx_k_coroutine, sizeof(__pyx_k_coroutine), 0, 0, 1, 1},
  {&__pyx_n_s_cycloudpickle_cycloudpickle, __pyx_k_cycloudpickle_cycloudpickle, sizeof(__pyx_k_cycloudpickle_cycloudpickle), 0, 0, 1, 1},
  {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 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_dictitems, __pyx_k_dictitems, sizeof(__pyx_k_dictitems), 0, 0, 1, 1},
  {&__pyx_n_s_dis, __pyx_k_dis, sizeof(__pyx_k_dis), 0, 0, 1, 1},
  {&__pyx_n_s_dispatch, __pyx_k_dispatch, sizeof(__pyx_k_dispatch), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 0, 1, 1},
  {&__pyx_n_s_dynamic_subimport, __pyx_k_dynamic_subimport, sizeof(__pyx_k_dynamic_subimport), 0, 0, 1, 1},
  {&__pyx_n_s_extended_arg, __pyx_k_extended_arg, sizeof(__pyx_k_extended_arg), 0, 0, 1, 1},
  {&__pyx_n_s_extract_code_globals, __pyx_k_extract_code_globals, sizeof(__pyx_k_extract_code_globals), 0, 0, 1, 1},
  {&__pyx_n_s_extract_code_globals_cache, __pyx_k_extract_code_globals_cache, sizeof(__pyx_k_extract_code_globals_cache), 0, 0, 1, 1},
  {&__pyx_n_s_extract_code_globals_locals_gene, __pyx_k_extract_code_globals_locals_gene, sizeof(__pyx_k_extract_code_globals_locals_gene), 0, 0, 1, 1},
  {&__pyx_n_s_extract_func_data, __pyx_k_extract_func_data, sizeof(__pyx_k_extract_func_data), 0, 0, 1, 1},
  {&__pyx_n_s_fdel, __pyx_k_fdel, sizeof(__pyx_k_fdel), 0, 0, 1, 1},
  {&__pyx_n_s_fget, __pyx_k_fget, sizeof(__pyx_k_fget), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_fill_function, __pyx_k_fill_function, sizeof(__pyx_k_fill_function), 0, 0, 1, 1},
  {&__pyx_n_s_find_module, __pyx_k_find_module, sizeof(__pyx_k_find_module), 0, 0, 1, 1},
  {&__pyx_n_s_fset, __pyx_k_fset, sizeof(__pyx_k_fset), 0, 0, 1, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_func_2, __pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 0, 1, 1},
  {&__pyx_kp_u_func_from_reduce_should_be_calla, __pyx_k_func_from_reduce_should_be_calla, sizeof(__pyx_k_func_from_reduce_should_be_calla), 0, 1, 0, 0},
  {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
  {&__pyx_n_s_gen, __pyx_k_gen, sizeof(__pyx_k_gen), 0, 0, 1, 1},
  {&__pyx_n_s_gen_ellipsis, __pyx_k_gen_ellipsis, sizeof(__pyx_k_gen_ellipsis), 0, 0, 1, 1},
  {&__pyx_n_s_gen_not_implemented, __pyx_k_gen_not_implemented, sizeof(__pyx_k_gen_not_implemented), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_genpartial, __pyx_k_genpartial, sizeof(__pyx_k_genpartial), 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_instructions, __pyx_k_get_instructions, sizeof(__pyx_k_get_instructions), 0, 0, 1, 1},
  {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
  {&__pyx_n_s_getattribute, __pyx_k_getattribute, sizeof(__pyx_k_getattribute), 0, 0, 1, 1},
  {&__pyx_n_s_getinitargs, __pyx_k_getinitargs, sizeof(__pyx_k_getinitargs), 0, 0, 1, 1},
  {&__pyx_n_u_getinitargs, __pyx_k_getinitargs, sizeof(__pyx_k_getinitargs), 0, 1, 0, 1},
  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_getvalue, __pyx_k_getvalue, sizeof(__pyx_k_getvalue), 0, 0, 1, 1},
  {&__pyx_n_s_globals, __pyx_k_globals, sizeof(__pyx_k_globals), 0, 0, 1, 1},
  {&__pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_k_home_frens_jan_Workspaces_tgho, sizeof(__pyx_k_home_frens_jan_Workspaces_tgho), 0, 0, 1, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_im_class, __pyx_k_im_class, sizeof(__pyx_k_im_class), 0, 0, 1, 1},
  {&__pyx_n_s_imp, __pyx_k_imp, sizeof(__pyx_k_imp), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 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_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_inject_addons, __pyx_k_inject_addons, sizeof(__pyx_k_inject_addons), 0, 0, 1, 1},
  {&__pyx_n_u_input, __pyx_k_input, sizeof(__pyx_k_input), 0, 1, 0, 1},
  {&__pyx_n_s_instr, __pyx_k_instr, sizeof(__pyx_k_instr), 0, 0, 1, 1},
  {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
  {&__pyx_n_s_is_coroutine_function, __pyx_k_is_coroutine_function, sizeof(__pyx_k_is_coroutine_function), 0, 0, 1, 1},
  {&__pyx_n_u_is_coroutine_function, __pyx_k_is_coroutine_function, sizeof(__pyx_k_is_coroutine_function), 0, 1, 0, 1},
  {&__pyx_n_s_is_tornado_coroutine, __pyx_k_is_tornado_coroutine, sizeof(__pyx_k_is_tornado_coroutine), 0, 0, 1, 1},
  {&__pyx_n_s_isatty, __pyx_k_isatty, sizeof(__pyx_k_isatty), 0, 0, 1, 1},
  {&__pyx_n_u_isatty, __pyx_k_isatty, sizeof(__pyx_k_isatty), 0, 1, 0, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_s_itemgetter, __pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_keep_alive, __pyx_k_keep_alive, sizeof(__pyx_k_keep_alive), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_keywords, __pyx_k_keywords, sizeof(__pyx_k_keywords), 0, 0, 1, 1},
  {&__pyx_kp_u_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 1, 0, 0},
  {&__pyx_n_s_listitems, __pyx_k_listitems, sizeof(__pyx_k_listitems), 0, 0, 1, 1},
  {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_u_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 1, 0, 1},
  {&__pyx_n_s_make_skel_func, __pyx_k_make_skel_func, sizeof(__pyx_k_make_skel_func), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_memoize, __pyx_k_memoize, sizeof(__pyx_k_memoize), 0, 0, 1, 1},
  {&__pyx_n_s_memoryview, __pyx_k_memoryview, sizeof(__pyx_k_memoryview), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_method_descriptor, __pyx_k_method_descriptor, sizeof(__pyx_k_method_descriptor), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_u_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 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_modules, __pyx_k_modules, sizeof(__pyx_k_modules), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 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_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 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_u_newobj, __pyx_k_newobj, sizeof(__pyx_k_newobj), 0, 1, 0, 1},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_objclass, __pyx_k_objclass, sizeof(__pyx_k_objclass), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1},
  {&__pyx_n_s_oparg, __pyx_k_oparg, sizeof(__pyx_k_oparg), 0, 0, 1, 1},
  {&__pyx_n_s_opcode, __pyx_k_opcode, sizeof(__pyx_k_opcode), 0, 0, 1, 1},
  {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1},
  {&__pyx_n_s_opname, __pyx_k_opname, sizeof(__pyx_k_opname), 0, 0, 1, 1},
  {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1},
  {&__pyx_n_s_out_names, __pyx_k_out_names, sizeof(__pyx_k_out_names), 0, 0, 1, 1},
  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
  {&__pyx_n_s_partial, __pyx_k_partial, sizeof(__pyx_k_partial), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 0, 1, 1},
  {&__pyx_n_u_pypy_version_info, __pyx_k_pypy_version_info, sizeof(__pyx_k_pypy_version_info), 0, 1, 0, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_rebuild_tornado_coroutine, __pyx_k_rebuild_tornado_coroutine, sizeof(__pyx_k_rebuild_tornado_coroutine), 0, 0, 1, 1},
  {&__pyx_n_s_reconstruct_closure, __pyx_k_reconstruct_closure, sizeof(__pyx_k_reconstruct_closure), 0, 0, 1, 1},
  {&__pyx_n_u_recursion, __pyx_k_recursion, sizeof(__pyx_k_recursion), 0, 1, 0, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_method_descriptor, __pyx_k_reduce_method_descriptor, sizeof(__pyx_k_reduce_method_descriptor), 0, 0, 1, 1},
  {&__pyx_n_s_restore_attr, __pyx_k_restore_attr, sizeof(__pyx_k_restore_attr), 0, 0, 1, 1},
  {&__pyx_n_s_save, __pyx_k_save, sizeof(__pyx_k_save), 0, 0, 1, 1},
  {&__pyx_n_s_save_attrgetter, __pyx_k_save_attrgetter, sizeof(__pyx_k_save_attrgetter), 0, 0, 1, 1},
  {&__pyx_n_s_save_attrgetter_locals_Dummy, __pyx_k_save_attrgetter_locals_Dummy, sizeof(__pyx_k_save_attrgetter_locals_Dummy), 0, 0, 1, 1},
  {&__pyx_n_s_save_attrgetter_locals_Dummy___g, __pyx_k_save_attrgetter_locals_Dummy___g, sizeof(__pyx_k_save_attrgetter_locals_Dummy___g), 0, 0, 1, 1},
  {&__pyx_n_s_save_attrgetter_locals_Dummy___i, __pyx_k_save_attrgetter_locals_Dummy___i, sizeof(__pyx_k_save_attrgetter_locals_Dummy___i), 0, 0, 1, 1},
  {&__pyx_n_s_save_buffer, __pyx_k_save_buffer, sizeof(__pyx_k_save_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_save_builtin_function, __pyx_k_save_builtin_function, sizeof(__pyx_k_save_builtin_function), 0, 0, 1, 1},
  {&__pyx_n_s_save_classmethod, __pyx_k_save_classmethod, sizeof(__pyx_k_save_classmethod), 0, 0, 1, 1},
  {&__pyx_n_s_save_codeobject, __pyx_k_save_codeobject, sizeof(__pyx_k_save_codeobject), 0, 0, 1, 1},
  {&__pyx_n_s_save_ellipsis, __pyx_k_save_ellipsis, sizeof(__pyx_k_save_ellipsis), 0, 0, 1, 1},
  {&__pyx_n_s_save_file, __pyx_k_save_file, sizeof(__pyx_k_save_file), 0, 0, 1, 1},
  {&__pyx_n_s_save_function, __pyx_k_save_function, sizeof(__pyx_k_save_function), 0, 0, 1, 1},
  {&__pyx_n_s_save_function_tuple, __pyx_k_save_function_tuple, sizeof(__pyx_k_save_function_tuple), 0, 0, 1, 1},
  {&__pyx_n_s_save_global, __pyx_k_save_global, sizeof(__pyx_k_save_global), 0, 0, 1, 1},
  {&__pyx_n_s_save_inst, __pyx_k_save_inst, sizeof(__pyx_k_save_inst), 0, 0, 1, 1},
  {&__pyx_n_s_save_instancemethod, __pyx_k_save_instancemethod, sizeof(__pyx_k_save_instancemethod), 0, 0, 1, 1},
  {&__pyx_n_s_save_itemgetter, __pyx_k_save_itemgetter, sizeof(__pyx_k_save_itemgetter), 0, 0, 1, 1},
  {&__pyx_n_s_save_itemgetter_locals_Dummy, __pyx_k_save_itemgetter_locals_Dummy, sizeof(__pyx_k_save_itemgetter_locals_Dummy), 0, 0, 1, 1},
  {&__pyx_n_s_save_itemgetter_locals_Dummy___g, __pyx_k_save_itemgetter_locals_Dummy___g, sizeof(__pyx_k_save_itemgetter_locals_Dummy___g), 0, 0, 1, 1},
  {&__pyx_n_s_save_memoryview, __pyx_k_save_memoryview, sizeof(__pyx_k_save_memoryview), 0, 0, 1, 1},
  {&__pyx_n_s_save_module, __pyx_k_save_module, sizeof(__pyx_k_save_module), 0, 0, 1, 1},
  {&__pyx_n_s_save_not_implemented, __pyx_k_save_not_implemented, sizeof(__pyx_k_save_not_implemented), 0, 0, 1, 1},
  {&__pyx_n_s_save_partial, __pyx_k_save_partial, sizeof(__pyx_k_save_partial), 0, 0, 1, 1},
  {&__pyx_n_s_save_property, __pyx_k_save_property, sizeof(__pyx_k_save_property), 0, 0, 1, 1},
  {&__pyx_n_s_save_reduce, __pyx_k_save_reduce, sizeof(__pyx_k_save_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_save_string, __pyx_k_save_string, sizeof(__pyx_k_save_string), 0, 0, 1, 1},
  {&__pyx_n_s_save_unsupported, __pyx_k_save_unsupported, sizeof(__pyx_k_save_unsupported), 0, 0, 1, 1},
  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_u_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 1, 0, 1},
  {&__pyx_n_s_self_2, __pyx_k_self_2, sizeof(__pyx_k_self_2), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 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_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
  {&__pyx_n_u_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 1, 0, 1},
  {&__pyx_kp_u_stdin, __pyx_k_stdin, sizeof(__pyx_k_stdin), 0, 1, 0, 0},
  {&__pyx_n_s_stdin_2, __pyx_k_stdin_2, sizeof(__pyx_k_stdin_2), 0, 0, 1, 1},
  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  {&__pyx_n_u_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 1, 0, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_subimport, __pyx_k_subimport, sizeof(__pyx_k_subimport), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_tornado, __pyx_k_tornado, sizeof(__pyx_k_tornado), 0, 0, 1, 1},
  {&__pyx_kp_u_tornado_gen, __pyx_k_tornado_gen, sizeof(__pyx_k_tornado_gen), 0, 1, 0, 0},
  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_transient, __pyx_k_transient, sizeof(__pyx_k_transient), 0, 0, 1, 1},
  {&__pyx_n_u_transient, __pyx_k_transient, sizeof(__pyx_k_transient), 0, 1, 0, 1},
  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_vars, __pyx_k_vars, sizeof(__pyx_k_vars), 0, 0, 1, 1},
  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
  {&__pyx_n_s_walk_global_ops, __pyx_k_walk_global_ops, sizeof(__pyx_k_walk_global_ops), 0, 0, 1, 1},
  {&__pyx_n_u_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 1, 0, 1},
  {&__pyx_n_s_weakref_2, __pyx_k_weakref_2, sizeof(__pyx_k_weakref_2), 0, 0, 1, 1},
  {&__pyx_n_s_whichmodule, __pyx_k_whichmodule, sizeof(__pyx_k_whichmodule), 0, 0, 1, 1},
  {&__pyx_n_s_wrapped, __pyx_k_wrapped, sizeof(__pyx_k_wrapped), 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 int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 78, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 523, __pyx_L1_error)
  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 695, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 696, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 114, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 156, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 191, __pyx_L1_error)
  __pyx_builtin_vars = __Pyx_GetBuiltinName(__pyx_n_s_vars); if (!__pyx_builtin_vars) __PYX_ERR(0, 232, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 274, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 399, __pyx_L1_error)
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 425, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 430, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 529, __pyx_L1_error)
  __pyx_builtin_classmethod = __Pyx_GetBuiltinName(__pyx_n_s_classmethod); if (!__pyx_builtin_classmethod) __PYX_ERR(0, 530, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 675, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "cycloudpickle/cycloudpickle.pyx":233
 *         if is_dynamic:
 *             v = vars(obj)
 *             if v.get('__builtins__') is vars(builtins):             # <<<<<<<<<<<<<<
 *                 v = dict(v, __builtins__=builtins)
 *             self.save_reduce(dynamic_subimport, (obj.__name__, v), obj=obj)
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_u_builtins); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "cycloudpickle/cycloudpickle.pyx":295
 *         if not hasattr(obj, '__code__'):
 *             if PY3:
 *                 if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *                     raise pickle.PicklingError("Can't pickle %r" % obj)
 *                 else:
 */
  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_4); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "cycloudpickle/cycloudpickle.pyx":442
 *             if not isinstance(d.get('__dict__', None), property):
 *                 # don't extract dict that are properties
 *                 d.pop('__dict__', None)             # <<<<<<<<<<<<<<
 *             d.pop('__weakref__', None)
 * 
 */
  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_u_dict, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "cycloudpickle/cycloudpickle.pyx":443
 *                 # don't extract dict that are properties
 *                 d.pop('__dict__', None)
 *             d.pop('__weakref__', None)             # <<<<<<<<<<<<<<
 * 
 *             # hack as __new__ is stored differently in the __dict__
 */
  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_u_weakref, Py_None); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "cycloudpickle/cycloudpickle.pyx":539
 *         """itemgetter serializer (needed for namedtuple support)"""
 *         class Dummy:
 *             def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *                 return item
 *         items = obj(Dummy())
 */
  __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_item); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);
  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_getitem, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 539, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":552
 *         """attrgetter serializer"""
 *         class Dummy(object):
 *             def __init__(self, attrs, index=None):             # <<<<<<<<<<<<<<
 *                 self.attrs = attrs
 *                 self.index = index
 */
  __pyx_tuple__11 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_attrs, __pyx_n_s_index); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_init, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 552, __pyx_L1_error)
  __pyx_tuple__13 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "cycloudpickle/cycloudpickle.pyx":555
 *                 self.attrs = attrs
 *                 self.index = index
 *             def __getattribute__(self, item):             # <<<<<<<<<<<<<<
 *                 attrs = object.__getattribute__(self, "attrs")
 *                 index = object.__getattribute__(self, "index")
 */
  __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_item, __pyx_n_s_attrs, __pyx_n_s_index); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_getattribute, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 555, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":577
 *         # Assert that args is a tuple or None
 *         if not isinstance(args, tuple):
 *             raise pickle.PicklingError("args from reduce() should be a tuple")             # <<<<<<<<<<<<<<
 * 
 *         # Assert that func is callable
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_args_from_reduce_should_be_a_tup); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "cycloudpickle/cycloudpickle.pyx":581
 *         # Assert that func is callable
 *         if not hasattr(func, '__call__'):
 *             raise pickle.PicklingError("func from reduce should be callable")             # <<<<<<<<<<<<<<
 * 
 *         save = self.save
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_func_from_reduce_should_be_calla); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "cycloudpickle/cycloudpickle.pyx":591
 *             cls = args[0]
 *             if not hasattr(cls, "__new__"):
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_args_0_from___newobj___args_has); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "cycloudpickle/cycloudpickle.pyx":594
 *                     "args[0] from __newobj__ args has no __new__")
 *             if obj is not None and cls is not obj.__class__:
 *                 raise pickle.PicklingError(             # <<<<<<<<<<<<<<
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_args_0_from___newobj___args_has_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "cycloudpickle/cycloudpickle.pyx":596
 *                 raise pickle.PicklingError(
 *                     "args[0] from __newobj__ args has the wrong class")
 *             args = args[1:]             # <<<<<<<<<<<<<<
 *             save(cls)
 * 
 */
  __pyx_slice__20 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__20);
  __Pyx_GIVEREF(__pyx_slice__20);

  /* "cycloudpickle/cycloudpickle.pyx":644
 *         """Save a file"""
 *         if not hasattr(obj, 'name') or  not hasattr(obj, 'mode'):
 *             raise pickle.PicklingError("Cannot pickle files that do not map to an actual file")             # <<<<<<<<<<<<<<
 *         if obj is sys.stdout:
 *             return self.save_reduce(getattr, (sys, 'stdout'), obj=obj)
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pickle_files_that_do_not); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "cycloudpickle/cycloudpickle.pyx":650
 *             return self.save_reduce(getattr, (sys, 'stderr'), obj=obj)
 *         if obj is sys.stdin:
 *             raise pickle.PicklingError("Cannot pickle standard input")             # <<<<<<<<<<<<<<
 *         if obj.closed:
 *             raise pickle.PicklingError("Cannot pickle closed files")
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pickle_standard_input); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "cycloudpickle/cycloudpickle.pyx":652
 *             raise pickle.PicklingError("Cannot pickle standard input")
 *         if obj.closed:
 *             raise pickle.PicklingError("Cannot pickle closed files")             # <<<<<<<<<<<<<<
 *         if hasattr(obj, 'isatty') and obj.isatty():
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pickle_closed_files); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "cycloudpickle/cycloudpickle.pyx":654
 *             raise pickle.PicklingError("Cannot pickle closed files")
 *         if hasattr(obj, 'isatty') and obj.isatty():
 *             raise pickle.PicklingError("Cannot pickle files that map to tty objects")             # <<<<<<<<<<<<<<
 *         if 'r' not in obj.mode and '+' not in obj.mode:
 *             raise pickle.PicklingError("Cannot pickle files that are not opened for reading: %s" % obj.mode)
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_Cannot_pickle_files_that_map_to); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "cycloudpickle/cycloudpickle.pyx":672
 *             # Read the whole file
 *             curloc = obj.tell()
 *             obj.seek(0)             # <<<<<<<<<<<<<<
 *             contents = obj.read()
 *             obj.seek(curloc)
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "cycloudpickle/cycloudpickle.pyx":750
 *     """
 *     path = None
 *     for part in mod_name.split('.'):             # <<<<<<<<<<<<<<
 *         if path is not None:
 *             path = [path]
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u__10); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "cycloudpickle/cycloudpickle.pyx":84
 * 
 * # relevant opcodes
 * STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')             # <<<<<<<<<<<<<<
 * DELETE_GLOBAL = dis.opname.index('DELETE_GLOBAL')
 * LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_u_STORE_GLOBAL); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "cycloudpickle/cycloudpickle.pyx":85
 * # relevant opcodes
 * STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')
 * DELETE_GLOBAL = dis.opname.index('DELETE_GLOBAL')             # <<<<<<<<<<<<<<
 * LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')
 * GLOBAL_OPS = [STORE_GLOBAL, DELETE_GLOBAL, LOAD_GLOBAL]
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_u_DELETE_GLOBAL); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "cycloudpickle/cycloudpickle.pyx":86
 * STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')
 * DELETE_GLOBAL = dis.opname.index('DELETE_GLOBAL')
 * LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')             # <<<<<<<<<<<<<<
 * GLOBAL_OPS = [STORE_GLOBAL, DELETE_GLOBAL, LOAD_GLOBAL]
 * HAVE_ARGUMENT = dis.HAVE_ARGUMENT
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_u_LOAD_GLOBAL); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "cycloudpickle/cycloudpickle.pyx":102
 * 
 * 
 * def _builtin_type(name):             # <<<<<<<<<<<<<<
 *     return getattr(types, name)
 * 
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_builtin_type, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 102, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":106
 * 
 * 
 * if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *     def _walk_global_ops(code):
 *         """
 */
  __pyx_tuple__33 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_4); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "cycloudpickle/cycloudpickle.pyx":107
 * 
 * if sys.version_info < (3, 4):
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */
  __pyx_tuple__34 = PyTuple_Pack(6, __pyx_n_s_code_2, __pyx_n_s_n, __pyx_n_s_i, __pyx_n_s_extended_arg, __pyx_n_s_op, __pyx_n_s_oparg); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_walk_global_ops, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 107, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":132
 * 
 * else:
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */
  __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_code_2, __pyx_n_s_instr, __pyx_n_s_op); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_walk_global_ops, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 132, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":145
 * _extract_code_globals_cache = (
 *     weakref.WeakKeyDictionary()
 *     if sys.version_info >= (2, 7) and not hasattr(sys, "pypy_version_info")             # <<<<<<<<<<<<<<
 *     else {})
 * 
 */
  __pyx_tuple__38 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_7); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "cycloudpickle/cycloudpickle.pyx":148
 *     else {})
 * 
 * def extract_code_globals(co):             # <<<<<<<<<<<<<<
 *     """
 *     Find all globals names read or written to by codeblock co
 */
  __pyx_tuple__39 = PyTuple_Pack(6, __pyx_n_s_co, __pyx_n_s_out_names, __pyx_n_s_names, __pyx_n_s_const, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_extract_code_globals, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 148, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":637
 *         self.save_reduce(_genpartial, (obj.func, obj.args, obj.keywords))
 * 
 *     if sys.version_info < (2,7):  # 2.7 supports partial pickling             # <<<<<<<<<<<<<<
 *         dispatch[partial] = save_partial
 * 
 */
  __pyx_tuple__41 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_7); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "cycloudpickle/cycloudpickle.pyx":706
 * # Tornado support
 * 
 * def is_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *     """
 *     Return whether *func* is a Tornado coroutine function.
 */
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_func_2, __pyx_n_s_gen); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_is_tornado_coroutine, 706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 706, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":719
 *     return gen.is_coroutine_function(func)
 * 
 * def _rebuild_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *     from tornado import gen
 *     return gen.coroutine(func)
 */
  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_func_2, __pyx_n_s_gen); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_rebuild_tornado_coroutine, 719, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 719, __pyx_L1_error)

  /* "cycloudpickle/cycloudpickle.pyx":761
 * """ Use copy_reg to extend global pickle definitions """
 * 
 * if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *     method_descriptor = type(str.upper)
 * 
 */
  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_4); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "cycloudpickle/cycloudpickle.pyx":764
 *     method_descriptor = type(str.upper)
 * 
 *     def _reduce_method_descriptor(obj):             # <<<<<<<<<<<<<<
 *         return (getattr, (obj.__objclass__, obj.__name__))
 * 
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_frens_jan_Workspaces_tgho, __pyx_n_s_reduce_method_descriptor, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 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_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcycloudpickle(void); /*proto*/
PyMODINIT_FUNC initcycloudpickle(void)
#else
PyMODINIT_FUNC PyInit_cycloudpickle(void); /*proto*/
PyMODINIT_FUNC PyInit_cycloudpickle(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  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;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  __Pyx_RefNannyDeclarations
  #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("PyMODINIT_FUNC PyInit_cycloudpickle(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __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_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 PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("cycloudpickle", __pyx_methods, __pyx_k_This_file_is_an_adaptation_of_c, 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)
  __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)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  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_cycloudpickle__cycloudpickle) {
    if (PyObject_SetAttrString(__pyx_m, "__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, "cycloudpickle.cycloudpickle")) {
      if (unlikely(PyDict_SetItemString(modules, "cycloudpickle.cycloudpickle", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_ptype_13cycloudpickle_8cypickle_Pickler = __Pyx_ImportType("cycloudpickle.cypickle", "Pickler", sizeof(struct __pyx_obj_13cycloudpickle_8cypickle_Pickler), 1); if (unlikely(!__pyx_ptype_13cycloudpickle_8cypickle_Pickler)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_type_13cycloudpickle_13cycloudpickle_CloudPickler.tp_base = __pyx_ptype_13cycloudpickle_8cypickle_Pickler;
  if (PyType_Ready(&__pyx_type_13cycloudpickle_13cycloudpickle_CloudPickler) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
  __pyx_type_13cycloudpickle_13cycloudpickle_CloudPickler.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "CloudPickler", (PyObject *)&__pyx_type_13cycloudpickle_13cycloudpickle_CloudPickler) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
  __pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler = &__pyx_type_13cycloudpickle_13cycloudpickle_CloudPickler;
  if (PyType_Ready(&__pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops.tp_print = 0;
  __pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops = &__pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct___walk_global_ops;
  if (PyType_Ready(&__pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
  __pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops.tp_print = 0;
  __pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops = &__pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_1__walk_global_ops;
  if (PyType_Ready(&__pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals.tp_print = 0;
  __pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals = &__pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_2_extract_code_globals;
  if (PyType_Ready(&__pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
  __pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr.tp_print = 0;
  __pyx_ptype_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr = &__pyx_type_13cycloudpickle_13cycloudpickle___pyx_scope_struct_3_genexpr;
  /*--- Type import code ---*/
  __pyx_ptype_13cycloudpickle_8cypickle__Framer = __Pyx_ImportType("cycloudpickle.cypickle", "_Framer", sizeof(struct __pyx_obj_13cycloudpickle_8cypickle__Framer), 1); if (unlikely(!__pyx_ptype_13cycloudpickle_8cypickle__Framer)) __PYX_ERR(1, 1, __pyx_L1_error)
  /*--- Variable import code ---*/
  /*--- 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

  /* "cycloudpickle/cycloudpickle.pyx":47
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * """
 * from functools import partial             # <<<<<<<<<<<<<<
 * from io import BytesIO as StringIO
 * import builtins
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_partial);
  __Pyx_GIVEREF(__pyx_n_s_partial);
  PyList_SET_ITEM(__pyx_t_1, 0, __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, 47, __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_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partial, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":48
 * """
 * from functools import partial
 * from io import BytesIO as StringIO             # <<<<<<<<<<<<<<
 * import builtins
 * import dis
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_BytesIO);
  __Pyx_GIVEREF(__pyx_n_s_BytesIO);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BytesIO);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_io, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __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_BytesIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_StringIO, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":49
 * from functools import partial
 * from io import BytesIO as StringIO
 * import builtins             # <<<<<<<<<<<<<<
 * import dis
 * import imp
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_builtins_2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtins_2, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":50
 * from io import BytesIO as StringIO
 * import builtins
 * import dis             # <<<<<<<<<<<<<<
 * import imp
 * import io
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_dis, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dis, __pyx_t_1) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":51
 * import builtins
 * import dis
 * import imp             # <<<<<<<<<<<<<<
 * import io
 * import itertools
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_imp, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_imp, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":52
 * import dis
 * import imp
 * import io             # <<<<<<<<<<<<<<
 * import itertools
 * import operator
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_io, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_io, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":53
 * import imp
 * import io
 * import itertools             # <<<<<<<<<<<<<<
 * import operator
 * import pickle
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":54
 * import io
 * import itertools
 * import operator             # <<<<<<<<<<<<<<
 * import pickle
 * import struct
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_1) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":55
 * import itertools
 * import operator
 * import pickle             # <<<<<<<<<<<<<<
 * import struct
 * import sys
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pickle, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_1) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":56
 * import operator
 * import pickle
 * import struct             # <<<<<<<<<<<<<<
 * import sys
 * import traceback
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":57
 * import pickle
 * import struct
 * import sys             # <<<<<<<<<<<<<<
 * import traceback
 * import types
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":58
 * import struct
 * import sys
 * import traceback             # <<<<<<<<<<<<<<
 * import types
 * import weakref
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_1) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":59
 * import sys
 * import traceback
 * import types             # <<<<<<<<<<<<<<
 * import weakref
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_types, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_1) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":60
 * import traceback
 * import types
 * import weakref             # <<<<<<<<<<<<<<
 * 
 * from .cypickle cimport Pickler
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref_2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_weakref_2, __pyx_t_1) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":63
 * 
 * from .cypickle cimport Pickler
 * from cloudpickle.cloudpickle import _fill_function, _gen_ellipsis, _gen_not_implemented, \             # <<<<<<<<<<<<<<
 *                                     _genpartial, _make_skel_func, _reconstruct_closure, \
 *                                     _restore_attr, dynamic_subimport, subimport
 */
  __pyx_t_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_fill_function);
  __Pyx_GIVEREF(__pyx_n_s_fill_function);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_fill_function);
  __Pyx_INCREF(__pyx_n_s_gen_ellipsis);
  __Pyx_GIVEREF(__pyx_n_s_gen_ellipsis);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_gen_ellipsis);
  __Pyx_INCREF(__pyx_n_s_gen_not_implemented);
  __Pyx_GIVEREF(__pyx_n_s_gen_not_implemented);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_gen_not_implemented);
  __Pyx_INCREF(__pyx_n_s_genpartial);
  __Pyx_GIVEREF(__pyx_n_s_genpartial);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_genpartial);
  __Pyx_INCREF(__pyx_n_s_make_skel_func);
  __Pyx_GIVEREF(__pyx_n_s_make_skel_func);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_make_skel_func);
  __Pyx_INCREF(__pyx_n_s_reconstruct_closure);
  __Pyx_GIVEREF(__pyx_n_s_reconstruct_closure);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_reconstruct_closure);
  __Pyx_INCREF(__pyx_n_s_restore_attr);
  __Pyx_GIVEREF(__pyx_n_s_restore_attr);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_restore_attr);
  __Pyx_INCREF(__pyx_n_s_dynamic_subimport);
  __Pyx_GIVEREF(__pyx_n_s_dynamic_subimport);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_dynamic_subimport);
  __Pyx_INCREF(__pyx_n_s_subimport);
  __Pyx_GIVEREF(__pyx_n_s_subimport);
  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_subimport);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_cloudpickle_cloudpickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __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_fill_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_function, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gen_ellipsis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gen_ellipsis, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gen_not_implemented); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gen_not_implemented, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_genpartial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_genpartial, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_make_skel_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_skel_func, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_reconstruct_closure); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reconstruct_closure, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_restore_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_restore_attr, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dynamic_subimport); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dynamic_subimport, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_subimport); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_subimport, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":68
 * 
 * from cpython.version cimport PY_MAJOR_VERSION
 * PY3 = PY_MAJOR_VERSION > 2             # <<<<<<<<<<<<<<
 * 
 * if PY3:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong((PY_MAJOR_VERSION > 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY3, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":70
 * PY3 = PY_MAJOR_VERSION > 2
 * 
 * if PY3:             # <<<<<<<<<<<<<<
 *     types.ClassType = type
 *     from io import BytesIO as StringIO
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __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, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "cycloudpickle/cycloudpickle.pyx":71
 * 
 * if PY3:
 *     types.ClassType = type             # <<<<<<<<<<<<<<
 *     from io import BytesIO as StringIO
 *     # to allow compilation on Python 2.6
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_ClassType, ((PyObject *)(&PyType_Type))) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":72
 * if PY3:
 *     types.ClassType = type
 *     from io import BytesIO as StringIO             # <<<<<<<<<<<<<<
 *     # to allow compilation on Python 2.6
 *     from builtins import memoryview
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_BytesIO);
    __Pyx_GIVEREF(__pyx_n_s_BytesIO);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BytesIO);
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_io, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __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_BytesIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_StringIO, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":74
 *     from io import BytesIO as StringIO
 *     # to allow compilation on Python 2.6
 *     from builtins import memoryview             # <<<<<<<<<<<<<<
 * else:
 *     try:
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_memoryview);
    __Pyx_GIVEREF(__pyx_n_s_memoryview);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_memoryview);
    __pyx_t_2 = __Pyx_Import(__pyx_n_s_builtins_2, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __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_memoryview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_memoryview, __pyx_t_1) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":70
 * PY3 = PY_MAJOR_VERSION > 2
 * 
 * if PY3:             # <<<<<<<<<<<<<<
 *     types.ClassType = type
 *     from io import BytesIO as StringIO
 */
    goto __pyx_L2;
  }

  /* "cycloudpickle/cycloudpickle.pyx":76
 *     from builtins import memoryview
 * else:
 *     try:             # <<<<<<<<<<<<<<
 *         from cStringIO import StringIO
 *     except ImportError:
 */
  /*else*/ {
    {
      __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:*/ {

        /* "cycloudpickle/cycloudpickle.pyx":77
 * else:
 *     try:
 *         from cStringIO import StringIO             # <<<<<<<<<<<<<<
 *     except ImportError:
 *         from StringIO import StringIO
 */
        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_n_s_StringIO);
        __Pyx_GIVEREF(__pyx_n_s_StringIO);
        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_StringIO);
        __pyx_t_1 = __Pyx_Import(__pyx_n_s_cStringIO, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L3_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_StringIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (PyDict_SetItem(__pyx_d, __pyx_n_s_StringIO, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":76
 *     from builtins import memoryview
 * else:
 *     try:             # <<<<<<<<<<<<<<
 *         from cStringIO import StringIO
 *     except ImportError:
 */
      }
      __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_L10_try_end;
      __pyx_L3_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":78
 *     try:
 *         from cStringIO import StringIO
 *     except ImportError:             # <<<<<<<<<<<<<<
 *         from StringIO import StringIO
 *     # to allow compilation on Python 3
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("cycloudpickle.cycloudpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 78, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_8);

        /* "cycloudpickle/cycloudpickle.pyx":79
 *         from cStringIO import StringIO
 *     except ImportError:
 *         from StringIO import StringIO             # <<<<<<<<<<<<<<
 *     # to allow compilation on Python 3
 *     from builtins import file, buffer
 */
        __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 79, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_n_s_StringIO);
        __Pyx_GIVEREF(__pyx_n_s_StringIO);
        PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_StringIO);
        __pyx_t_10 = __Pyx_Import(__pyx_n_s_StringIO, __pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_ImportFrom(__pyx_t_10, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 79, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_d, __pyx_n_s_StringIO, __pyx_t_9) < 0) __PYX_ERR(0, 79, __pyx_L5_except_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L4_exception_handled;
      }
      goto __pyx_L5_except_error;
      __pyx_L5_except_error:;

      /* "cycloudpickle/cycloudpickle.pyx":76
 *     from builtins import memoryview
 * else:
 *     try:             # <<<<<<<<<<<<<<
 *         from cStringIO import StringIO
 *     except ImportError:
 */
      __Pyx_PyThreadState_assign
      __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_PyThreadState_assign
      __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_L10_try_end:;
    }

    /* "cycloudpickle/cycloudpickle.pyx":81
 *         from StringIO import StringIO
 *     # to allow compilation on Python 3
 *     from builtins import file, buffer             # <<<<<<<<<<<<<<
 * 
 * # relevant opcodes
 */
    __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_n_s_file);
    __Pyx_GIVEREF(__pyx_n_s_file);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_file);
    __Pyx_INCREF(__pyx_n_s_buffer);
    __Pyx_GIVEREF(__pyx_n_s_buffer);
    PyList_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_buffer);
    __pyx_t_2 = __Pyx_Import(__pyx_n_s_builtins_2, __pyx_t_8, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_file); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_file, __pyx_t_8) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_buffer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_buffer, __pyx_t_8) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L2:;

  /* "cycloudpickle/cycloudpickle.pyx":84
 * 
 * # relevant opcodes
 * STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')             # <<<<<<<<<<<<<<
 * DELETE_GLOBAL = dis.opname.index('DELETE_GLOBAL')
 * LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dis); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_opname); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STORE_GLOBAL, __pyx_t_8) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":85
 * # relevant opcodes
 * STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')
 * DELETE_GLOBAL = dis.opname.index('DELETE_GLOBAL')             # <<<<<<<<<<<<<<
 * LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')
 * GLOBAL_OPS = [STORE_GLOBAL, DELETE_GLOBAL, LOAD_GLOBAL]
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_dis); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_opname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_GLOBAL, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":86
 * STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')
 * DELETE_GLOBAL = dis.opname.index('DELETE_GLOBAL')
 * LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')             # <<<<<<<<<<<<<<
 * GLOBAL_OPS = [STORE_GLOBAL, DELETE_GLOBAL, LOAD_GLOBAL]
 * HAVE_ARGUMENT = dis.HAVE_ARGUMENT
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dis); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_opname); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LOAD_GLOBAL, __pyx_t_8) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":87
 * DELETE_GLOBAL = dis.opname.index('DELETE_GLOBAL')
 * LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')
 * GLOBAL_OPS = [STORE_GLOBAL, DELETE_GLOBAL, LOAD_GLOBAL]             # <<<<<<<<<<<<<<
 * HAVE_ARGUMENT = dis.HAVE_ARGUMENT
 * EXTENDED_ARG = dis.EXTENDED_ARG
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_STORE_GLOBAL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DELETE_GLOBAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LOAD_GLOBAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = PyList_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_8);
  PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
  __pyx_t_8 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GLOBAL_OPS, __pyx_t_10) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":88
 * LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')
 * GLOBAL_OPS = [STORE_GLOBAL, DELETE_GLOBAL, LOAD_GLOBAL]
 * HAVE_ARGUMENT = dis.HAVE_ARGUMENT             # <<<<<<<<<<<<<<
 * EXTENDED_ARG = dis.EXTENDED_ARG
 * 
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_dis); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_HAVE_ARGUMENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HAVE_ARGUMENT, __pyx_t_1) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":89
 * GLOBAL_OPS = [STORE_GLOBAL, DELETE_GLOBAL, LOAD_GLOBAL]
 * HAVE_ARGUMENT = dis.HAVE_ARGUMENT
 * EXTENDED_ARG = dis.EXTENDED_ARG             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_EXTENDED_ARG); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTENDED_ARG, __pyx_t_10) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":96
 * 
 * 
 * _BUILTIN_TYPE_NAMES = {}             # <<<<<<<<<<<<<<
 * for k, v in types.__dict__.items():
 *     if type(v) is type:
 */
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BUILTIN_TYPE_NAMES, __pyx_t_10) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":97
 * 
 * _BUILTIN_TYPE_NAMES = {}
 * for k, v in types.__dict__.items():             # <<<<<<<<<<<<<<
 *     if type(v) is type:
 *         _BUILTIN_TYPE_NAMES[v] = k
 */
  __pyx_t_11 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
    __PYX_ERR(0, 97, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_n_s_items, (&__pyx_t_12), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XDECREF(__pyx_t_10);
  __pyx_t_10 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_12, &__pyx_t_11, &__pyx_t_1, &__pyx_t_2, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_13 == 0)) break;
    if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_k, __pyx_t_1) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_v, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":98
 * _BUILTIN_TYPE_NAMES = {}
 * for k, v in types.__dict__.items():
 *     if type(v) is type:             # <<<<<<<<<<<<<<
 *         _BUILTIN_TYPE_NAMES[v] = k
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_t_2)) == ((PyObject *)(&PyType_Type)));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = (__pyx_t_3 != 0);
    if (__pyx_t_14) {

      /* "cycloudpickle/cycloudpickle.pyx":99
 * for k, v in types.__dict__.items():
 *     if type(v) is type:
 *         _BUILTIN_TYPE_NAMES[v] = k             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BUILTIN_TYPE_NAMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_8, __pyx_t_2) < 0)) __PYX_ERR(0, 99, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":98
 * _BUILTIN_TYPE_NAMES = {}
 * for k, v in types.__dict__.items():
 *     if type(v) is type:             # <<<<<<<<<<<<<<
 *         _BUILTIN_TYPE_NAMES[v] = k
 * 
 */
    }
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":102
 * 
 * 
 * def _builtin_type(name):             # <<<<<<<<<<<<<<
 *     return getattr(types, name)
 * 
 */
  __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_1_builtin_type, NULL, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtin_type, __pyx_t_10) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":106
 * 
 * 
 * if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *     def _walk_global_ops(code):
 *         """
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__33, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_14) {

    /* "cycloudpickle/cycloudpickle.pyx":107
 * 
 * if sys.version_info < (3, 4):
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */
    __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_3_walk_global_ops, NULL, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_walk_global_ops, __pyx_t_10) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":106
 * 
 * 
 * if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *     def _walk_global_ops(code):
 *         """
 */
    goto __pyx_L16;
  }

  /* "cycloudpickle/cycloudpickle.pyx":132
 * 
 * else:
 *     def _walk_global_ops(code):             # <<<<<<<<<<<<<<
 *         """
 *         Yield (opcode, argument number) tuples for all
 */
  /*else*/ {
    __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_6_walk_global_ops, NULL, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_walk_global_ops, __pyx_t_10) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_L16:;

  /* "cycloudpickle/cycloudpickle.pyx":145
 * _extract_code_globals_cache = (
 *     weakref.WeakKeyDictionary()
 *     if sys.version_info >= (2, 7) and not hasattr(sys, "pypy_version_info")             # <<<<<<<<<<<<<<
 *     else {})
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_tuple__38, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_14 = __pyx_t_3;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_HasAttr(__pyx_t_2, __pyx_n_u_pypy_version_info); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_15 = ((!(__pyx_t_3 != 0)) != 0);
  __pyx_t_14 = __pyx_t_15;
  __pyx_L17_bool_binop_done:;
  if (__pyx_t_14) {

    /* "cycloudpickle/cycloudpickle.pyx":144
 * 
 * _extract_code_globals_cache = (
 *     weakref.WeakKeyDictionary()             # <<<<<<<<<<<<<<
 *     if sys.version_info >= (2, 7) and not hasattr(sys, "pypy_version_info")
 *     else {})
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_weakref_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_WeakKeyDictionary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && 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);
      }
    }
    if (__pyx_t_8) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {

    /* "cycloudpickle/cycloudpickle.pyx":146
 *     weakref.WeakKeyDictionary()
 *     if sys.version_info >= (2, 7) and not hasattr(sys, "pypy_version_info")
 *     else {})             # <<<<<<<<<<<<<<
 * 
 * def extract_code_globals(co):
 */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_code_globals_cache, __pyx_t_10) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":148
 *     else {})
 * 
 * def extract_code_globals(co):             # <<<<<<<<<<<<<<
 *     """
 *     Find all globals names read or written to by codeblock co
 */
  __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_9extract_code_globals, NULL, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_code_globals, __pyx_t_10) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":178
 *     cdef object globals_ref
 * 
 *     dispatch = Pickler.dispatch.copy()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, file, protocol=None):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_13cycloudpickle_8cypickle_Pickler), __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(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);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler->tp_dict, __pyx_n_s_dispatch, __pyx_t_10) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler);

  /* "cycloudpickle/cycloudpickle.pyx":203
 *         """Fallback to save_string"""
 *         Pickler.save_string(self,str(obj))
 *     if PY3:             # <<<<<<<<<<<<<<
 *         dispatch[memoryview] = save_memoryview
 *     else:
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_14) {

    /* "cycloudpickle/cycloudpickle.pyx":204
 *         Pickler.save_string(self,str(obj))
 *     if PY3:
 *         dispatch[memoryview] = save_memoryview             # <<<<<<<<<<<<<<
 *     else:
 *         dispatch[buffer] = save_buffer
 */
    __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_memoryview); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_memoryview); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_10) < 0)) __PYX_ERR(0, 204, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":203
 *         """Fallback to save_string"""
 *         Pickler.save_string(self,str(obj))
 *     if PY3:             # <<<<<<<<<<<<<<
 *         dispatch[memoryview] = save_memoryview
 *     else:
 */
    goto __pyx_L19;
  }

  /* "cycloudpickle/cycloudpickle.pyx":206
 *         dispatch[memoryview] = save_memoryview
 *     else:
 *         dispatch[buffer] = save_buffer             # <<<<<<<<<<<<<<
 * 
 *     def save_unsupported(self, obj):
 */
  /*else*/ {
    __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_buffer); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_10) < 0)) __PYX_ERR(0, 206, __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_10); __pyx_t_10 = 0;
  }
  __pyx_L19:;

  /* "cycloudpickle/cycloudpickle.pyx":210
 *     def save_unsupported(self, obj):
 *         raise pickle.PicklingError("Cannot pickle objects of type %s" % type(obj))
 *     dispatch[types.GeneratorType] = save_unsupported             # <<<<<<<<<<<<<<
 * 
 *     # itertools objects do not pickle!
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_unsupported); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GeneratorType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_8, __pyx_t_10) < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":213
 * 
 *     # itertools objects do not pickle!
 *     for v in itertools.__dict__.values():             # <<<<<<<<<<<<<<
 *         if type(v) is type:
 *             dispatch[v] = save_unsupported
 */
  __pyx_t_12 = 0;
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_itertools); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "values");
    __PYX_ERR(0, 213, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_values, (&__pyx_t_11), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XDECREF(__pyx_t_10);
  __pyx_t_10 = __pyx_t_8;
  __pyx_t_8 = 0;
  while (1) {
    __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_11, &__pyx_t_12, NULL, &__pyx_t_8, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_13 == 0)) break;
    if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler->tp_dict, __pyx_n_s_v, __pyx_t_8) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    PyType_Modified(__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler);

    /* "cycloudpickle/cycloudpickle.pyx":214
 *     # itertools objects do not pickle!
 *     for v in itertools.__dict__.values():
 *         if type(v) is type:             # <<<<<<<<<<<<<<
 *             dispatch[v] = save_unsupported
 * 
 */
    __pyx_t_8 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_14 = (((PyObject *)Py_TYPE(__pyx_t_8)) == ((PyObject *)(&PyType_Type)));
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15 = (__pyx_t_14 != 0);
    if (__pyx_t_15) {

      /* "cycloudpickle/cycloudpickle.pyx":215
 *     for v in itertools.__dict__.values():
 *         if type(v) is type:
 *             dispatch[v] = save_unsupported             # <<<<<<<<<<<<<<
 * 
 *     def save_module(self, obj):
 */
      __pyx_t_8 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_unsupported); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_8) < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":214
 *     # itertools objects do not pickle!
 *     for v in itertools.__dict__.values():
 *         if type(v) is type:             # <<<<<<<<<<<<<<
 *             dispatch[v] = save_unsupported
 * 
 */
    }
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":238
 *         else:
 *             self.save_reduce(subimport, (obj.__name__,), obj=obj)
 *     dispatch[types.ModuleType] = save_module             # <<<<<<<<<<<<<<
 * 
 *     def save_codeobject(self, obj):
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_module); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ModuleType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_t_1, __pyx_t_10) < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":258
 *             )
 *         self.save_reduce(types.CodeType, args, obj=obj)
 *     dispatch[types.CodeType] = save_codeobject             # <<<<<<<<<<<<<<
 * 
 *     def save_function(self, obj, str name=None):
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_codeobject); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CodeType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_10) < 0)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":334
 *             write(pickle.GLOBAL + modname + '\n' + name + '\n')
 *             self.memoize(obj)
 *     dispatch[types.FunctionType] = save_function             # <<<<<<<<<<<<<<
 * 
 *     def save_function_tuple(self, func):
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_function); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_FunctionType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_8, __pyx_t_10) < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":408
 *             return self.save_global(obj)
 *         return self.save_function(obj)
 *     dispatch[types.BuiltinFunctionType] = save_builtin_function             # <<<<<<<<<<<<<<
 * 
 *     def save_global(self, obj, str name=None, pack=struct.pack):
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_builtin_function); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_BuiltinFunctionType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_t_1, __pyx_t_10) < 0)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":410
 *     dispatch[types.BuiltinFunctionType] = save_builtin_function
 * 
 *     def save_global(self, obj, str name=None, pack=struct.pack):             # <<<<<<<<<<<<<<
 *         cdef str modname = getattr(obj, "__module__", None)
 *         if modname == "__builtin__" or modname == "builtins":
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_k__5 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":454
 *             raise pickle.PicklingError("Can't pickle %r" % obj)
 * 
 *     dispatch[type] = save_global             # <<<<<<<<<<<<<<
 *     dispatch[types.ClassType] = save_global
 * 
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_global); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (unlikely(PyObject_SetItem(__pyx_t_10, ((PyObject *)(&PyType_Type)), __pyx_t_1) < 0)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":455
 * 
 *     dispatch[type] = save_global
 *     dispatch[types.ClassType] = save_global             # <<<<<<<<<<<<<<
 * 
 *     def save_instancemethod(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_global); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ClassType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":467
 *                 self.save_reduce(types.MethodType, (obj.__func__, obj.__self__, obj.__self__.__class__),
 *                          obj=obj)
 *     dispatch[types.MethodType] = save_instancemethod             # <<<<<<<<<<<<<<
 * 
 *     def save_inst(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_instancemethod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_MethodType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_8, __pyx_t_1) < 0)) __PYX_ERR(0, 467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":517
 *         write(pickle.BUILD)
 * 
 *     if not PY3:             # <<<<<<<<<<<<<<
 *         dispatch[types.InstanceType] = save_inst
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = ((!__pyx_t_15) != 0);
  if (__pyx_t_14) {

    /* "cycloudpickle/cycloudpickle.pyx":518
 * 
 *     if not PY3:
 *         dispatch[types.InstanceType] = save_inst             # <<<<<<<<<<<<<<
 * 
 *     def save_property(self, obj):
 */
    __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_inst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InstanceType); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_t_10, __pyx_t_1) < 0)) __PYX_ERR(0, 518, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":517
 *         write(pickle.BUILD)
 * 
 *     if not PY3:             # <<<<<<<<<<<<<<
 *         dispatch[types.InstanceType] = save_inst
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":523
 *         # properties not correctly saved in python
 *         self.save_reduce(property, (obj.fget, obj.fset, obj.fdel, obj.__doc__), obj=obj)
 *     dispatch[property] = save_property             # <<<<<<<<<<<<<<
 * 
 *     def save_classmethod(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_property); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_builtin_property, __pyx_t_1) < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":533
 *                 orig_func = orig_func.__func__  # Unbind
 *         self.save_reduce(type(obj), (orig_func,), obj=obj)
 *     dispatch[builtins.classmethod] = save_classmethod             # <<<<<<<<<<<<<<
 *     dispatch[builtins.staticmethod] = save_classmethod
 * 
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_classmethod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_builtins_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_classmethod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":534
 *         self.save_reduce(type(obj), (orig_func,), obj=obj)
 *     dispatch[builtins.classmethod] = save_classmethod
 *     dispatch[builtins.staticmethod] = save_classmethod             # <<<<<<<<<<<<<<
 * 
 *     def save_itemgetter(self, obj):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_classmethod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_builtins_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_staticmethod); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_8, __pyx_t_1) < 0)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":546
 *         return self.save_reduce(operator.itemgetter, items)
 * 
 *     if type(operator.itemgetter) is type:             # <<<<<<<<<<<<<<
 *         dispatch[operator.itemgetter] = save_itemgetter
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = (((PyObject *)Py_TYPE(__pyx_t_8)) == ((PyObject *)(&PyType_Type)));
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_15 = (__pyx_t_14 != 0);
  if (__pyx_t_15) {

    /* "cycloudpickle/cycloudpickle.pyx":547
 * 
 *     if type(operator.itemgetter) is type:
 *         dispatch[operator.itemgetter] = save_itemgetter             # <<<<<<<<<<<<<<
 * 
 *     def save_attrgetter(self, obj):
 */
    __pyx_t_8 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_itemgetter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_10, __pyx_t_8) < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":546
 *         return self.save_reduce(operator.itemgetter, items)
 * 
 *     if type(operator.itemgetter) is type:             # <<<<<<<<<<<<<<
 *         dispatch[operator.itemgetter] = save_itemgetter
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":568
 *         return self.save_reduce(operator.attrgetter, tuple(attrs))
 * 
 *     if type(operator.attrgetter) is type:             # <<<<<<<<<<<<<<
 *         dispatch[operator.attrgetter] = save_attrgetter
 * 
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_15 = (((PyObject *)Py_TYPE(__pyx_t_10)) == ((PyObject *)(&PyType_Type)));
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_14 = (__pyx_t_15 != 0);
  if (__pyx_t_14) {

    /* "cycloudpickle/cycloudpickle.pyx":569
 * 
 *     if type(operator.attrgetter) is type:
 *         dispatch[operator.attrgetter] = save_attrgetter             # <<<<<<<<<<<<<<
 * 
 *     def save_reduce(self, func, args, state=None,
 */
    __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_attrgetter); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_t_2, __pyx_t_10) < 0)) __PYX_ERR(0, 569, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":568
 *         return self.save_reduce(operator.attrgetter, tuple(attrs))
 * 
 *     if type(operator.attrgetter) is type:             # <<<<<<<<<<<<<<
 *         dispatch[operator.attrgetter] = save_attrgetter
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":637
 *         self.save_reduce(_genpartial, (obj.func, obj.args, obj.keywords))
 * 
 *     if sys.version_info < (2,7):  # 2.7 supports partial pickling             # <<<<<<<<<<<<<<
 *         dispatch[partial] = save_partial
 * 
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__41, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_14) {

    /* "cycloudpickle/cycloudpickle.pyx":638
 * 
 *     if sys.version_info < (2,7):  # 2.7 supports partial pickling
 *         dispatch[partial] = save_partial             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_partial); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_partial); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_8, __pyx_t_10) < 0)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":637
 *         self.save_reduce(_genpartial, (obj.func, obj.args, obj.keywords))
 * 
 *     if sys.version_info < (2,7):  # 2.7 supports partial pickling             # <<<<<<<<<<<<<<
 *         dispatch[partial] = save_partial
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":684
 *         self.memoize(obj)
 * 
 *     dispatch[io.BufferedRandom] = save_file             # <<<<<<<<<<<<<<
 *     dispatch[io.TextIOWrapper] = save_file
 *     if not PY3:
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_file); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_BufferedRandom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_t_1, __pyx_t_10) < 0)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":685
 * 
 *     dispatch[io.BufferedRandom] = save_file
 *     dispatch[io.TextIOWrapper] = save_file             # <<<<<<<<<<<<<<
 *     if not PY3:
 *         dispatch[file] = save_file
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_file); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_io); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_TextIOWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_10) < 0)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":686
 *     dispatch[io.BufferedRandom] = save_file
 *     dispatch[io.TextIOWrapper] = save_file
 *     if not PY3:             # <<<<<<<<<<<<<<
 *         dispatch[file] = save_file
 * 
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_PY3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_15 = ((!__pyx_t_14) != 0);
  if (__pyx_t_15) {

    /* "cycloudpickle/cycloudpickle.pyx":687
 *     dispatch[io.TextIOWrapper] = save_file
 *     if not PY3:
 *         dispatch[file] = save_file             # <<<<<<<<<<<<<<
 * 
 *     def save_ellipsis(self, obj):
 */
    __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_file); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_10) < 0)) __PYX_ERR(0, 687, __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_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":686
 *     dispatch[io.BufferedRandom] = save_file
 *     dispatch[io.TextIOWrapper] = save_file
 *     if not PY3:             # <<<<<<<<<<<<<<
 *         dispatch[file] = save_file
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":695
 *         self.save_reduce(_gen_not_implemented, ())
 * 
 *     dispatch[type(Ellipsis)] = save_ellipsis             # <<<<<<<<<<<<<<
 *     dispatch[type(NotImplemented)] = save_not_implemented
 * 
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_ellipsis); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, ((PyObject *)Py_TYPE(__pyx_builtin_Ellipsis)), __pyx_t_10) < 0)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":696
 * 
 *     dispatch[type(Ellipsis)] = save_ellipsis
 *     dispatch[type(NotImplemented)] = save_not_implemented             # <<<<<<<<<<<<<<
 * 
 *     """Special functions for Add-on libraries"""
 */
  __pyx_t_10 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_save_not_implemented); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13cycloudpickle_13cycloudpickle_CloudPickler, __pyx_n_s_dispatch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, ((PyObject *)Py_TYPE(__pyx_builtin_NotImplemented)), __pyx_t_10) < 0)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":706
 * # Tornado support
 * 
 * def is_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *     """
 *     Return whether *func* is a Tornado coroutine function.
 */
  __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_11is_tornado_coroutine, NULL, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_tornado_coroutine, __pyx_t_10) < 0) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":719
 *     return gen.is_coroutine_function(func)
 * 
 * def _rebuild_tornado_coroutine(func):             # <<<<<<<<<<<<<<
 *     from tornado import gen
 *     return gen.coroutine(func)
 */
  __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_13_rebuild_tornado_coroutine, NULL, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rebuild_tornado_coroutine, __pyx_t_10) < 0) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":739
 * 
 * # including pickles unloading functions in this namespace
 * load = pickle.load             # <<<<<<<<<<<<<<
 * loads = pickle.loads
 * 
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_load); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_1) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":740
 * # including pickles unloading functions in this namespace
 * load = pickle.load
 * loads = pickle.loads             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pickle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loads); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_loads, __pyx_t_10) < 0) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "cycloudpickle/cycloudpickle.pyx":761
 * """ Use copy_reg to extend global pickle definitions """
 * 
 * if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *     method_descriptor = type(str.upper)
 * 
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__46, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_15) {

    /* "cycloudpickle/cycloudpickle.pyx":762
 * 
 * if sys.version_info < (3, 4):
 *     method_descriptor = type(str.upper)             # <<<<<<<<<<<<<<
 * 
 *     def _reduce_method_descriptor(obj):
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_n_s_upper); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_method_descriptor, ((PyObject *)Py_TYPE(__pyx_t_10))) < 0) __PYX_ERR(0, 762, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":764
 *     method_descriptor = type(str.upper)
 * 
 *     def _reduce_method_descriptor(obj):             # <<<<<<<<<<<<<<
 *         return (getattr, (obj.__objclass__, obj.__name__))
 * 
 */
    __pyx_t_10 = PyCFunction_NewEx(&__pyx_mdef_13cycloudpickle_13cycloudpickle_19_reduce_method_descriptor, NULL, __pyx_n_s_cycloudpickle_cycloudpickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_method_descriptor, __pyx_t_10) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":767
 *         return (getattr, (obj.__objclass__, obj.__name__))
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import copy_reg as copyreg
 *     except ImportError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "cycloudpickle/cycloudpickle.pyx":768
 * 
 *     try:
 *         import copy_reg as copyreg             # <<<<<<<<<<<<<<
 *     except ImportError:
 *         import copyreg
 */
        __pyx_t_10 = __Pyx_Import(__pyx_n_s_copy_reg, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 768, __pyx_L29_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyreg, __pyx_t_10) < 0) __PYX_ERR(0, 768, __pyx_L29_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "cycloudpickle/cycloudpickle.pyx":767
 *         return (getattr, (obj.__objclass__, obj.__name__))
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import copy_reg as copyreg
 *     except ImportError:
 */
      }
      __Pyx_XDECREF(__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;
      goto __pyx_L36_try_end;
      __pyx_L29_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cycloudpickle/cycloudpickle.pyx":769
 *     try:
 *         import copy_reg as copyreg
 *     except ImportError:             # <<<<<<<<<<<<<<
 *         import copyreg
 *     copyreg.pickle(method_descriptor, _reduce_method_descriptor)
 */
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("cycloudpickle.cycloudpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 769, __pyx_L31_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);

        /* "cycloudpickle/cycloudpickle.pyx":770
 *         import copy_reg as copyreg
 *     except ImportError:
 *         import copyreg             # <<<<<<<<<<<<<<
 *     copyreg.pickle(method_descriptor, _reduce_method_descriptor)
 */
        __pyx_t_8 = __Pyx_Import(__pyx_n_s_copyreg, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 770, __pyx_L31_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyreg, __pyx_t_8) < 0) __PYX_ERR(0, 770, __pyx_L31_except_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L30_exception_handled;
      }
      goto __pyx_L31_except_error;
      __pyx_L31_except_error:;

      /* "cycloudpickle/cycloudpickle.pyx":767
 *         return (getattr, (obj.__objclass__, obj.__name__))
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         import copy_reg as copyreg
 *     except ImportError:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L30_exception_handled:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      __pyx_L36_try_end:;
    }

    /* "cycloudpickle/cycloudpickle.pyx":771
 *     except ImportError:
 *         import copyreg
 *     copyreg.pickle(method_descriptor, _reduce_method_descriptor)             # <<<<<<<<<<<<<<
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_copyreg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pickle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_method_descriptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_reduce_method_descriptor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_11 = 1;
      }
    }
    __pyx_t_16 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_11, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_11, __pyx_t_8);
    __pyx_t_1 = 0;
    __pyx_t_8 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cycloudpickle/cycloudpickle.pyx":761
 * """ Use copy_reg to extend global pickle definitions """
 * 
 * if sys.version_info < (3, 4):             # <<<<<<<<<<<<<<
 *     method_descriptor = type(str.upper)
 * 
 */
  }

  /* "cycloudpickle/cycloudpickle.pyx":1
 * """             # <<<<<<<<<<<<<<
 * This file is an adaptation of cloudpickle to use Cython.
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_16);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init cycloudpickle.cycloudpickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cycloudpickle.cycloudpickle");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #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((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#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;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#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);
}

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* GetAttr3 */
  static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

/* 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

/* PyIntBinop */
  #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #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 && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        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;
                    } 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;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                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;
                    } 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;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #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

/* 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

/* 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) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    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

/* 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_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || 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;
}

/* SaveResetException */
    #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    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;
    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;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
    #if CYTHON_COMPILING_IN_CPYTHON
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;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
    #if CYTHON_COMPILING_IN_CPYTHON
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_COMPILING_IN_CPYTHON
    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_COMPILING_IN_CPYTHON
    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_COMPILING_IN_CPYTHON
    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;
    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;
}

/* 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;
}

/* 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);
}

/* PyObjectCallNoArg */
      #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#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

/* GetItemInt */
        static CYTHON_INLINE 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_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, 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_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, 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_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (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((n >= 0) & (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));
}

/* PyErrFetchRestore */
        #if CYTHON_COMPILING_IN_CPYTHON
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

/* 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 PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        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 = PyThreadState_GET();
        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

/* SwapException */
          #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    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;
    *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

/* ArgTypeTest */
          static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

/* 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 = 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;
        }
        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_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
}

/* None */
          static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* 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);
#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);
    } else {
        if (default_value == Py_None)
            default_value = NULL;
        value = PyObject_CallMethodObjArgs(
            d, __pyx_n_s_get, key, default_value, NULL);
    }
#endif
    return value;
}

/* 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 */
          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)
{
    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)
{
    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)
{
    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)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    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)
{
    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)
{
    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)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    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_COMPILING_IN_CPYTHON
    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) {
    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) {
    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) {
    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) {
    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) {
    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) {
    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(__pyx_CyFunctionObject, func.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)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(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
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    PyObject *self = f->m_self;
    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)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 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                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;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
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_Call,
    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
};
static int __pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__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 (!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);
}

/* 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;
}

/* PyObjectCallMethod1 */
              static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            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);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

/* 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;
}

/* 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_COMPILING_IN_CPYTHON
    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_COMPILING_IN_CPYTHON
        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;
}

/* 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_VERSION_HEX < 0x03030000
    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, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    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;
}

/* CallNextTpDealloc */
              static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_dealloc != current_tp_dealloc)
        type = type->tp_base;
    while (type && type->tp_dealloc == current_tp_dealloc)
        type = type->tp_base;
    if (type)
        type->tp_dealloc(obj);
}

/* CallNextTpTraverse */
              static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

/* CallNextTpClear */
              static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

/* PyObjectCallMethod0 */
              static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    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(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        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);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#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);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *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 !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#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;
}

/* GetNameInClass */
              static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result)
        result = __Pyx_GetModuleGlobalName(name);
    return result;
}

/* 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;
    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(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (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);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
              static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* UnicodeAsUCS4 */
              static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
   Py_ssize_t length;
   #if CYTHON_PEP393_ENABLED
   length = PyUnicode_GET_LENGTH(x);
   if (likely(length == 1)) {
       return PyUnicode_READ_CHAR(x, 0);
   }
   #else
   length = PyUnicode_GET_SIZE(x);
   if (likely(length == 1)) {
       return PyUnicode_AS_UNICODE(x)[0];
   }
   #if Py_UNICODE_SIZE == 2
   else if (PyUnicode_GET_SIZE(x) == 2) {
       Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
       if (high_val >= 0xD800 && high_val <= 0xDBFF) {
           Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
           if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
               return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
           }
       }
   }
   #endif
   #endif
   PyErr_Format(PyExc_ValueError,
                "only single character unicode strings can be converted to Py_UCS4, "
                "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
   return (Py_UCS4)-1;
}

/* object_ord */
              static long __Pyx__PyObject_Ord(PyObject* c) {
    Py_ssize_t size;
    if (PyBytes_Check(c)) {
        size = PyBytes_GET_SIZE(c);
        if (likely(size == 1)) {
            return (unsigned char) PyBytes_AS_STRING(c)[0];
        }
#if PY_MAJOR_VERSION < 3
    } else if (PyUnicode_Check(c)) {
        return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    } else if (PyByteArray_Check(c)) {
        size = PyByteArray_GET_SIZE(c);
        if (likely(size == 1)) {
            return (unsigned char) PyByteArray_AS_STRING(c)[0];
        }
#endif
    } else {
        PyErr_Format(PyExc_TypeError,
            "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name);
        return (long)(Py_UCS4)-1;
    }
    PyErr_Format(PyExc_TypeError,
        "ord() expected a character, but string of length %zd found", size);
    return (long)(Py_UCS4)-1;
}

/* 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) -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))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } 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))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#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) -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))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } 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))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#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;
}

/* CoroutineBase */
              #include <structmember.h>
#include <frameobject.h>
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);
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __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 PY_VERSION_HEX >= 0x030300A0
        if (ev && Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
#endif
        if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            } else if (PyTuple_Check(ev)) {
                if (PyTuple_GET_SIZE(ev) >= 1) {
                    PyObject *value;
#if CYTHON_COMPILING_IN_CPYTHON
                    value = PySequence_ITEM(ev, 0);
#else
                    value = PyTuple_GET_ITEM(ev, 0);
                    Py_INCREF(value);
#endif
                    Py_DECREF(ev);
                    ev = value;
                } else {
                    Py_INCREF(Py_None);
                    Py_DECREF(ev);
                    ev = Py_None;
                }
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    } else if (!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;
}
#endif
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
    PyObject *retval;
    __Pyx_PyThreadState_declare
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    __Pyx_PyThreadState_assign
    if (value) {
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(__pyx_tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = __pyx_tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
    if (unlikely(!retval && !PyErr_Occurred())) {
        PyErr_SetNone(PyExc_StopIteration);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Coroutine_SendEx(gen, val);
    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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    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_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, 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);
    }
    return __Pyx_Coroutine_MethodReturn(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_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } 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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        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);
}
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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    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);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
            goto throw_here;
        }
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        {
            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;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
}
static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
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);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    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
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Coroutine_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    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)
{
    Py_INCREF(self->gi_name);
    return self->gi_name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    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)
{
    Py_INCREF(self->gi_qualname);
    return self->gi_qualname;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    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 *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    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;
    PyObject_GC_Track(gen);
    return gen;
}

/* 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 */
                  #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 (!abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_VERSION_HEX >= 0x03030000) ?
                        "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;
}

/* 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, 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")},
    {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 PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Coroutine_del,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* 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;
}

/* ModuleImport */
                  #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

/* TypeImport */
                  #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

/* 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;
        ++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 char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__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)) {
#if PY_VERSION_HEX < 0x03030000
        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
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (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
    } 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 PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  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(x);
  }
#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_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
