/* Generated by Cython 0.21dev on Wed Jul  2 18:40:08 2014 */

#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#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_21dev"
#include <stddef.h> /* For offsetof */
#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 CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_PyIndex_Check PyIndex_Check
#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
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(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)
#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]))
#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
#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
  #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_CheckExact(obj) || PyUnicode_CheckExact(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_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 PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
#define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif
#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
#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
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~T();
}
#endif


#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_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__cytoolz__itertoolz
#define __PYX_HAVE_API__cytoolz__itertoolz
#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
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/

#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_fits_Py_ssize_t(v, type, is_signed)  (    \
    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
    (sizeof(type) > sizeof(Py_ssize_t) &&               \
          likely(v < (type)PY_SSIZE_T_MAX ||            \
                 v == (type)PY_SSIZE_T_MAX)  &&         \
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
                                v == (type)PY_SSIZE_T_MIN)))  ||  \
    (sizeof(type) == sizeof(Py_ssize_t) &&              \
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE 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_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromUString(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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(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 && __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*) (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;
    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 int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "itertoolz.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_7cytoolz_9itertoolz_remove;
struct __pyx_obj_7cytoolz_9itertoolz_accumulate;
struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted;
struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key;
struct __pyx_obj_7cytoolz_9itertoolz_interleave;
struct __pyx_obj_7cytoolz_9itertoolz__unique_key;
struct __pyx_obj_7cytoolz_9itertoolz__unique_identity;
struct __pyx_obj_7cytoolz_9itertoolz_interpose;
struct __pyx_obj_7cytoolz_9itertoolz_iterate;
struct __pyx_obj_7cytoolz_9itertoolz_sliding_window;
struct __pyx_obj_7cytoolz_9itertoolz_partition_all;
struct __pyx_obj_7cytoolz_9itertoolz__pluck_index;
struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default;
struct __pyx_obj_7cytoolz_9itertoolz__pluck_list;
struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default;
struct __pyx_obj_7cytoolz_9itertoolz__join;
struct __pyx_obj_7cytoolz_9itertoolz__inner_join;
struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join;
struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join;
struct __pyx_obj_7cytoolz_9itertoolz__outer_join;
struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key;
struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index;
struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices;
struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key;
struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index;
struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices;
struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key;
struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index;
struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices;
struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key;
struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index;
struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices;
struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted;
struct __pyx_opt_args_7cytoolz_9itertoolz_unique;
struct __pyx_opt_args_7cytoolz_9itertoolz_get;
struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby;
struct __pyx_opt_args_7cytoolz_9itertoolz_partition;
struct __pyx_opt_args_7cytoolz_9itertoolz_pluck;
struct __pyx_opt_args_7cytoolz_9itertoolz_join;

/* "cytoolz/itertoolz.pxd":26
 * 
 * 
 * cdef object c_merge_sorted(object seqs, object key=*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted {
  int __pyx_n;
  PyObject *key;
};

/* "cytoolz/itertoolz.pxd":48
 * 
 * 
 * cpdef object unique(object seq, object key=*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_7cytoolz_9itertoolz_unique {
  int __pyx_n;
  PyObject *key;
};

/* "cytoolz/itertoolz.pxd":81
 * 
 * 
 * cpdef object get(object ind, object seq, object default=*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_7cytoolz_9itertoolz_get {
  int __pyx_n;
  PyObject *__pyx_default;
};

/* "cytoolz/itertoolz.pxd":100
 * 
 * 
 * cpdef dict reduceby(object key, object binop, object seq, object init=*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby {
  int __pyx_n;
  PyObject *init;
};

/* "cytoolz/itertoolz.pxd":115
 * 
 * 
 * cpdef object partition(Py_ssize_t n, object seq, object pad=*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_7cytoolz_9itertoolz_partition {
  int __pyx_n;
  PyObject *pad;
};

/* "cytoolz/itertoolz.pxd":150
 * 
 * 
 * cpdef object pluck(object ind, object seqs, object default=*)             # <<<<<<<<<<<<<<
 * 
 * cpdef object join(object leftkey, object leftseq,
 */
struct __pyx_opt_args_7cytoolz_9itertoolz_pluck {
  int __pyx_n;
  PyObject *__pyx_default;
};

/* "cytoolz/itertoolz.pxd":152
 * cpdef object pluck(object ind, object seqs, object default=*)
 * 
 * cpdef object join(object leftkey, object leftseq,             # <<<<<<<<<<<<<<
 *                   object rightkey, object rightseq,
 *                   object left_default=*,
 */
struct __pyx_opt_args_7cytoolz_9itertoolz_join {
  int __pyx_n;
  PyObject *left_default;
  PyObject *right_default;
};

/* "cytoolz/itertoolz.pxd":1
 * cdef class remove:             # <<<<<<<<<<<<<<
 *     cdef object predicate
 *     cdef object iter_seq
 */
struct __pyx_obj_7cytoolz_9itertoolz_remove {
  PyObject_HEAD
  PyObject *predicate;
  PyObject *iter_seq;
};


/* "cytoolz/itertoolz.pxd":6
 * 
 * 
 * cdef class accumulate:             # <<<<<<<<<<<<<<
 *     cdef object binop
 *     cdef object iter_seq
 */
struct __pyx_obj_7cytoolz_9itertoolz_accumulate {
  PyObject_HEAD
  PyObject *binop;
  PyObject *iter_seq;
  PyObject *result;
};


/* "cytoolz/itertoolz.pxd":15
 * 
 * 
 * cdef class _merge_sorted:             # <<<<<<<<<<<<<<
 *     cdef list pq
 *     cdef object shortcut
 */
struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted {
  PyObject_HEAD
  PyObject *pq;
  PyObject *shortcut;
};


/* "cytoolz/itertoolz.pxd":20
 * 
 * 
 * cdef class _merge_sorted_key:             # <<<<<<<<<<<<<<
 *     cdef list pq
 *     cdef object key
 */
struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key {
  PyObject_HEAD
  PyObject *pq;
  PyObject *key;
  PyObject *shortcut;
};


/* "cytoolz/itertoolz.pxd":29
 * 
 * 
 * cdef class interleave:             # <<<<<<<<<<<<<<
 *     cdef list iters
 *     cdef list newiters
 */
struct __pyx_obj_7cytoolz_9itertoolz_interleave {
  PyObject_HEAD
  PyObject *iters;
  PyObject *newiters;
  PyObject *pass_exceptions;
  Py_ssize_t i;
  Py_ssize_t n;
};


/* "cytoolz/itertoolz.pxd":37
 * 
 * 
 * cdef class _unique_key:             # <<<<<<<<<<<<<<
 *     cdef object key
 *     cdef object iter_seq
 */
struct __pyx_obj_7cytoolz_9itertoolz__unique_key {
  PyObject_HEAD
  PyObject *key;
  PyObject *iter_seq;
  PyObject *seen;
};


/* "cytoolz/itertoolz.pxd":43
 * 
 * 
 * cdef class _unique_identity:             # <<<<<<<<<<<<<<
 *     cdef object iter_seq
 *     cdef object seen
 */
struct __pyx_obj_7cytoolz_9itertoolz__unique_identity {
  PyObject_HEAD
  PyObject *iter_seq;
  PyObject *seen;
};


/* "cytoolz/itertoolz.pxd":90
 * 
 * 
 * cdef class interpose:             # <<<<<<<<<<<<<<
 *     cdef object el
 *     cdef object iter_seq
 */
struct __pyx_obj_7cytoolz_9itertoolz_interpose {
  PyObject_HEAD
  PyObject *el;
  PyObject *iter_seq;
  PyObject *val;
  int do_el;
};


/* "cytoolz/itertoolz.pxd":103
 * 
 * 
 * cdef class iterate:             # <<<<<<<<<<<<<<
 *     cdef object func
 *     cdef object x
 */
struct __pyx_obj_7cytoolz_9itertoolz_iterate {
  PyObject_HEAD
  PyObject *func;
  PyObject *x;
  PyObject *val;
};


/* "cytoolz/itertoolz.pxd":109
 * 
 * 
 * cdef class sliding_window:             # <<<<<<<<<<<<<<
 *     cdef object iterseq
 *     cdef tuple prev
 */
struct __pyx_obj_7cytoolz_9itertoolz_sliding_window {
  PyObject_HEAD
  PyObject *iterseq;
  PyObject *prev;
  Py_ssize_t n;
};


/* "cytoolz/itertoolz.pxd":118
 * 
 * 
 * cdef class partition_all:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t n
 *     cdef object iterseq
 */
struct __pyx_obj_7cytoolz_9itertoolz_partition_all {
  PyObject_HEAD
  Py_ssize_t n;
  PyObject *iterseq;
};


/* "cytoolz/itertoolz.pxd":126
 * 
 * 
 * cdef class _pluck_index:             # <<<<<<<<<<<<<<
 *     cdef object ind
 *     cdef object iterseqs
 */
struct __pyx_obj_7cytoolz_9itertoolz__pluck_index {
  PyObject_HEAD
  PyObject *ind;
  PyObject *iterseqs;
};


/* "cytoolz/itertoolz.pxd":131
 * 
 * 
 * cdef class _pluck_index_default:             # <<<<<<<<<<<<<<
 *     cdef object ind
 *     cdef object iterseqs
 */
struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default {
  PyObject_HEAD
  PyObject *ind;
  PyObject *iterseqs;
  PyObject *__pyx_default;
};


/* "cytoolz/itertoolz.pxd":137
 * 
 * 
 * cdef class _pluck_list:             # <<<<<<<<<<<<<<
 *     cdef list ind
 *     cdef object iterseqs
 */
struct __pyx_obj_7cytoolz_9itertoolz__pluck_list {
  PyObject_HEAD
  PyObject *ind;
  PyObject *iterseqs;
  Py_ssize_t n;
};


/* "cytoolz/itertoolz.pxd":143
 * 
 * 
 * cdef class _pluck_list_default:             # <<<<<<<<<<<<<<
 *     cdef list ind
 *     cdef object iterseqs
 */
struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default {
  PyObject_HEAD
  PyObject *ind;
  PyObject *iterseqs;
  PyObject *__pyx_default;
  Py_ssize_t n;
};


/* "cytoolz/itertoolz.pxd":157
 *                   object right_default=*)
 * 
 * cdef class _join:             # <<<<<<<<<<<<<<
 *     cdef dict d
 *     cdef list matches
 */
struct __pyx_obj_7cytoolz_9itertoolz__join {
  PyObject_HEAD
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__join *__pyx_vtab;
  PyObject *d;
  PyObject *matches;
  PyObject *seen_keys;
  PyObject *leftseq;
  PyObject *rightseq;
  PyObject *_rightkey;
  PyObject *right;
  PyObject *left_default;
  PyObject *right_default;
  PyObject *keys;
  Py_ssize_t N;
  Py_ssize_t i;
  int is_rightseq_exhausted;
};


/* "cytoolz/itertoolz.pxd":175
 * 
 * 
 * cdef class _inner_join(_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__inner_join {
  struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":178
 *     pass
 * 
 * cdef class _right_outer_join(_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join {
  struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":181
 *     pass
 * 
 * cdef class _left_outer_join(_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join {
  struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":184
 *     pass
 * 
 * cdef class _outer_join(_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__outer_join {
  struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":188
 * 
 * 
 * cdef class _inner_join_key(_inner_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key {
  struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":191
 *     pass
 * 
 * cdef class _inner_join_index(_inner_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index {
  struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":194
 *     pass
 * 
 * cdef class _inner_join_indices(_inner_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices {
  struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":197
 *     pass
 * 
 * cdef class _right_outer_join_key(_right_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key {
  struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":200
 *     pass
 * 
 * cdef class _right_outer_join_index(_right_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index {
  struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":203
 *     pass
 * 
 * cdef class _right_outer_join_indices(_right_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices {
  struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":206
 *     pass
 * 
 * cdef class _left_outer_join_key(_left_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key {
  struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":209
 *     pass
 * 
 * cdef class _left_outer_join_index(_left_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index {
  struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":212
 *     pass
 * 
 * cdef class _left_outer_join_indices(_left_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices {
  struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":215
 *     pass
 * 
 * cdef class _outer_join_key(_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key {
  struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":218
 *     pass
 * 
 * cdef class _outer_join_index(_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index {
  struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base;
};


/* "cytoolz/itertoolz.pxd":221
 *     pass
 * 
 * cdef class _outer_join_indices(_outer_join):             # <<<<<<<<<<<<<<
 *     pass
 */
struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices {
  struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base;
};



/* "cytoolz/itertoolz.pyx":1209
 *                                      left_default, right_default)
 * 
 * cdef class _join:             # <<<<<<<<<<<<<<
 *     def __cinit__(self,
 *                   object leftkey, object leftseq,
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__join {
  PyObject *(*rightkey)(struct __pyx_obj_7cytoolz_9itertoolz__join *);
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__join *__pyx_vtabptr_7cytoolz_9itertoolz__join;


/* "cytoolz/itertoolz.pyx":1386
 * 
 * 
 * cdef class _inner_join(_join):             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         cdef PyObject *obj = NULL
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join;


/* "cytoolz/itertoolz.pyx":1237
 * 
 * 
 * cdef class _right_outer_join(_join):             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         cdef PyObject *obj
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join;


/* "cytoolz/itertoolz.pyx":1330
 * 
 * 
 * cdef class _left_outer_join(_join):             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         cdef PyObject *obj
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join;


/* "cytoolz/itertoolz.pyx":1274
 * 
 * 
 * cdef class _outer_join(_join):             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         cdef PyObject *obj
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join;


/* "cytoolz/itertoolz.pyx":1401
 * 
 * 
 * cdef class _inner_join_key(_inner_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         return self._rightkey(self.right)
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key;


/* "cytoolz/itertoolz.pyx":1406
 * 
 * 
 * cdef class _inner_join_index(_inner_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         return self.right[self._rightkey]
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index;


/* "cytoolz/itertoolz.pyx":1411
 * 
 * 
 * cdef class _inner_join_indices(_inner_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices;


/* "cytoolz/itertoolz.pyx":1253
 * 
 * 
 * cdef class _right_outer_join_key(_right_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         return self._rightkey(self.right)
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key;


/* "cytoolz/itertoolz.pyx":1258
 * 
 * 
 * cdef class _right_outer_join_index(_right_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         return self.right[self._rightkey]
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index;


/* "cytoolz/itertoolz.pyx":1263
 * 
 * 
 * cdef class _right_outer_join_indices(_right_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices;


/* "cytoolz/itertoolz.pyx":1365
 * 
 * 
 * cdef class _left_outer_join_key(_left_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         return self._rightkey(self.right)
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key;


/* "cytoolz/itertoolz.pyx":1370
 * 
 * 
 * cdef class _left_outer_join_index(_left_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         return self.right[self._rightkey]
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index;


/* "cytoolz/itertoolz.pyx":1375
 * 
 * 
 * cdef class _left_outer_join_indices(_left_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices;


/* "cytoolz/itertoolz.pyx":1309
 * 
 * 
 * cdef class _outer_join_key(_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         return self._rightkey(self.right)
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key;


/* "cytoolz/itertoolz.pyx":1314
 * 
 * 
 * cdef class _outer_join_index(_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         return self.right[self._rightkey]
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index;


/* "cytoolz/itertoolz.pyx":1319
 * 
 * 
 * cdef class _outer_join_indices(_outer_join):             # <<<<<<<<<<<<<<
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)
 */

struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices {
  struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base;
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices;
#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); /*proto*/
  #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 /* CYTHON_REFNANNY */
#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)

#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

static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*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); /*proto*/

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

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

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

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

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   ((obj)->ob_type->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*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);

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

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

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

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

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

#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

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

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

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

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

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

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

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

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __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);

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

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


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

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

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

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

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

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

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

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

/* Module declarations from 'cytoolz.itertoolz' */
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_remove = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_accumulate = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__merge_sorted = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_interleave = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__unique_key = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__unique_identity = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_interpose = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_iterate = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_sliding_window = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_partition_all = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_index = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_index_default = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_list = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_list_default = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__join = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_key = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_index = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_indices = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_key = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_index = 0;
static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_indices = 0;
static PyObject *__pyx_v_7cytoolz_9itertoolz__get_exceptions = 0;
static PyObject *__pyx_v_7cytoolz_9itertoolz__get_list_exc = 0;
static PyObject *__pyx_f_7cytoolz_9itertoolz_groupby(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_c_merge_sorted(PyObject *, struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_unique(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_unique *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_isiterable(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_isdistinct(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_take(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_drop(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_take_nth(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_first(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_second(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_nth(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_last(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_rest(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_get(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_get *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_cons(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_mapcat(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_frequencies(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_reduceby(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_partition(Py_ssize_t, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_partition *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_count(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_pluck(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_pluck *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_join(PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_join *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_identity(PyObject *, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytoolz_9itertoolz__groupby_core(PyObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cytoolz_9itertoolz__reduceby_core(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int); /*proto*/
#define __Pyx_MODULE_NAME "cytoolz.itertoolz"
int __pyx_module_is_main_cytoolz__itertoolz = 0;

/* Implementation of 'cytoolz.itertoolz' */
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_pf_7cytoolz_9itertoolz_identity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_6remove___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_10accumulate___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_2groupby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_seq); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self, PyObject *__pyx_v_seqs); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_4merge_sorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_10interleave___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_pass_exceptions); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_11_unique_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_16_unique_identity___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_6unique(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_8isiterable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_10isdistinct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_12take(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_14drop(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_16take_nth(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_18first(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_20second(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_22nth(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_24last(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_26rest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_28get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seq, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_30mapcat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_seqs); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_32cons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_el, PyObject *__pyx_v_seq); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_9interpose___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self, PyObject *__pyx_v_el, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_34frequencies(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_36reduceby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq, PyObject *__pyx_v_init); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_7iterate___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_14sliding_window___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_38partition(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, PyObject *__pyx_v_pad); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_13partition_all___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_40count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_12_pluck_index___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, CYTHON_UNUSED PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_11_pluck_list___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_42pluck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_44join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, PyObject *__pyx_v_left_default, PyObject *__pyx_v_right_default); /* proto */
static int __pyx_pf_7cytoolz_9itertoolz_5_join___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self, PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, PyObject *__pyx_v_left_default, PyObject *__pyx_v_right_default); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_5_join_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_right_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__outer_join *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_left_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_inner_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__inner_join *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_remove(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_accumulate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__merge_sorted(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__merge_sorted_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_interleave(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__unique_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__unique_identity(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_interpose(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_iterate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_sliding_window(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_partition_all(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_index_default(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_list(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_list_default(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_indices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_n[] = "n";
static char __pyx_k_x[] = "x";
static char __pyx_k_el[] = "el";
static char __pyx_k_all[] = "__all__";
static char __pyx_k_get[] = "get";
static char __pyx_k_ind[] = "ind";
static char __pyx_k_key[] = "key";
static char __pyx_k_len[] = "__len__";
static char __pyx_k_map[] = "map";
static char __pyx_k_nth[] = "nth";
static char __pyx_k_pad[] = "pad";
static char __pyx_k_seq[] = "seq";
static char __pyx_k_zip[] = "zip";
static char __pyx_k_cons[] = "cons";
static char __pyx_k_drop[] = "drop";
static char __pyx_k_func[] = "func";
static char __pyx_k_init[] = "init";
static char __pyx_k_join[] = "join";
static char __pyx_k_last[] = "last";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_seqs[] = "seqs";
static char __pyx_k_take[] = "take";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_binop[] = "binop";
static char __pyx_k_chain[] = "chain";
static char __pyx_k_count[] = "count";
static char __pyx_k_first[] = "first";
static char __pyx_k_heapq[] = "heapq";
static char __pyx_k_pluck[] = "pluck";
static char __pyx_k_range[] = "range";
static char __pyx_k_concat[] = "concat";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_islice[] = "islice";
static char __pyx_k_kwargs[] = "kwargs";
static char __pyx_k_mapcat[] = "mapcat";
static char __pyx_k_no_pad[] = "no_pad";
static char __pyx_k_remove[] = "remove";
static char __pyx_k_second[] = "second";
static char __pyx_k_unique[] = "unique";
static char __pyx_k_concatv[] = "concatv";
static char __pyx_k_default[] = "default";
static char __pyx_k_groupby[] = "groupby";
static char __pyx_k_heapify[] = "heapify";
static char __pyx_k_heappop[] = "heappop";
static char __pyx_k_iterate[] = "iterate";
static char __pyx_k_leftkey[] = "leftkey";
static char __pyx_k_leftseq[] = "leftseq";
static char __pyx_k_no__pad[] = "__no__pad__";
static char __pyx_k_KeyError[] = "KeyError";
static char __pyx_k_identity[] = "identity";
static char __pyx_k_operator[] = "operator";
static char __pyx_k_reduceby[] = "reduceby";
static char __pyx_k_rightkey[] = "rightkey";
static char __pyx_k_rightseq[] = "rightseq";
static char __pyx_k_take_nth[] = "take_nth";
static char __pyx_k_TypeError[] = "TypeError";
static char __pyx_k_enumerate[] = "enumerate";
static char __pyx_k_fillvalue[] = "fillvalue";
static char __pyx_k_interpose[] = "interpose";
static char __pyx_k_itertools[] = "itertools";
static char __pyx_k_partition[] = "partition";
static char __pyx_k_predicate[] = "predicate";
static char __pyx_k_IndexError[] = "IndexError";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_accumulate[] = "accumulate";
static char __pyx_k_interleave[] = "interleave";
static char __pyx_k_isdistinct[] = "isdistinct";
static char __pyx_k_isiterable[] = "isiterable";
static char __pyx_k_itemgetter[] = "itemgetter";
static char __pyx_k_no_default[] = "no_default";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_frequencies[] = "frequencies";
static char __pyx_k_heapreplace[] = "heapreplace";
static char __pyx_k_no__default[] = "__no__default__";
static char __pyx_k_zip_longest[] = "zip_longest";
static char __pyx_k_get_line_578[] = "get (line 578)";
static char __pyx_k_left_default[] = "left_default";
static char __pyx_k_merge_sorted[] = "merge_sorted";
static char __pyx_k_nth_line_531[] = "nth (line 531)";
static char __pyx_k_StopIteration[] = "StopIteration";
static char __pyx_k_compatibility[] = "compatibility";
static char __pyx_k_cons_line_665[] = "cons (line 665)";
static char __pyx_k_drop_line_479[] = "drop (line 479)";
static char __pyx_k_from_iterable[] = "from_iterable";
static char __pyx_k_last_line_550[] = "last (line 550)";
static char __pyx_k_partition_all[] = "partition_all";
static char __pyx_k_right_default[] = "right_default";
static char __pyx_k_take_line_469[] = "take (line 469)";
static char __pyx_k_first_line_509[] = "first (line 509)";
static char __pyx_k_join_line_1111[] = "join (line 1111)";
static char __pyx_k_sliding_window[] = "sliding_window";
static char __pyx_k_mapcat_line_654[] = "mapcat (line 654)";
static char __pyx_k_pass_exceptions[] = "pass_exceptions";
static char __pyx_k_pluck_line_1075[] = "pluck (line 1075)";
static char __pyx_k_second_line_519[] = "second (line 519)";
static char __pyx_k_unique_line_405[] = "unique (line 405)";
static char __pyx_k_groupby_line_110[] = "groupby (line 110)";
static char __pyx_k_cytoolz_itertoolz[] = "cytoolz.itertoolz";
static char __pyx_k_reduceby_line_740[] = "reduceby (line 740)";
static char __pyx_k_take_nth_line_499[] = "take_nth (line 499)";
static char __pyx_k_partition_line_903[] = "partition (line 903)";
static char __pyx_k_isdistinct_line_444[] = "isdistinct (line 444)";
static char __pyx_k_isiterable_line_425[] = "isiterable (line 425)";
static char __pyx_k_frequencies_line_705[] = "frequencies (line 705)";
static char __pyx_k_merge_sorted_line_278[] = "merge_sorted (line 278)";
static char __pyx_k_Apply_func_to_each_sequence_in[] = "\n    Apply func to each sequence in seqs, concatenating results.\n\n    >>> list(mapcat(lambda s: [c.upper() for c in s],\n    ...             [[\"a\", \"b\"], [\"c\", \"d\", \"e\"]]))\n    ['A', 'B', 'C', 'D', 'E']\n    ";
static char __pyx_k_Is_x_iterable_isiterable_1_2_3[] = "\n    Is x iterable?\n\n    >>> isiterable([1, 2, 3])\n    True\n    >>> isiterable('abc')\n    True\n    >>> isiterable(5)\n    False\n    ";
static char __pyx_k_Merge_and_sort_a_collection_of[] = "\n    Merge and sort a collection of sorted collections\n\n    This works lazily and only keeps one value from each iterable in memory.\n\n    >>> list(merge_sorted([1, 3, 5], [2, 4, 6]))\n    [1, 2, 3, 4, 5, 6]\n\n    >>> ''.join(merge_sorted('abc', 'abc', 'abc'))\n    'aaabbbccc'\n\n    The \"key\" function used to sort the input may be passed as a keyword.\n\n    >>> list(merge_sorted([2, 3], [1, 3], key=lambda x: x // 3))\n    [2, 1, 3, 3]\n    ";
static char __pyx_k_Partition_sequence_into_tuples[] = "\n    Partition sequence into tuples of length n\n\n    >>> list(partition(2, [1, 2, 3, 4]))\n    [(1, 2), (3, 4)]\n\n    If the length of ``seq`` is not evenly divisible by ``n``, the final tuple\n    is dropped if ``pad`` is not specified, or filled to length ``n`` by pad:\n\n    >>> list(partition(2, [1, 2, 3, 4, 5]))\n    [(1, 2), (3, 4)]\n\n    >>> list(partition(2, [1, 2, 3, 4, 5], pad=None))\n    [(1, 2), (3, 4), (5, None)]\n\n    See Also:\n        partition_all\n    ";
static char __pyx_k_Perform_a_simultaneous_groupby[] = "\n    Perform a simultaneous groupby and reduction\n\n    The computation:\n\n    >>> result = reduceby(key, binop, seq, init)      # doctest: +SKIP\n\n    is equivalent to the following:\n\n    >>> def reduction(group):                           # doctest: +SKIP\n    ...     return reduce(binop, group, init)           # doctest: +SKIP\n\n    >>> groups = groupby(key, seq)                    # doctest: +SKIP\n    >>> result = valmap(reduction, groups)              # doctest: +SKIP\n\n    But the former does not build the intermediate groups, allowing it to\n    operate in much less space.  This makes it suitable for larger datasets\n    that do not fit comfortably in memory\n\n    Simple Examples\n    ---------------\n\n    >>> from operator import add, mul\n    >>> iseven = lambda x: x % 2 == 0\n\n    >>> data = [1, 2, 3, 4, 5]\n\n    >>> reduceby(iseven, add, data)\n    {False: 9, True: 6}\n\n    >>> reduceby(iseven, mul, data)\n    {False: 15, True: 8}\n\n    Complex Example\n    ---------------\n\n    >>> projects = [{'name': 'build roads', 'state': 'CA', 'cost': 1000000},\n    ...             {'name': 'fight crime', 'state': 'IL', 'cost': 100000},\n    ...             {'name': 'help farmers', 'state': 'IL', 'cost': 2000000},\n    ...             {'name': 'help farmers', 'state': 'CA', 'cost': 200000}]\n\n    >>> reduceby('state',                        # doctest: +SKIP\n    ...          lambda acc, x: acc + x['cost'],\n    ...          projects, 0)\n    {'CA': 1200000, 'IL': 2100000}\n    ";
static char __pyx_k_Return_only_unique_elements_of[] = "\n    Return only unique elements of a sequence\n\n    >>> tuple(unique((1, 2, 3)))\n    (1, 2, 3)\n    >>> tuple(unique((1, 2, 1, 3)))\n    (1, 2, 3)\n\n    Uniqueness can be defined by key keyword\n\n    >>> tuple(unique(['cat', 'mouse', 'dog', 'hen'], key=len))\n    ('cat', 'mouse')\n    ";
static char __pyx_k_The_last_element_in_a_sequence[] = "\n    The last element in a sequence\n\n    >>> last('ABC')\n    'C'\n    ";
static char __pyx_k_Add_el_to_beginning_of_possibly[] = "\n    Add el to beginning of (possibly infinite) sequence seq.\n\n    >>> list(cons(1, [2, 3]))\n    [1, 2, 3]\n    ";
static char __pyx_k_All_values_in_sequence_are_dist[] = "\n    All values in sequence are distinct\n\n    >>> isdistinct([1, 2, 3])\n    True\n    >>> isdistinct([1, 2, 1])\n    False\n\n    >>> isdistinct(\"Hello\")\n    False\n    >>> isdistinct(\"World\")\n    True\n    ";
static char __pyx_k_Every_nth_item_in_seq_list_take[] = "\n    Every nth item in seq\n\n    >>> list(take_nth(2, [10, 20, 30, 40, 50]))\n    [10, 30, 50]\n    ";
static char __pyx_k_Find_number_of_occurrences_of_e[] = "\n    Find number of occurrences of each value in seq\n\n    >>> frequencies(['cat', 'cat', 'ox', 'pig', 'pig', 'cat'])  #doctest: +SKIP\n    {'cat': 3, 'ox': 1, 'pig': 2}\n\n    See Also:\n        countby\n        groupby\n    ";
static char __pyx_k_Get_element_in_a_sequence_or_di[] = "\n    Get element in a sequence or dict\n\n    Provides standard indexing\n\n    >>> get(1, 'ABC')       # Same as 'ABC'[1]\n    'B'\n\n    Pass a list to get multiple values\n\n    >>> get([1, 2], 'ABC')  # ('ABC'[1], 'ABC'[2])\n    ('B', 'C')\n\n    Works on any value that supports indexing/getitem\n    For example here we see that it works with dictionaries\n\n    >>> phonebook = {'Alice':  '555-1234',\n    ...              'Bob':    '555-5678',\n    ...              'Charlie':'555-9999'}\n    >>> get('Alice', phonebook)\n    '555-1234'\n\n    >>> get(['Alice', 'Bob'], phonebook)\n    ('555-1234', '555-5678')\n\n    Provide a default for missing values\n\n    >>> get(['Alice', 'Dennis'], phonebook, None)\n    ('555-1234', None)\n\n    See Also:\n        pluck\n    ";
static char __pyx_k_Group_a_collection_by_a_key_fun[] = "\n    Group a collection by a key function\n\n    >>> names = ['Alice', 'Bob', 'Charlie', 'Dan', 'Edith', 'Frank']\n    >>> groupby(len, names)\n    {3: ['Bob', 'Dan'], 5: ['Alice', 'Edith', 'Frank'], 7: ['Charlie']}\n\n    >>> iseven = lambda x: x % 2 == 0\n    >>> groupby(iseven, [1, 2, 3, 4, 5, 6, 7, 8])\n    {False: [1, 3, 5, 7], True: [2, 4, 6, 8]}\n\n    Non-callable keys imply grouping on a member.\n\n    >>> groupby('gender', [{'name': 'Alice', 'gender': 'F'},\n    ...                    {'name': 'Bob', 'gender': 'M'},\n    ...                    {'name': 'Charlie', 'gender': 'M'}]) # doctest:+SKIP\n    {'F': [{'gender': 'F', 'name': 'Alice'}],\n     'M': [{'gender': 'M', 'name': 'Bob'},\n           {'gender': 'M', 'name': 'Charlie'}]}\n\n    See Also:\n        countby\n    ";
static char __pyx_k_Join_two_sequences_on_common_at[] = "\n    Join two sequences on common attributes\n\n    This is a semi-streaming operation.  The LEFT sequence is fully evaluated\n    and placed into memory.  The RIGHT sequence is evaluated lazily and so can\n    be arbitrarily large.\n\n    >>> friends = [('Alice', 'Edith'),\n    ...            ('Alice', 'Zhao'),\n    ...            ('Edith', 'Alice'),\n    ...            ('Zhao', 'Alice'),\n    ...            ('Zhao', 'Edith')]\n\n    >>> cities = [('Alice', 'NYC'),\n    ...           ('Alice', 'Chicago'),\n    ...           ('Dan', 'Syndey'),\n    ...           ('Edith', 'Paris'),\n    ...           ('Edith', 'Berlin'),\n    ...           ('Zhao', 'Shanghai')]\n\n    >>> # Vacation opportunities\n    >>> # In what cities do people have friends?\n    >>> result = join(second, friends,\n    ...               first, cities)\n    >>> for ((a, b), (c, d)) in sorted(unique(result)):\n    ...     print((a, d))\n    ('Alice', 'Berlin')\n    ('Alice', 'Paris')\n    ('Alice', 'Shanghai')\n    ('Edith', 'Chicago')\n    ('Edith', 'NYC')\n    ('Zhao', 'Chicago')\n    ('Zhao', 'NYC')\n    ('Zhao', 'Berlin')\n    ('Zhao', 'Paris')\n\n    Specify outer joins with keyword arguments ``left_default`` and/or\n    ``right_default``.  Here is a full outer join in which unmatched elements\n    are paired with None.\n\n    >>> identity = lambda x: x\n    >>> list(join(identity, [1, 2, 3],\n    ...           identity, [2, 3, 4],\n    ...           left_default=None, right_default=None))\n    [(2, 2), (3, 3), (None, 4), (1, None)]\n\n    Usually the key arguments are callables to be applied to the sequences.  If\n    the keys are not obviously callable then it is assumed that indexing was\n    intended, e.g. the following is a legal change\n\n    >>> # result = join(second, friends, first, cities)\n    >>> result = join(1, friends, 0, cities)  # doctest: +SKIP\n    ";
static char __pyx_k_The_first_element_in_a_sequence[] = "\n    The first element in a sequence\n\n    >>> first('ABC')\n    'A'\n    ";
static char __pyx_k_The_first_n_elements_of_a_seque[] = "\n    The first n elements of a sequence\n\n    >>> list(take(2, [10, 20, 30, 40, 50]))\n    [10, 20]\n    ";
static char __pyx_k_The_nth_element_in_a_sequence_n[] = "\n    The nth element in a sequence\n\n    >>> nth(1, 'ABC')\n    'B'\n    ";
static char __pyx_k_The_second_element_in_a_sequenc[] = "\n    The second element in a sequence\n\n    >>> second('ABC')\n    'B'\n    ";
static char __pyx_k_The_sequence_following_the_firs[] = "\n    The sequence following the first n elements\n\n    >>> list(drop(2, [10, 20, 30, 40, 50]))\n    [30, 40, 50]\n    ";
static char __pyx_k_home_erik_git_cytoolz_cytoolz_i[] = "/home/erik/git/cytoolz/cytoolz/itertoolz.pyx";
static char __pyx_k_n_argument_for_drop_must_be_non[] = "n argument for drop() must be non-negative";
static char __pyx_k_plucks_an_element_or_several_el[] = "\n    plucks an element or several elements from each item in a sequence.\n\n    ``pluck`` maps ``itertoolz.get`` over a sequence and returns one or more\n    elements of each item in the sequence.\n\n    This is equivalent to running `map(curried.get(ind), seqs)`\n\n    ``ind`` can be either a single string/index or a sequence of\n    strings/indices.\n    ``seqs`` should be sequence containing sequences or dicts.\n\n    e.g.\n\n    >>> data = [{'id': 1, 'name': 'Cheese'}, {'id': 2, 'name': 'Pies'}]\n    >>> list(pluck('name', data))\n    ['Cheese', 'Pies']\n    >>> list(pluck([0, 1], [[1, 2, 3], [4, 5, 7]]))\n    [(1, 2), (4, 5)]\n\n    See Also:\n        get\n        map\n    ";
static PyObject *__pyx_kp_u_Add_el_to_beginning_of_possibly;
static PyObject *__pyx_kp_u_All_values_in_sequence_are_dist;
static PyObject *__pyx_kp_u_Apply_func_to_each_sequence_in;
static PyObject *__pyx_kp_u_Every_nth_item_in_seq_list_take;
static PyObject *__pyx_kp_u_Find_number_of_occurrences_of_e;
static PyObject *__pyx_kp_u_Get_element_in_a_sequence_or_di;
static PyObject *__pyx_kp_u_Group_a_collection_by_a_key_fun;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_u_Is_x_iterable_isiterable_1_2_3;
static PyObject *__pyx_kp_u_Join_two_sequences_on_common_at;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_u_Merge_and_sort_a_collection_of;
static PyObject *__pyx_kp_u_Partition_sequence_into_tuples;
static PyObject *__pyx_kp_u_Perform_a_simultaneous_groupby;
static PyObject *__pyx_kp_u_Return_only_unique_elements_of;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_kp_u_The_first_element_in_a_sequence;
static PyObject *__pyx_kp_u_The_first_n_elements_of_a_seque;
static PyObject *__pyx_kp_u_The_last_element_in_a_sequence;
static PyObject *__pyx_kp_u_The_nth_element_in_a_sequence_n;
static PyObject *__pyx_kp_u_The_second_element_in_a_sequenc;
static PyObject *__pyx_kp_u_The_sequence_following_the_firs;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_accumulate;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_binop;
static PyObject *__pyx_n_s_chain;
static PyObject *__pyx_n_s_compatibility;
static PyObject *__pyx_n_s_concat;
static PyObject *__pyx_n_s_concatv;
static PyObject *__pyx_n_s_cons;
static PyObject *__pyx_kp_u_cons_line_665;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_cytoolz_itertoolz;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_drop;
static PyObject *__pyx_kp_u_drop_line_479;
static PyObject *__pyx_n_s_el;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_fillvalue;
static PyObject *__pyx_n_s_first;
static PyObject *__pyx_kp_u_first_line_509;
static PyObject *__pyx_n_s_frequencies;
static PyObject *__pyx_kp_u_frequencies_line_705;
static PyObject *__pyx_n_s_from_iterable;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_kp_u_get_line_578;
static PyObject *__pyx_n_s_groupby;
static PyObject *__pyx_kp_u_groupby_line_110;
static PyObject *__pyx_n_s_heapify;
static PyObject *__pyx_n_s_heappop;
static PyObject *__pyx_n_s_heapq;
static PyObject *__pyx_n_s_heapreplace;
static PyObject *__pyx_kp_s_home_erik_git_cytoolz_cytoolz_i;
static PyObject *__pyx_n_s_identity;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_ind;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_interleave;
static PyObject *__pyx_n_s_interpose;
static PyObject *__pyx_n_s_isdistinct;
static PyObject *__pyx_kp_u_isdistinct_line_444;
static PyObject *__pyx_n_s_isiterable;
static PyObject *__pyx_kp_u_isiterable_line_425;
static PyObject *__pyx_n_s_islice;
static PyObject *__pyx_n_s_itemgetter;
static PyObject *__pyx_n_s_iterate;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_kp_u_join_line_1111;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_last;
static PyObject *__pyx_kp_u_last_line_550;
static PyObject *__pyx_n_s_left_default;
static PyObject *__pyx_n_s_leftkey;
static PyObject *__pyx_n_s_leftseq;
static PyObject *__pyx_n_s_len;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_mapcat;
static PyObject *__pyx_kp_u_mapcat_line_654;
static PyObject *__pyx_n_s_merge_sorted;
static PyObject *__pyx_kp_u_merge_sorted_line_278;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_kp_s_n_argument_for_drop_must_be_non;
static PyObject *__pyx_n_s_no__default;
static PyObject *__pyx_n_s_no__pad;
static PyObject *__pyx_n_s_no_default;
static PyObject *__pyx_n_s_no_pad;
static PyObject *__pyx_n_s_nth;
static PyObject *__pyx_kp_u_nth_line_531;
static PyObject *__pyx_n_s_operator;
static PyObject *__pyx_n_s_pad;
static PyObject *__pyx_n_s_partition;
static PyObject *__pyx_n_s_partition_all;
static PyObject *__pyx_kp_u_partition_line_903;
static PyObject *__pyx_n_s_pass_exceptions;
static PyObject *__pyx_n_s_pluck;
static PyObject *__pyx_kp_u_pluck_line_1075;
static PyObject *__pyx_kp_u_plucks_an_element_or_several_el;
static PyObject *__pyx_n_s_predicate;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reduceby;
static PyObject *__pyx_kp_u_reduceby_line_740;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_right_default;
static PyObject *__pyx_n_s_rightkey;
static PyObject *__pyx_n_s_rightseq;
static PyObject *__pyx_n_s_second;
static PyObject *__pyx_kp_u_second_line_519;
static PyObject *__pyx_n_s_seq;
static PyObject *__pyx_n_s_seqs;
static PyObject *__pyx_n_s_sliding_window;
static PyObject *__pyx_n_s_take;
static PyObject *__pyx_kp_u_take_line_469;
static PyObject *__pyx_n_s_take_nth;
static PyObject *__pyx_kp_u_take_nth_line_499;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_unique;
static PyObject *__pyx_kp_u_unique_line_405;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_n_s_zip_longest;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_k_;
static PyObject *__pyx_k__3;
static PyObject *__pyx_k__4;
static PyObject *__pyx_k__5;
static PyObject *__pyx_k__6;
static PyObject *__pyx_k__7;
static PyObject *__pyx_k__8;
static PyObject *__pyx_k__9;
static PyObject *__pyx_k__10;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_codeobj__12;

/* "cytoolz/itertoolz.pyx":32
 * 
 * 
 * cpdef object identity(object x):             # <<<<<<<<<<<<<<
 *     return x
 * 
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_identity(PyObject *__pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("identity", 0);

  /* "cytoolz/itertoolz.pyx":33
 * 
 * cpdef object identity(object x):
 *     return x             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_x);
  __pyx_r = __pyx_v_x;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":32
 * 
 * 
 * cpdef object identity(object x):             # <<<<<<<<<<<<<<
 *     return x
 * 
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_identity[] = "identity(x)";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("identity (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_identity(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_identity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("identity", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_identity(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.identity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":46
 *     [1, 3]
 *     """
 *     def __cinit__(self, object predicate, object seq):             # <<<<<<<<<<<<<<
 *         self.predicate = predicate
 *         self.iter_seq = iter(seq)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_6remove_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_6remove_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_predicate = 0;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_predicate,&__pyx_n_s_seq,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_predicate)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __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_predicate = values[0];
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.remove.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6remove___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_remove *)__pyx_v_self), __pyx_v_predicate, __pyx_v_seq);

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

static int __pyx_pf_7cytoolz_9itertoolz_6remove___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_seq) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":47
 *     """
 *     def __cinit__(self, object predicate, object seq):
 *         self.predicate = predicate             # <<<<<<<<<<<<<<
 *         self.iter_seq = iter(seq)
 * 
 */
  __Pyx_INCREF(__pyx_v_predicate);
  __Pyx_GIVEREF(__pyx_v_predicate);
  __Pyx_GOTREF(__pyx_v_self->predicate);
  __Pyx_DECREF(__pyx_v_self->predicate);
  __pyx_v_self->predicate = __pyx_v_predicate;

  /* "cytoolz/itertoolz.pyx":48
 *     def __cinit__(self, object predicate, object seq):
 *         self.predicate = predicate
 *         self.iter_seq = iter(seq)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iter_seq);
  __Pyx_DECREF(__pyx_v_self->iter_seq);
  __pyx_v_self->iter_seq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":46
 *     [1, 3]
 *     """
 *     def __cinit__(self, object predicate, object seq):             # <<<<<<<<<<<<<<
 *         self.predicate = predicate
 *         self.iter_seq = iter(seq)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz.remove.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":50
 *         self.iter_seq = iter(seq)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6remove_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_remove *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":51
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":50
 *         self.iter_seq = iter(seq)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":53
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object val
 *         val = next(self.iter_seq)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6remove_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_remove *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self) {
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":55
 *     def __next__(self):
 *         cdef object val
 *         val = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *         while self.predicate(val):
 *             val = next(self.iter_seq)
 */
  __pyx_t_1 = __pyx_v_self->iter_seq;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":56
 *         cdef object val
 *         val = next(self.iter_seq)
 *         while self.predicate(val):             # <<<<<<<<<<<<<<
 *             val = next(self.iter_seq)
 *         return val
 */
  while (1) {
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->predicate, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_3) break;

    /* "cytoolz/itertoolz.pyx":57
 *         val = next(self.iter_seq)
 *         while self.predicate(val):
 *             val = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *         return val
 * 
 */
    __pyx_t_1 = __pyx_v_self->iter_seq;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "cytoolz/itertoolz.pyx":58
 *         while self.predicate(val):
 *             val = next(self.iter_seq)
 *         return val             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_val);
  __pyx_r = __pyx_v_val;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":53
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object val
 *         val = next(self.iter_seq)
 */

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

/* "cytoolz/itertoolz.pyx":82
 *         itertools.accumulate :  In standard itertools for Python 3.2+
 *     """
 *     def __cinit__(self, object binop, object seq):             # <<<<<<<<<<<<<<
 *         self.binop = binop
 *         self.iter_seq = iter(seq)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_10accumulate_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_10accumulate_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_binop = 0;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_binop,&__pyx_n_s_seq,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_binop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __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_binop = values[0];
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.accumulate.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10accumulate___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)__pyx_v_self), __pyx_v_binop, __pyx_v_seq);

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

static int __pyx_pf_7cytoolz_9itertoolz_10accumulate___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":83
 *     """
 *     def __cinit__(self, object binop, object seq):
 *         self.binop = binop             # <<<<<<<<<<<<<<
 *         self.iter_seq = iter(seq)
 *         self.result = self  # sentinel
 */
  __Pyx_INCREF(__pyx_v_binop);
  __Pyx_GIVEREF(__pyx_v_binop);
  __Pyx_GOTREF(__pyx_v_self->binop);
  __Pyx_DECREF(__pyx_v_self->binop);
  __pyx_v_self->binop = __pyx_v_binop;

  /* "cytoolz/itertoolz.pyx":84
 *     def __cinit__(self, object binop, object seq):
 *         self.binop = binop
 *         self.iter_seq = iter(seq)             # <<<<<<<<<<<<<<
 *         self.result = self  # sentinel
 * 
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iter_seq);
  __Pyx_DECREF(__pyx_v_self->iter_seq);
  __pyx_v_self->iter_seq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":85
 *         self.binop = binop
 *         self.iter_seq = iter(seq)
 *         self.result = self  # sentinel             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_self->result);
  __Pyx_DECREF(__pyx_v_self->result);
  __pyx_v_self->result = ((PyObject *)__pyx_v_self);

  /* "cytoolz/itertoolz.pyx":82
 *         itertools.accumulate :  In standard itertools for Python 3.2+
 *     """
 *     def __cinit__(self, object binop, object seq):             # <<<<<<<<<<<<<<
 *         self.binop = binop
 *         self.iter_seq = iter(seq)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz.accumulate.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":87
 *         self.result = self  # sentinel
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10accumulate_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":88
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":87
 *         self.result = self  # sentinel
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":90
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object val
 *         val = next(self.iter_seq)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10accumulate_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self) {
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":92
 *     def __next__(self):
 *         cdef object val
 *         val = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *         if self.result is self:
 *             self.result = val
 */
  __pyx_t_1 = __pyx_v_self->iter_seq;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":93
 *         cdef object val
 *         val = next(self.iter_seq)
 *         if self.result is self:             # <<<<<<<<<<<<<<
 *             self.result = val
 *         else:
 */
  __pyx_t_3 = (__pyx_v_self->result == ((PyObject *)__pyx_v_self));
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cytoolz/itertoolz.pyx":94
 *         val = next(self.iter_seq)
 *         if self.result is self:
 *             self.result = val             # <<<<<<<<<<<<<<
 *         else:
 *             self.result = self.binop(self.result, val)
 */
    __Pyx_INCREF(__pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __Pyx_GOTREF(__pyx_v_self->result);
    __Pyx_DECREF(__pyx_v_self->result);
    __pyx_v_self->result = __pyx_v_val;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":96
 *             self.result = val
 *         else:
 *             self.result = self.binop(self.result, val)             # <<<<<<<<<<<<<<
 *         return self.result
 * 
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_self->result);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->result);
    __Pyx_GIVEREF(__pyx_v_self->result);
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->binop, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->result);
    __Pyx_DECREF(__pyx_v_self->result);
    __pyx_v_self->result = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":97
 *         else:
 *             self.result = self.binop(self.result, val)
 *         return self.result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->result);
  __pyx_r = __pyx_v_self->result;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":90
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object val
 *         val = next(self.iter_seq)
 */

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

/* "cytoolz/itertoolz.pyx":100
 * 
 * 
 * cdef inline object _groupby_core(dict d, object key, object item):             # <<<<<<<<<<<<<<
 *     cdef PyObject *obj = PyDict_GetItem(d, key)
 *     if obj is NULL:
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytoolz_9itertoolz__groupby_core(PyObject *__pyx_v_d, PyObject *__pyx_v_key, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_obj;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_groupby_core", 0);

  /* "cytoolz/itertoolz.pyx":101
 * 
 * cdef inline object _groupby_core(dict d, object key, object item):
 *     cdef PyObject *obj = PyDict_GetItem(d, key)             # <<<<<<<<<<<<<<
 *     if obj is NULL:
 *         val = []
 */
  __pyx_v_obj = PyDict_GetItem(__pyx_v_d, __pyx_v_key);

  /* "cytoolz/itertoolz.pyx":102
 * cdef inline object _groupby_core(dict d, object key, object item):
 *     cdef PyObject *obj = PyDict_GetItem(d, key)
 *     if obj is NULL:             # <<<<<<<<<<<<<<
 *         val = []
 *         PyList_Append(val, item)
 */
  __pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":103
 *     cdef PyObject *obj = PyDict_GetItem(d, key)
 *     if obj is NULL:
 *         val = []             # <<<<<<<<<<<<<<
 *         PyList_Append(val, item)
 *         PyDict_SetItem(d, key, val)
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_val = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytoolz/itertoolz.pyx":104
 *     if obj is NULL:
 *         val = []
 *         PyList_Append(val, item)             # <<<<<<<<<<<<<<
 *         PyDict_SetItem(d, key, val)
 *     else:
 */
    __pyx_t_3 = PyList_Append(__pyx_v_val, __pyx_v_item); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "cytoolz/itertoolz.pyx":105
 *         val = []
 *         PyList_Append(val, item)
 *         PyDict_SetItem(d, key, val)             # <<<<<<<<<<<<<<
 *     else:
 *         PyList_Append(<object>obj, item)
 */
    __pyx_t_3 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_v_val); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":107
 *         PyDict_SetItem(d, key, val)
 *     else:
 *         PyList_Append(<object>obj, item)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_obj), __pyx_v_item); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":100
 * 
 * 
 * cdef inline object _groupby_core(dict d, object key, object item):             # <<<<<<<<<<<<<<
 *     cdef PyObject *obj = PyDict_GetItem(d, key)
 *     if obj is NULL:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytoolz.itertoolz._groupby_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":110
 * 
 * 
 * cpdef dict groupby(object key, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Group a collection by a key function
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_3groupby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_groupby(PyObject *__pyx_v_key, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_keyval = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("groupby", 0);

  /* "cytoolz/itertoolz.pyx":134
 *         countby
 *     """
 *     cdef dict d = {}             # <<<<<<<<<<<<<<
 *     cdef object item, keyval
 *     cdef Py_ssize_t i, N
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":137
 *     cdef object item, keyval
 *     cdef Py_ssize_t i, N
 *     if callable(key):             # <<<<<<<<<<<<<<
 *         for item in seq:
 *             keyval = key(item)
 */
  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_key); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cytoolz/itertoolz.pyx":138
 *     cdef Py_ssize_t i, N
 *     if callable(key):
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = key(item)
 *             _groupby_core(d, keyval, item)
 */
    if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
      __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cytoolz/itertoolz.pyx":139
 *     if callable(key):
 *         for item in seq:
 *             keyval = key(item)             # <<<<<<<<<<<<<<
 *             _groupby_core(d, keyval, item)
 *     elif isinstance(key, list):
 */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_item);
      __Pyx_GIVEREF(__pyx_v_item);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_key, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":140
 *         for item in seq:
 *             keyval = key(item)
 *             _groupby_core(d, keyval, item)             # <<<<<<<<<<<<<<
 *     elif isinstance(key, list):
 *         N = PyList_GET_SIZE(key)
 */
      __pyx_t_7 = __pyx_f_7cytoolz_9itertoolz__groupby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":138
 *     cdef Py_ssize_t i, N
 *     if callable(key):
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = key(item)
 *             _groupby_core(d, keyval, item)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "cytoolz/itertoolz.pyx":141
 *             keyval = key(item)
 *             _groupby_core(d, keyval, item)
 *     elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *         N = PyList_GET_SIZE(key)
 *         for item in seq:
 */
  __pyx_t_3 = PyList_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":142
 *             _groupby_core(d, keyval, item)
 *     elif isinstance(key, list):
 *         N = PyList_GET_SIZE(key)             # <<<<<<<<<<<<<<
 *         for item in seq:
 *             keyval = PyTuple_New(N)
 */
    __pyx_v_N = PyList_GET_SIZE(__pyx_v_key);

    /* "cytoolz/itertoolz.pyx":143
 *     elif isinstance(key, list):
 *         N = PyList_GET_SIZE(key)
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = PyTuple_New(N)
 *             for i in range(N):
 */
    if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
      __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_7 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":144
 *         N = PyList_GET_SIZE(key)
 *         for item in seq:
 *             keyval = PyTuple_New(N)             # <<<<<<<<<<<<<<
 *             for i in range(N):
 *                 val = <object>PyList_GET_ITEM(key, i)
 */
      __pyx_t_7 = PyTuple_New(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":145
 *         for item in seq:
 *             keyval = PyTuple_New(N)
 *             for i in range(N):             # <<<<<<<<<<<<<<
 *                 val = <object>PyList_GET_ITEM(key, i)
 *                 val = item[val]
 */
      __pyx_t_8 = __pyx_v_N;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;

        /* "cytoolz/itertoolz.pyx":146
 *             keyval = PyTuple_New(N)
 *             for i in range(N):
 *                 val = <object>PyList_GET_ITEM(key, i)             # <<<<<<<<<<<<<<
 *                 val = item[val]
 *                 Py_INCREF(val)
 */
        __pyx_t_10 = PyList_GET_ITEM(__pyx_v_key, __pyx_v_i);
        __pyx_t_7 = ((PyObject *)__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cytoolz/itertoolz.pyx":147
 *             for i in range(N):
 *                 val = <object>PyList_GET_ITEM(key, i)
 *                 val = item[val]             # <<<<<<<<<<<<<<
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(keyval, i, val)
 */
        __pyx_t_7 = PyObject_GetItem(__pyx_v_item, __pyx_v_val); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cytoolz/itertoolz.pyx":148
 *                 val = <object>PyList_GET_ITEM(key, i)
 *                 val = item[val]
 *                 Py_INCREF(val)             # <<<<<<<<<<<<<<
 *                 PyTuple_SET_ITEM(keyval, i, val)
 *             _groupby_core(d, keyval, item)
 */
        Py_INCREF(__pyx_v_val);

        /* "cytoolz/itertoolz.pyx":149
 *                 val = item[val]
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(keyval, i, val)             # <<<<<<<<<<<<<<
 *             _groupby_core(d, keyval, item)
 *     else:
 */
        PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val);
      }

      /* "cytoolz/itertoolz.pyx":150
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(keyval, i, val)
 *             _groupby_core(d, keyval, item)             # <<<<<<<<<<<<<<
 *     else:
 *         for item in seq:
 */
      __pyx_t_7 = __pyx_f_7cytoolz_9itertoolz__groupby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":143
 *     elif isinstance(key, list):
 *         N = PyList_GET_SIZE(key)
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = PyTuple_New(N)
 *             for i in range(N):
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":152
 *             _groupby_core(d, keyval, item)
 *     else:
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = item[key]
 *             _groupby_core(d, keyval, item)
 */
    if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
      __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_7 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":153
 *     else:
 *         for item in seq:
 *             keyval = item[key]             # <<<<<<<<<<<<<<
 *             _groupby_core(d, keyval, item)
 *     return d
 */
      __pyx_t_7 = PyObject_GetItem(__pyx_v_item, __pyx_v_key); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":154
 *         for item in seq:
 *             keyval = item[key]
 *             _groupby_core(d, keyval, item)             # <<<<<<<<<<<<<<
 *     return d
 * 
 */
      __pyx_t_7 = __pyx_f_7cytoolz_9itertoolz__groupby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":152
 *             _groupby_core(d, keyval, item)
 *     else:
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = item[key]
 *             _groupby_core(d, keyval, item)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":155
 *             keyval = item[key]
 *             _groupby_core(d, keyval, item)
 *     return d             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_d);
  __pyx_r = __pyx_v_d;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":110
 * 
 * 
 * cpdef dict groupby(object key, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Group a collection by a key function
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytoolz.itertoolz.groupby", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_keyval);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_3groupby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_2groupby[] = "groupby(key, seq) -> dict\n\n    Group a collection by a key function\n\n    >>> names = ['Alice', 'Bob', 'Charlie', 'Dan', 'Edith', 'Frank']\n    >>> groupby(len, names)\n    {3: ['Bob', 'Dan'], 5: ['Alice', 'Edith', 'Frank'], 7: ['Charlie']}\n\n    >>> iseven = lambda x: x % 2 == 0\n    >>> groupby(iseven, [1, 2, 3, 4, 5, 6, 7, 8])\n    {False: [1, 3, 5, 7], True: [2, 4, 6, 8]}\n\n    Non-callable keys imply grouping on a member.\n\n    >>> groupby('gender', [{'name': 'Alice', 'gender': 'F'},\n    ...                    {'name': 'Bob', 'gender': 'M'},\n    ...                    {'name': 'Charlie', 'gender': 'M'}]) # doctest:+SKIP\n    {'F': [{'gender': 'F', 'name': 'Alice'}],\n     'M': [{'gender': 'M', 'name': 'Bob'},\n           {'gender': 'M', 'name': 'Charlie'}]}\n\n    See Also:\n        countby\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_3groupby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groupby (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_seq,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_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __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_key = values[0];
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.groupby", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_2groupby(__pyx_self, __pyx_v_key, __pyx_v_seq);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_2groupby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("groupby", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_groupby(__pyx_v_key, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.groupby", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":159
 * 
 * cdef class _merge_sorted:
 *     def __cinit__(self, seqs):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef object item, it
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seqs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seqs,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_seqs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_seqs = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)__pyx_v_self), __pyx_v_seqs);

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

static int __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self, PyObject *__pyx_v_seqs) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_it = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":162
 *         cdef Py_ssize_t i
 *         cdef object item, it
 *         self.pq = []             # <<<<<<<<<<<<<<
 *         self.shortcut = None
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pq);
  __Pyx_DECREF(__pyx_v_self->pq);
  __pyx_v_self->pq = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":163
 *         cdef object item, it
 *         self.pq = []
 *         self.shortcut = None             # <<<<<<<<<<<<<<
 * 
 *         for i, item in enumerate(seqs):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->shortcut);
  __Pyx_DECREF(__pyx_v_self->shortcut);
  __pyx_v_self->shortcut = Py_None;

  /* "cytoolz/itertoolz.pyx":165
 *         self.shortcut = None
 * 
 *         for i, item in enumerate(seqs):             # <<<<<<<<<<<<<<
 *             it = iter(item)
 *             try:
 */
  __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_v_seqs) || PyTuple_CheckExact(__pyx_v_seqs)) {
    __pyx_t_1 = __pyx_v_seqs; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);

    /* "cytoolz/itertoolz.pyx":166
 * 
 *         for i, item in enumerate(seqs):
 *             it = iter(item)             # <<<<<<<<<<<<<<
 *             try:
 *                 item = next(it)
 */
    __pyx_t_5 = PyObject_GetIter(__pyx_v_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cytoolz/itertoolz.pyx":167
 *         for i, item in enumerate(seqs):
 *             it = iter(item)
 *             try:             # <<<<<<<<<<<<<<
 *                 item = next(it)
 *                 PyList_Append(self.pq, [item, i, it])
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "cytoolz/itertoolz.pyx":168
 *             it = iter(item)
 *             try:
 *                 item = next(it)             # <<<<<<<<<<<<<<
 *                 PyList_Append(self.pq, [item, i, it])
 *             except StopIteration:
 */
        __pyx_t_5 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "cytoolz/itertoolz.pyx":169
 *             try:
 *                 item = next(it)
 *                 PyList_Append(self.pq, [item, i, it])             # <<<<<<<<<<<<<<
 *             except StopIteration:
 *                 pass
 */
        __pyx_t_5 = __pyx_v_self->pq;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyList_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_item);
        PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_item);
        __Pyx_GIVEREF(__pyx_v_item);
        PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_it);
        PyList_SET_ITEM(__pyx_t_10, 2, __pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        __pyx_t_9 = 0;
        __pyx_t_11 = PyList_Append(__pyx_t_5, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cytoolz/itertoolz.pyx":170
 *                 item = next(it)
 *                 PyList_Append(self.pq, [item, i, it])
 *             except StopIteration:             # <<<<<<<<<<<<<<
 *                 pass
 *         i = PyList_GET_SIZE(self.pq)
 */
      __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_11) {
        PyErr_Restore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L12_try_end:;
    }

    /* "cytoolz/itertoolz.pyx":165
 *         self.shortcut = None
 * 
 *         for i, item in enumerate(seqs):             # <<<<<<<<<<<<<<
 *             it = iter(item)
 *             try:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":172
 *             except StopIteration:
 *                 pass
 *         i = PyList_GET_SIZE(self.pq)             # <<<<<<<<<<<<<<
 *         if i == 0:
 *             self.shortcut = iter([])
 */
  __pyx_t_1 = __pyx_v_self->pq;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_i = PyList_GET_SIZE(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":175
 *         if i == 0:
 *             self.shortcut = iter([])
 *         elif i == 1:             # <<<<<<<<<<<<<<
 *             self.shortcut = True
 *         else:
 */
  switch (__pyx_v_i) {

    /* "cytoolz/itertoolz.pyx":173
 *                 pass
 *         i = PyList_GET_SIZE(self.pq)
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             self.shortcut = iter([])
 *         elif i == 1:
 */
    case 0:

    /* "cytoolz/itertoolz.pyx":174
 *         i = PyList_GET_SIZE(self.pq)
 *         if i == 0:
 *             self.shortcut = iter([])             # <<<<<<<<<<<<<<
 *         elif i == 1:
 *             self.shortcut = True
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_10);
    __Pyx_GOTREF(__pyx_v_self->shortcut);
    __Pyx_DECREF(__pyx_v_self->shortcut);
    __pyx_v_self->shortcut = __pyx_t_10;
    __pyx_t_10 = 0;
    break;

    /* "cytoolz/itertoolz.pyx":175
 *         if i == 0:
 *             self.shortcut = iter([])
 *         elif i == 1:             # <<<<<<<<<<<<<<
 *             self.shortcut = True
 *         else:
 */
    case 1:

    /* "cytoolz/itertoolz.pyx":176
 *             self.shortcut = iter([])
 *         elif i == 1:
 *             self.shortcut = True             # <<<<<<<<<<<<<<
 *         else:
 *             heapify(self.pq)
 */
    __Pyx_INCREF(Py_True);
    __Pyx_GIVEREF(Py_True);
    __Pyx_GOTREF(__pyx_v_self->shortcut);
    __Pyx_DECREF(__pyx_v_self->shortcut);
    __pyx_v_self->shortcut = Py_True;
    break;
    default:

    /* "cytoolz/itertoolz.pyx":178
 *             self.shortcut = True
 *         else:
 *             heapify(self.pq)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_heapify); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_self->pq);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->pq);
    __Pyx_GIVEREF(__pyx_v_self->pq);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    break;
  }

  /* "cytoolz/itertoolz.pyx":159
 * 
 * cdef class _merge_sorted:
 *     def __cinit__(self, seqs):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef object item, it
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":180
 *             heapify(self.pq)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":181
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":180
 *             heapify(self.pq)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":183
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef list item
 *         cdef object retval, it
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self) {
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_retval = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":187
 *         cdef object retval, it
 *         # Fast when only a single iterator remains
 *         if self.shortcut is not None:             # <<<<<<<<<<<<<<
 *             if self.shortcut is True:
 *                 item = self.pq[0]
 */
  __pyx_t_1 = (__pyx_v_self->shortcut != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":188
 *         # Fast when only a single iterator remains
 *         if self.shortcut is not None:
 *             if self.shortcut is True:             # <<<<<<<<<<<<<<
 *                 item = self.pq[0]
 *                 self.shortcut = item[2]
 */
    __pyx_t_2 = (__pyx_v_self->shortcut == Py_True);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":189
 *         if self.shortcut is not None:
 *             if self.shortcut is True:
 *                 item = self.pq[0]             # <<<<<<<<<<<<<<
 *                 self.shortcut = item[2]
 *                 return item[0]
 */
      if (unlikely(__pyx_v_self->pq == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->pq, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_item = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytoolz/itertoolz.pyx":190
 *             if self.shortcut is True:
 *                 item = self.pq[0]
 *                 self.shortcut = item[2]             # <<<<<<<<<<<<<<
 *                 return item[0]
 *             return next(self.shortcut)
 */
      if (unlikely(__pyx_v_item == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_item, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->shortcut);
      __Pyx_DECREF(__pyx_v_self->shortcut);
      __pyx_v_self->shortcut = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cytoolz/itertoolz.pyx":191
 *                 item = self.pq[0]
 *                 self.shortcut = item[2]
 *                 return item[0]             # <<<<<<<<<<<<<<
 *             return next(self.shortcut)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(__pyx_v_item == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_item, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":192
 *                 self.shortcut = item[2]
 *                 return item[0]
 *             return next(self.shortcut)             # <<<<<<<<<<<<<<
 * 
 *         item = self.pq[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_v_self->shortcut;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":194
 *             return next(self.shortcut)
 * 
 *         item = self.pq[0]             # <<<<<<<<<<<<<<
 *         retval = item[0]
 *         it = item[2]
 */
  if (unlikely(__pyx_v_self->pq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->pq, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_item = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytoolz/itertoolz.pyx":195
 * 
 *         item = self.pq[0]
 *         retval = item[0]             # <<<<<<<<<<<<<<
 *         it = item[2]
 *         try:
 */
  if (unlikely(__pyx_v_item == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_item, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_retval = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cytoolz/itertoolz.pyx":196
 *         item = self.pq[0]
 *         retval = item[0]
 *         it = item[2]             # <<<<<<<<<<<<<<
 *         try:
 *             item[0] = next(it)
 */
  if (unlikely(__pyx_v_item == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_item, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_it = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "cytoolz/itertoolz.pyx":197
 *         retval = item[0]
 *         it = item[2]
 *         try:             # <<<<<<<<<<<<<<
 *             item[0] = next(it)
 *             heapreplace(self.pq, item)
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cytoolz/itertoolz.pyx":198
 *         it = item[2]
 *         try:
 *             item[0] = next(it)             # <<<<<<<<<<<<<<
 *             heapreplace(self.pq, item)
 *         except StopIteration:
 */
      __pyx_t_4 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__pyx_v_item == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      if (unlikely(__Pyx_SetItemInt(__pyx_v_item, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cytoolz/itertoolz.pyx":199
 *         try:
 *             item[0] = next(it)
 *             heapreplace(self.pq, item)             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             heappop(self.pq)
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_heapreplace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_self->pq);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->pq);
      __Pyx_GIVEREF(__pyx_v_self->pq);
      __Pyx_INCREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_item);
      __Pyx_GIVEREF(__pyx_v_item);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cytoolz/itertoolz.pyx":200
 *             item[0] = next(it)
 *             heapreplace(self.pq, item)
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             heappop(self.pq)
 *             if PyList_GET_SIZE(self.pq) == 1:
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_4);

      /* "cytoolz/itertoolz.pyx":201
 *             heapreplace(self.pq, item)
 *         except StopIteration:
 *             heappop(self.pq)             # <<<<<<<<<<<<<<
 *             if PyList_GET_SIZE(self.pq) == 1:
 *                 self.shortcut = True
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_self->pq);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self->pq);
      __Pyx_GIVEREF(__pyx_v_self->pq);
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "cytoolz/itertoolz.pyx":202
 *         except StopIteration:
 *             heappop(self.pq)
 *             if PyList_GET_SIZE(self.pq) == 1:             # <<<<<<<<<<<<<<
 *                 self.shortcut = True
 *         return retval
 */
      __pyx_t_12 = __pyx_v_self->pq;
      __Pyx_INCREF(__pyx_t_12);
      __pyx_t_1 = ((PyList_GET_SIZE(__pyx_t_12) == 1) != 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {

        /* "cytoolz/itertoolz.pyx":203
 *             heappop(self.pq)
 *             if PyList_GET_SIZE(self.pq) == 1:
 *                 self.shortcut = True             # <<<<<<<<<<<<<<
 *         return retval
 * 
 */
        __Pyx_INCREF(Py_True);
        __Pyx_GIVEREF(Py_True);
        __Pyx_GOTREF(__pyx_v_self->shortcut);
        __Pyx_DECREF(__pyx_v_self->shortcut);
        __pyx_v_self->shortcut = Py_True;
        goto __pyx_L15;
      }
      __pyx_L15:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_exception_handled;
    }
    goto __pyx_L7_except_error;
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L12_try_end:;
  }

  /* "cytoolz/itertoolz.pyx":204
 *             if PyList_GET_SIZE(self.pq) == 1:
 *                 self.shortcut = True
 *         return retval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_retval);
  __pyx_r = __pyx_v_retval;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":183
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef list item
 *         cdef object retval, it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_retval);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":219
 * 
 * cdef class _merge_sorted_key:
 *     def __cinit__(self, seqs, key):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef object item, it, k
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seqs = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seqs,&__pyx_n_s_key,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_seqs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __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_seqs = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)__pyx_v_self), __pyx_v_seqs, __pyx_v_key);

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

static int __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_key) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_k = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":222
 *         cdef Py_ssize_t i
 *         cdef object item, it, k
 *         self.pq = []             # <<<<<<<<<<<<<<
 *         self.key = key
 *         self.shortcut = None
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pq);
  __Pyx_DECREF(__pyx_v_self->pq);
  __pyx_v_self->pq = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":223
 *         cdef object item, it, k
 *         self.pq = []
 *         self.key = key             # <<<<<<<<<<<<<<
 *         self.shortcut = None
 * 
 */
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  __Pyx_GOTREF(__pyx_v_self->key);
  __Pyx_DECREF(__pyx_v_self->key);
  __pyx_v_self->key = __pyx_v_key;

  /* "cytoolz/itertoolz.pyx":224
 *         self.pq = []
 *         self.key = key
 *         self.shortcut = None             # <<<<<<<<<<<<<<
 * 
 *         for i, item in enumerate(seqs):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->shortcut);
  __Pyx_DECREF(__pyx_v_self->shortcut);
  __pyx_v_self->shortcut = Py_None;

  /* "cytoolz/itertoolz.pyx":226
 *         self.shortcut = None
 * 
 *         for i, item in enumerate(seqs):             # <<<<<<<<<<<<<<
 *             it = iter(item)
 *             try:
 */
  __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_v_seqs) || PyTuple_CheckExact(__pyx_v_seqs)) {
    __pyx_t_1 = __pyx_v_seqs; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);

    /* "cytoolz/itertoolz.pyx":227
 * 
 *         for i, item in enumerate(seqs):
 *             it = iter(item)             # <<<<<<<<<<<<<<
 *             try:
 *                 item = next(it)
 */
    __pyx_t_5 = PyObject_GetIter(__pyx_v_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "cytoolz/itertoolz.pyx":228
 *         for i, item in enumerate(seqs):
 *             it = iter(item)
 *             try:             # <<<<<<<<<<<<<<
 *                 item = next(it)
 *                 k = key(item)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "cytoolz/itertoolz.pyx":229
 *             it = iter(item)
 *             try:
 *                 item = next(it)             # <<<<<<<<<<<<<<
 *                 k = key(item)
 *                 PyList_Append(self.pq, [k, i, item, it])
 */
        __pyx_t_5 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "cytoolz/itertoolz.pyx":230
 *             try:
 *                 item = next(it)
 *                 k = key(item)             # <<<<<<<<<<<<<<
 *                 PyList_Append(self.pq, [k, i, item, it])
 *             except StopIteration:
 */
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_item);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_item);
        __Pyx_GIVEREF(__pyx_v_item);
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_key, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "cytoolz/itertoolz.pyx":231
 *                 item = next(it)
 *                 k = key(item)
 *                 PyList_Append(self.pq, [k, i, item, it])             # <<<<<<<<<<<<<<
 *             except StopIteration:
 *                 pass
 */
        __pyx_t_9 = __pyx_v_self->pq;
        __Pyx_INCREF(__pyx_t_9);
        __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_k);
        PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_k);
        __Pyx_GIVEREF(__pyx_v_k);
        PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_item);
        PyList_SET_ITEM(__pyx_t_10, 2, __pyx_v_item);
        __Pyx_GIVEREF(__pyx_v_item);
        __Pyx_INCREF(__pyx_v_it);
        PyList_SET_ITEM(__pyx_t_10, 3, __pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        __pyx_t_5 = 0;
        __pyx_t_11 = PyList_Append(__pyx_t_9, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "cytoolz/itertoolz.pyx":232
 *                 k = key(item)
 *                 PyList_Append(self.pq, [k, i, item, it])
 *             except StopIteration:             # <<<<<<<<<<<<<<
 *                 pass
 *         i = PyList_GET_SIZE(self.pq)
 */
      __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_11) {
        PyErr_Restore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L12_try_end:;
    }

    /* "cytoolz/itertoolz.pyx":226
 *         self.shortcut = None
 * 
 *         for i, item in enumerate(seqs):             # <<<<<<<<<<<<<<
 *             it = iter(item)
 *             try:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":234
 *             except StopIteration:
 *                 pass
 *         i = PyList_GET_SIZE(self.pq)             # <<<<<<<<<<<<<<
 *         if i == 0:
 *             self.shortcut = iter([])
 */
  __pyx_t_1 = __pyx_v_self->pq;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_i = PyList_GET_SIZE(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":237
 *         if i == 0:
 *             self.shortcut = iter([])
 *         elif i == 1:             # <<<<<<<<<<<<<<
 *             self.shortcut = True
 *         else:
 */
  switch (__pyx_v_i) {

    /* "cytoolz/itertoolz.pyx":235
 *                 pass
 *         i = PyList_GET_SIZE(self.pq)
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             self.shortcut = iter([])
 *         elif i == 1:
 */
    case 0:

    /* "cytoolz/itertoolz.pyx":236
 *         i = PyList_GET_SIZE(self.pq)
 *         if i == 0:
 *             self.shortcut = iter([])             # <<<<<<<<<<<<<<
 *         elif i == 1:
 *             self.shortcut = True
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_10);
    __Pyx_GOTREF(__pyx_v_self->shortcut);
    __Pyx_DECREF(__pyx_v_self->shortcut);
    __pyx_v_self->shortcut = __pyx_t_10;
    __pyx_t_10 = 0;
    break;

    /* "cytoolz/itertoolz.pyx":237
 *         if i == 0:
 *             self.shortcut = iter([])
 *         elif i == 1:             # <<<<<<<<<<<<<<
 *             self.shortcut = True
 *         else:
 */
    case 1:

    /* "cytoolz/itertoolz.pyx":238
 *             self.shortcut = iter([])
 *         elif i == 1:
 *             self.shortcut = True             # <<<<<<<<<<<<<<
 *         else:
 *             heapify(self.pq)
 */
    __Pyx_INCREF(Py_True);
    __Pyx_GIVEREF(Py_True);
    __Pyx_GOTREF(__pyx_v_self->shortcut);
    __Pyx_DECREF(__pyx_v_self->shortcut);
    __pyx_v_self->shortcut = Py_True;
    break;
    default:

    /* "cytoolz/itertoolz.pyx":240
 *             self.shortcut = True
 *         else:
 *             heapify(self.pq)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_heapify); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_self->pq);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->pq);
    __Pyx_GIVEREF(__pyx_v_self->pq);
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    break;
  }

  /* "cytoolz/itertoolz.pyx":219
 * 
 * cdef class _merge_sorted_key:
 *     def __cinit__(self, seqs, key):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef object item, it, k
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":242
 *             heapify(self.pq)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":243
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":242
 *             heapify(self.pq)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":245
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef list item
 *         cdef object retval, it, k
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self) {
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_retval = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_k = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":249
 *         cdef object retval, it, k
 *         # Fast when only a single iterator remains
 *         if self.shortcut is not None:             # <<<<<<<<<<<<<<
 *             if self.shortcut is True:
 *                 item = self.pq[0]
 */
  __pyx_t_1 = (__pyx_v_self->shortcut != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":250
 *         # Fast when only a single iterator remains
 *         if self.shortcut is not None:
 *             if self.shortcut is True:             # <<<<<<<<<<<<<<
 *                 item = self.pq[0]
 *                 self.shortcut = item[3]
 */
    __pyx_t_2 = (__pyx_v_self->shortcut == Py_True);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":251
 *         if self.shortcut is not None:
 *             if self.shortcut is True:
 *                 item = self.pq[0]             # <<<<<<<<<<<<<<
 *                 self.shortcut = item[3]
 *                 return item[2]
 */
      if (unlikely(__pyx_v_self->pq == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->pq, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_item = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytoolz/itertoolz.pyx":252
 *             if self.shortcut is True:
 *                 item = self.pq[0]
 *                 self.shortcut = item[3]             # <<<<<<<<<<<<<<
 *                 return item[2]
 *             retval = next(self.shortcut)
 */
      if (unlikely(__pyx_v_item == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_item, 3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->shortcut);
      __Pyx_DECREF(__pyx_v_self->shortcut);
      __pyx_v_self->shortcut = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cytoolz/itertoolz.pyx":253
 *                 item = self.pq[0]
 *                 self.shortcut = item[3]
 *                 return item[2]             # <<<<<<<<<<<<<<
 *             retval = next(self.shortcut)
 *             return self.key(retval)
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(__pyx_v_item == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_item, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":254
 *                 self.shortcut = item[3]
 *                 return item[2]
 *             retval = next(self.shortcut)             # <<<<<<<<<<<<<<
 *             return self.key(retval)
 * 
 */
    __pyx_t_3 = __pyx_v_self->shortcut;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_retval = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "cytoolz/itertoolz.pyx":255
 *                 return item[2]
 *             retval = next(self.shortcut)
 *             return self.key(retval)             # <<<<<<<<<<<<<<
 * 
 *         item = self.pq[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_retval);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_retval);
    __Pyx_GIVEREF(__pyx_v_retval);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_self->key, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":257
 *             return self.key(retval)
 * 
 *         item = self.pq[0]             # <<<<<<<<<<<<<<
 *         retval = item[2]
 *         it = item[3]
 */
  if (unlikely(__pyx_v_self->pq == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->pq, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_item = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "cytoolz/itertoolz.pyx":258
 * 
 *         item = self.pq[0]
 *         retval = item[2]             # <<<<<<<<<<<<<<
 *         it = item[3]
 *         try:
 */
  if (unlikely(__pyx_v_item == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_item, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_retval = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytoolz/itertoolz.pyx":259
 *         item = self.pq[0]
 *         retval = item[2]
 *         it = item[3]             # <<<<<<<<<<<<<<
 *         try:
 *             k = next(it)
 */
  if (unlikely(__pyx_v_item == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_item, 3, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_it = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytoolz/itertoolz.pyx":260
 *         retval = item[2]
 *         it = item[3]
 *         try:             # <<<<<<<<<<<<<<
 *             k = next(it)
 *             item[2] = k
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "cytoolz/itertoolz.pyx":261
 *         it = item[3]
 *         try:
 *             k = next(it)             # <<<<<<<<<<<<<<
 *             item[2] = k
 *             item[0] = self.key(k)
 */
      __pyx_t_3 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_k = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cytoolz/itertoolz.pyx":262
 *         try:
 *             k = next(it)
 *             item[2] = k             # <<<<<<<<<<<<<<
 *             item[0] = self.key(k)
 *             heapreplace(self.pq, item)
 */
      if (unlikely(__pyx_v_item == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      if (unlikely(__Pyx_SetItemInt(__pyx_v_item, 2, __pyx_v_k, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_error;}

      /* "cytoolz/itertoolz.pyx":263
 *             k = next(it)
 *             item[2] = k
 *             item[0] = self.key(k)             # <<<<<<<<<<<<<<
 *             heapreplace(self.pq, item)
 *         except StopIteration:
 */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_k);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_k);
      __Pyx_GIVEREF(__pyx_v_k);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_self->key, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(__pyx_v_item == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      if (unlikely(__Pyx_SetItemInt(__pyx_v_item, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cytoolz/itertoolz.pyx":264
 *             item[2] = k
 *             item[0] = self.key(k)
 *             heapreplace(self.pq, item)             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             heappop(self.pq)
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_heapreplace); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_self->pq);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->pq);
      __Pyx_GIVEREF(__pyx_v_self->pq);
      __Pyx_INCREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_item);
      __Pyx_GIVEREF(__pyx_v_item);
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "cytoolz/itertoolz.pyx":265
 *             item[0] = self.key(k)
 *             heapreplace(self.pq, item)
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             heappop(self.pq)
 *             if PyList_GET_SIZE(self.pq) == 1:
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_4);

      /* "cytoolz/itertoolz.pyx":266
 *             heapreplace(self.pq, item)
 *         except StopIteration:
 *             heappop(self.pq)             # <<<<<<<<<<<<<<
 *             if PyList_GET_SIZE(self.pq) == 1:
 *                 self.shortcut = True
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_heappop); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_self->pq);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self->pq);
      __Pyx_GIVEREF(__pyx_v_self->pq);
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "cytoolz/itertoolz.pyx":267
 *         except StopIteration:
 *             heappop(self.pq)
 *             if PyList_GET_SIZE(self.pq) == 1:             # <<<<<<<<<<<<<<
 *                 self.shortcut = True
 *         return retval
 */
      __pyx_t_12 = __pyx_v_self->pq;
      __Pyx_INCREF(__pyx_t_12);
      __pyx_t_1 = ((PyList_GET_SIZE(__pyx_t_12) == 1) != 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {

        /* "cytoolz/itertoolz.pyx":268
 *             heappop(self.pq)
 *             if PyList_GET_SIZE(self.pq) == 1:
 *                 self.shortcut = True             # <<<<<<<<<<<<<<
 *         return retval
 * 
 */
        __Pyx_INCREF(Py_True);
        __Pyx_GIVEREF(Py_True);
        __Pyx_GOTREF(__pyx_v_self->shortcut);
        __Pyx_DECREF(__pyx_v_self->shortcut);
        __pyx_v_self->shortcut = Py_True;
        goto __pyx_L15;
      }
      __pyx_L15:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_exception_handled;
    }
    goto __pyx_L7_except_error;
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L12_try_end:;
  }

  /* "cytoolz/itertoolz.pyx":269
 *             if PyList_GET_SIZE(self.pq) == 1:
 *                 self.shortcut = True
 *         return retval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_retval);
  __pyx_r = __pyx_v_retval;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":245
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef list item
 *         cdef object retval, it, k
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_retval);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":272
 * 
 * 
 * cdef object c_merge_sorted(object seqs, object key=None):             # <<<<<<<<<<<<<<
 *     if key is None:
 *         return _merge_sorted(seqs)
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_c_merge_sorted(PyObject *__pyx_v_seqs, struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted *__pyx_optional_args) {
  PyObject *__pyx_v_key = ((PyObject *)Py_None);
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_merge_sorted", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_key = __pyx_optional_args->key;
    }
  }

  /* "cytoolz/itertoolz.pyx":273
 * 
 * cdef object c_merge_sorted(object seqs, object key=None):
 *     if key is None:             # <<<<<<<<<<<<<<
 *         return _merge_sorted(seqs)
 *     return _merge_sorted_key(seqs, key)
 */
  __pyx_t_1 = (__pyx_v_key == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":274
 * cdef object c_merge_sorted(object seqs, object key=None):
 *     if key is None:
 *         return _merge_sorted(seqs)             # <<<<<<<<<<<<<<
 *     return _merge_sorted_key(seqs, key)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_seqs);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seqs);
    __Pyx_GIVEREF(__pyx_v_seqs);
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__merge_sorted)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":275
 *     if key is None:
 *         return _merge_sorted(seqs)
 *     return _merge_sorted_key(seqs, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_seqs);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_seqs);
  __Pyx_GIVEREF(__pyx_v_seqs);
  __Pyx_INCREF(__pyx_v_key);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":272
 * 
 * 
 * cdef object c_merge_sorted(object seqs, object key=None):             # <<<<<<<<<<<<<<
 *     if key is None:
 *         return _merge_sorted(seqs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytoolz.itertoolz.c_merge_sorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":278
 * 
 * 
 * def merge_sorted(*seqs, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Merge and sort a collection of sorted collections
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_5merge_sorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_4merge_sorted[] = "merge_sorted(*seqs, **kwargs)\n\n    Merge and sort a collection of sorted collections\n\n    This works lazily and only keeps one value from each iterable in memory.\n\n    >>> list(merge_sorted([1, 3, 5], [2, 4, 6]))\n    [1, 2, 3, 4, 5, 6]\n\n    >>> ''.join(merge_sorted('abc', 'abc', 'abc'))\n    'aaabbbccc'\n\n    The \"key\" function used to sort the input may be passed as a keyword.\n\n    >>> list(merge_sorted([2, 3], [1, 3], key=lambda x: x // 3))\n    [2, 1, 3, 3]\n    ";
static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_5merge_sorted = {__Pyx_NAMESTR("merge_sorted"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_5merge_sorted, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_4merge_sorted)};
static PyObject *__pyx_pw_7cytoolz_9itertoolz_5merge_sorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seqs = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("merge_sorted (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "merge_sorted", 1))) return NULL;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __Pyx_INCREF(__pyx_args);
  __pyx_v_seqs = __pyx_args;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_4merge_sorted(__pyx_self, __pyx_v_seqs, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_4merge_sorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("merge_sorted", 0);

  /* "cytoolz/itertoolz.pyx":295
 *     [2, 1, 3, 3]
 *     """
 *     if 'key' in kwargs:             # <<<<<<<<<<<<<<
 *         return c_merge_sorted(seqs, kwargs['key'])
 *     return c_merge_sorted(seqs)
 */
  __pyx_t_1 = (__Pyx_PyDict_Contains(__pyx_n_s_key, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":296
 *     """
 *     if 'key' in kwargs:
 *         return c_merge_sorted(seqs, kwargs['key'])             # <<<<<<<<<<<<<<
 *     return c_merge_sorted(seqs)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_key); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.key = __pyx_t_3;
    __pyx_t_4 = __pyx_f_7cytoolz_9itertoolz_c_merge_sorted(__pyx_v_seqs, &__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":297
 *     if 'key' in kwargs:
 *         return c_merge_sorted(seqs, kwargs['key'])
 *     return c_merge_sorted(seqs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7cytoolz_9itertoolz_c_merge_sorted(__pyx_v_seqs, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":278
 * 
 * 
 * def merge_sorted(*seqs, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Merge and sort a collection of sorted collections
 */

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

/* "cytoolz/itertoolz.pyx":315
 *     Returns a lazy iterator
 *     """
 *     def __cinit__(self, seqs, pass_exceptions=()):             # <<<<<<<<<<<<<<
 *         self.iters = [iter(seq) for seq in seqs]
 *         self.newiters = []
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_10interleave_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_10interleave_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seqs = 0;
  PyObject *__pyx_v_pass_exceptions = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seqs,&__pyx_n_s_pass_exceptions,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_empty_tuple);
    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_seqs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pass_exceptions);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __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_seqs = values[0];
    __pyx_v_pass_exceptions = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.interleave.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10interleave___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)__pyx_v_self), __pyx_v_seqs, __pyx_v_pass_exceptions);

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

static int __pyx_pf_7cytoolz_9itertoolz_10interleave___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_pass_exceptions) {
  PyObject *__pyx_v_seq = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":316
 *     """
 *     def __cinit__(self, seqs, pass_exceptions=()):
 *         self.iters = [iter(seq) for seq in seqs]             # <<<<<<<<<<<<<<
 *         self.newiters = []
 *         self.pass_exceptions = tuple(pass_exceptions)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyList_CheckExact(__pyx_v_seqs) || PyTuple_CheckExact(__pyx_v_seqs)) {
    __pyx_t_2 = __pyx_v_seqs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iters);
  __Pyx_DECREF(__pyx_v_self->iters);
  __pyx_v_self->iters = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":317
 *     def __cinit__(self, seqs, pass_exceptions=()):
 *         self.iters = [iter(seq) for seq in seqs]
 *         self.newiters = []             # <<<<<<<<<<<<<<
 *         self.pass_exceptions = tuple(pass_exceptions)
 *         self.i = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->newiters);
  __Pyx_DECREF(__pyx_v_self->newiters);
  __pyx_v_self->newiters = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":318
 *         self.iters = [iter(seq) for seq in seqs]
 *         self.newiters = []
 *         self.pass_exceptions = tuple(pass_exceptions)             # <<<<<<<<<<<<<<
 *         self.i = 0
 *         self.n = PyList_GET_SIZE(self.iters)
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_pass_exceptions);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pass_exceptions);
  __Pyx_GIVEREF(__pyx_v_pass_exceptions);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->pass_exceptions);
  __Pyx_DECREF(__pyx_v_self->pass_exceptions);
  __pyx_v_self->pass_exceptions = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":319
 *         self.newiters = []
 *         self.pass_exceptions = tuple(pass_exceptions)
 *         self.i = 0             # <<<<<<<<<<<<<<
 *         self.n = PyList_GET_SIZE(self.iters)
 * 
 */
  __pyx_v_self->i = 0;

  /* "cytoolz/itertoolz.pyx":320
 *         self.pass_exceptions = tuple(pass_exceptions)
 *         self.i = 0
 *         self.n = PyList_GET_SIZE(self.iters)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_2 = __pyx_v_self->iters;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_self->n = PyList_GET_SIZE(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":315
 *     Returns a lazy iterator
 *     """
 *     def __cinit__(self, seqs, pass_exceptions=()):             # <<<<<<<<<<<<<<
 *         self.iters = [iter(seq) for seq in seqs]
 *         self.newiters = []
 */

  /* 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_5);
  __Pyx_AddTraceback("cytoolz.itertoolz.interleave.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":322
 *         self.n = PyList_GET_SIZE(self.iters)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10interleave_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":323
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":322
 *         self.n = PyList_GET_SIZE(self.iters)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":325
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         # This implementation is similar to what is done in `toolz` in that we
 *         # construct a new list of iterators, `self.newiters`, when a value is
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10interleave_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self) {
  PyObject *__pyx_v_obj;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":332
 *         cdef object val
 * 
 *         if self.i == self.n:             # <<<<<<<<<<<<<<
 *             self.n = PyList_GET_SIZE(self.newiters)
 *             self.i = 0
 */
  __pyx_t_1 = ((__pyx_v_self->i == __pyx_v_self->n) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":333
 * 
 *         if self.i == self.n:
 *             self.n = PyList_GET_SIZE(self.newiters)             # <<<<<<<<<<<<<<
 *             self.i = 0
 *             if self.n == 0:
 */
    __pyx_t_2 = __pyx_v_self->newiters;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_self->n = PyList_GET_SIZE(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cytoolz/itertoolz.pyx":334
 *         if self.i == self.n:
 *             self.n = PyList_GET_SIZE(self.newiters)
 *             self.i = 0             # <<<<<<<<<<<<<<
 *             if self.n == 0:
 *                 raise StopIteration
 */
    __pyx_v_self->i = 0;

    /* "cytoolz/itertoolz.pyx":335
 *             self.n = PyList_GET_SIZE(self.newiters)
 *             self.i = 0
 *             if self.n == 0:             # <<<<<<<<<<<<<<
 *                 raise StopIteration
 *             self.iters = self.newiters
 */
    __pyx_t_1 = ((__pyx_v_self->n == 0) != 0);
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":336
 *             self.i = 0
 *             if self.n == 0:
 *                 raise StopIteration             # <<<<<<<<<<<<<<
 *             self.iters = self.newiters
 *             self.newiters = []
 */
      __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cytoolz/itertoolz.pyx":337
 *             if self.n == 0:
 *                 raise StopIteration
 *             self.iters = self.newiters             # <<<<<<<<<<<<<<
 *             self.newiters = []
 *         val = <object>PyList_GET_ITEM(self.iters, self.i)
 */
    __pyx_t_2 = __pyx_v_self->newiters;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->iters);
    __Pyx_DECREF(__pyx_v_self->iters);
    __pyx_v_self->iters = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytoolz/itertoolz.pyx":338
 *                 raise StopIteration
 *             self.iters = self.newiters
 *             self.newiters = []             # <<<<<<<<<<<<<<
 *         val = <object>PyList_GET_ITEM(self.iters, self.i)
 *         self.i += 1
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->newiters);
    __Pyx_DECREF(__pyx_v_self->newiters);
    __pyx_v_self->newiters = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":339
 *             self.iters = self.newiters
 *             self.newiters = []
 *         val = <object>PyList_GET_ITEM(self.iters, self.i)             # <<<<<<<<<<<<<<
 *         self.i += 1
 *         obj = PtrIter_Next(val)
 */
  __pyx_t_2 = __pyx_v_self->iters;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_v_self->i);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_t_3);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":340
 *             self.newiters = []
 *         val = <object>PyList_GET_ITEM(self.iters, self.i)
 *         self.i += 1             # <<<<<<<<<<<<<<
 *         obj = PtrIter_Next(val)
 * 
 */
  __pyx_v_self->i = (__pyx_v_self->i + 1);

  /* "cytoolz/itertoolz.pyx":341
 *         val = <object>PyList_GET_ITEM(self.iters, self.i)
 *         self.i += 1
 *         obj = PtrIter_Next(val)             # <<<<<<<<<<<<<<
 * 
 *         while obj is NULL:
 */
  __pyx_v_obj = PyIter_Next(__pyx_v_val);

  /* "cytoolz/itertoolz.pyx":343
 *         obj = PtrIter_Next(val)
 * 
 *         while obj is NULL:             # <<<<<<<<<<<<<<
 *             obj = PyErr_Occurred()
 *             if obj is not NULL:
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
    if (!__pyx_t_1) break;

    /* "cytoolz/itertoolz.pyx":344
 * 
 *         while obj is NULL:
 *             obj = PyErr_Occurred()             # <<<<<<<<<<<<<<
 *             if obj is not NULL:
 *                 val = <object>obj
 */
    __pyx_v_obj = PyErr_Occurred();

    /* "cytoolz/itertoolz.pyx":345
 *         while obj is NULL:
 *             obj = PyErr_Occurred()
 *             if obj is not NULL:             # <<<<<<<<<<<<<<
 *                 val = <object>obj
 *                 if not PyErr_GivenExceptionMatches(val, self.pass_exceptions):
 */
    __pyx_t_1 = ((__pyx_v_obj != NULL) != 0);
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":346
 *             obj = PyErr_Occurred()
 *             if obj is not NULL:
 *                 val = <object>obj             # <<<<<<<<<<<<<<
 *                 if not PyErr_GivenExceptionMatches(val, self.pass_exceptions):
 *                     raise val
 */
      __pyx_t_2 = ((PyObject *)__pyx_v_obj);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytoolz/itertoolz.pyx":347
 *             if obj is not NULL:
 *                 val = <object>obj
 *                 if not PyErr_GivenExceptionMatches(val, self.pass_exceptions):             # <<<<<<<<<<<<<<
 *                     raise val
 *                 PyErr_Clear()
 */
      __pyx_t_2 = __pyx_v_self->pass_exceptions;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_1 = ((!(PyErr_GivenExceptionMatches(__pyx_v_val, __pyx_t_2) != 0)) != 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "cytoolz/itertoolz.pyx":348
 *                 val = <object>obj
 *                 if not PyErr_GivenExceptionMatches(val, self.pass_exceptions):
 *                     raise val             # <<<<<<<<<<<<<<
 *                 PyErr_Clear()
 * 
 */
        __Pyx_Raise(__pyx_v_val, 0, 0, 0);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "cytoolz/itertoolz.pyx":349
 *                 if not PyErr_GivenExceptionMatches(val, self.pass_exceptions):
 *                     raise val
 *                 PyErr_Clear()             # <<<<<<<<<<<<<<
 * 
 *             if self.i == self.n:
 */
      PyErr_Clear();
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "cytoolz/itertoolz.pyx":351
 *                 PyErr_Clear()
 * 
 *             if self.i == self.n:             # <<<<<<<<<<<<<<
 *                 self.n = PyList_GET_SIZE(self.newiters)
 *                 self.i = 0
 */
    __pyx_t_1 = ((__pyx_v_self->i == __pyx_v_self->n) != 0);
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":352
 * 
 *             if self.i == self.n:
 *                 self.n = PyList_GET_SIZE(self.newiters)             # <<<<<<<<<<<<<<
 *                 self.i = 0
 *                 if self.n == 0:
 */
      __pyx_t_2 = __pyx_v_self->newiters;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_self->n = PyList_GET_SIZE(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "cytoolz/itertoolz.pyx":353
 *             if self.i == self.n:
 *                 self.n = PyList_GET_SIZE(self.newiters)
 *                 self.i = 0             # <<<<<<<<<<<<<<
 *                 if self.n == 0:
 *                     raise StopIteration
 */
      __pyx_v_self->i = 0;

      /* "cytoolz/itertoolz.pyx":354
 *                 self.n = PyList_GET_SIZE(self.newiters)
 *                 self.i = 0
 *                 if self.n == 0:             # <<<<<<<<<<<<<<
 *                     raise StopIteration
 *                 self.iters = self.newiters
 */
      __pyx_t_1 = ((__pyx_v_self->n == 0) != 0);
      if (__pyx_t_1) {

        /* "cytoolz/itertoolz.pyx":355
 *                 self.i = 0
 *                 if self.n == 0:
 *                     raise StopIteration             # <<<<<<<<<<<<<<
 *                 self.iters = self.newiters
 *                 self.newiters = []
 */
        __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "cytoolz/itertoolz.pyx":356
 *                 if self.n == 0:
 *                     raise StopIteration
 *                 self.iters = self.newiters             # <<<<<<<<<<<<<<
 *                 self.newiters = []
 *             val = <object>PyList_GET_ITEM(self.iters, self.i)
 */
      __pyx_t_2 = __pyx_v_self->newiters;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->iters);
      __Pyx_DECREF(__pyx_v_self->iters);
      __pyx_v_self->iters = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "cytoolz/itertoolz.pyx":357
 *                     raise StopIteration
 *                 self.iters = self.newiters
 *                 self.newiters = []             # <<<<<<<<<<<<<<
 *             val = <object>PyList_GET_ITEM(self.iters, self.i)
 *             self.i += 1
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->newiters);
      __Pyx_DECREF(__pyx_v_self->newiters);
      __pyx_v_self->newiters = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "cytoolz/itertoolz.pyx":358
 *                 self.iters = self.newiters
 *                 self.newiters = []
 *             val = <object>PyList_GET_ITEM(self.iters, self.i)             # <<<<<<<<<<<<<<
 *             self.i += 1
 *             obj = PtrIter_Next(val)
 */
    __pyx_t_2 = __pyx_v_self->iters;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_v_self->i);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytoolz/itertoolz.pyx":359
 *                 self.newiters = []
 *             val = <object>PyList_GET_ITEM(self.iters, self.i)
 *             self.i += 1             # <<<<<<<<<<<<<<
 *             obj = PtrIter_Next(val)
 * 
 */
    __pyx_v_self->i = (__pyx_v_self->i + 1);

    /* "cytoolz/itertoolz.pyx":360
 *             val = <object>PyList_GET_ITEM(self.iters, self.i)
 *             self.i += 1
 *             obj = PtrIter_Next(val)             # <<<<<<<<<<<<<<
 * 
 *         PyList_Append(self.newiters, val)
 */
    __pyx_v_obj = PyIter_Next(__pyx_v_val);
  }

  /* "cytoolz/itertoolz.pyx":362
 *             obj = PtrIter_Next(val)
 * 
 *         PyList_Append(self.newiters, val)             # <<<<<<<<<<<<<<
 *         val = <object>obj
 *         Py_XDECREF(obj)
 */
  __pyx_t_2 = __pyx_v_self->newiters;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = PyList_Append(__pyx_t_2, __pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":363
 * 
 *         PyList_Append(self.newiters, val)
 *         val = <object>obj             # <<<<<<<<<<<<<<
 *         Py_XDECREF(obj)
 *         return val
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_obj);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":364
 *         PyList_Append(self.newiters, val)
 *         val = <object>obj
 *         Py_XDECREF(obj)             # <<<<<<<<<<<<<<
 *         return val
 * 
 */
  Py_XDECREF(__pyx_v_obj);

  /* "cytoolz/itertoolz.pyx":365
 *         val = <object>obj
 *         Py_XDECREF(obj)
 *         return val             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_val);
  __pyx_r = __pyx_v_val;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":325
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         # This implementation is similar to what is done in `toolz` in that we
 *         # construct a new list of iterators, `self.newiters`, when a value is
 */

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

/* "cytoolz/itertoolz.pyx":369
 * 
 * cdef class _unique_key:
 *     def __cinit__(self, object seq, object key):             # <<<<<<<<<<<<<<
 *         self.iter_seq = iter(seq)
 *         self.key = key
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_11_unique_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_11_unique_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__pyx_n_s_key,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_seq)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __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_seq = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._unique_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_unique_key___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)__pyx_v_self), __pyx_v_seq, __pyx_v_key);

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

static int __pyx_pf_7cytoolz_9itertoolz_11_unique_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_key) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":370
 * cdef class _unique_key:
 *     def __cinit__(self, object seq, object key):
 *         self.iter_seq = iter(seq)             # <<<<<<<<<<<<<<
 *         self.key = key
 *         self.seen = set()
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iter_seq);
  __Pyx_DECREF(__pyx_v_self->iter_seq);
  __pyx_v_self->iter_seq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":371
 *     def __cinit__(self, object seq, object key):
 *         self.iter_seq = iter(seq)
 *         self.key = key             # <<<<<<<<<<<<<<
 *         self.seen = set()
 * 
 */
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_GIVEREF(__pyx_v_key);
  __Pyx_GOTREF(__pyx_v_self->key);
  __Pyx_DECREF(__pyx_v_self->key);
  __pyx_v_self->key = __pyx_v_key;

  /* "cytoolz/itertoolz.pyx":372
 *         self.iter_seq = iter(seq)
 *         self.key = key
 *         self.seen = set()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->seen);
  __Pyx_DECREF(__pyx_v_self->seen);
  __pyx_v_self->seen = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":369
 * 
 * cdef class _unique_key:
 *     def __cinit__(self, object seq, object key):             # <<<<<<<<<<<<<<
 *         self.iter_seq = iter(seq)
 *         self.key = key
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._unique_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":374
 *         self.seen = set()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_unique_key_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":375
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":374
 *         self.seen = set()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":377
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object item, tag
 *         item = next(self.iter_seq)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_unique_key_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self) {
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_tag = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":379
 *     def __next__(self):
 *         cdef object item, tag
 *         item = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *         tag = self.key(item)
 *         while PySet_Contains(self.seen, tag):
 */
  __pyx_t_1 = __pyx_v_self->iter_seq;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_item = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":380
 *         cdef object item, tag
 *         item = next(self.iter_seq)
 *         tag = self.key(item)             # <<<<<<<<<<<<<<
 *         while PySet_Contains(self.seen, tag):
 *             item = next(self.iter_seq)
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_item);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_item);
  __Pyx_GIVEREF(__pyx_v_item);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->key, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tag = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":381
 *         item = next(self.iter_seq)
 *         tag = self.key(item)
 *         while PySet_Contains(self.seen, tag):             # <<<<<<<<<<<<<<
 *             item = next(self.iter_seq)
 *             tag = self.key(item)
 */
  while (1) {
    __pyx_t_1 = __pyx_v_self->seen;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = PySet_Contains(__pyx_t_1, __pyx_v_tag); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (!__pyx_t_4) break;

    /* "cytoolz/itertoolz.pyx":382
 *         tag = self.key(item)
 *         while PySet_Contains(self.seen, tag):
 *             item = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *             tag = self.key(item)
 *         PySet_Add(self.seen, tag)
 */
    __pyx_t_1 = __pyx_v_self->iter_seq;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "cytoolz/itertoolz.pyx":383
 *         while PySet_Contains(self.seen, tag):
 *             item = next(self.iter_seq)
 *             tag = self.key(item)             # <<<<<<<<<<<<<<
 *         PySet_Add(self.seen, tag)
 *         return item
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_self->key, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "cytoolz/itertoolz.pyx":384
 *             item = next(self.iter_seq)
 *             tag = self.key(item)
 *         PySet_Add(self.seen, tag)             # <<<<<<<<<<<<<<
 *         return item
 * 
 */
  __pyx_t_1 = __pyx_v_self->seen;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = PySet_Add(__pyx_t_1, __pyx_v_tag); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":385
 *             tag = self.key(item)
 *         PySet_Add(self.seen, tag)
 *         return item             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_item);
  __pyx_r = __pyx_v_item;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":377
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object item, tag
 *         item = next(self.iter_seq)
 */

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

/* "cytoolz/itertoolz.pyx":389
 * 
 * cdef class _unique_identity:
 *     def __cinit__(self, object seq):             # <<<<<<<<<<<<<<
 *         self.iter_seq = iter(seq)
 *         self.seen = set()
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_seq)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_seq = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._unique_identity.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_unique_identity___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)__pyx_v_self), __pyx_v_seq);

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

static int __pyx_pf_7cytoolz_9itertoolz_16_unique_identity___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self, PyObject *__pyx_v_seq) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":390
 * cdef class _unique_identity:
 *     def __cinit__(self, object seq):
 *         self.iter_seq = iter(seq)             # <<<<<<<<<<<<<<
 *         self.seen = set()
 * 
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iter_seq);
  __Pyx_DECREF(__pyx_v_self->iter_seq);
  __pyx_v_self->iter_seq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":391
 *     def __cinit__(self, object seq):
 *         self.iter_seq = iter(seq)
 *         self.seen = set()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->seen);
  __Pyx_DECREF(__pyx_v_self->seen);
  __pyx_v_self->seen = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":389
 * 
 * cdef class _unique_identity:
 *     def __cinit__(self, object seq):             # <<<<<<<<<<<<<<
 *         self.iter_seq = iter(seq)
 *         self.seen = set()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._unique_identity.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":393
 *         self.seen = set()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_unique_identity_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":394
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":393
 *         self.seen = set()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":396
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object item
 *         item = next(self.iter_seq)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_unique_identity_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self) {
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":398
 *     def __next__(self):
 *         cdef object item
 *         item = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *         while PySet_Contains(self.seen, item):
 *             item = next(self.iter_seq)
 */
  __pyx_t_1 = __pyx_v_self->iter_seq;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_item = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":399
 *         cdef object item
 *         item = next(self.iter_seq)
 *         while PySet_Contains(self.seen, item):             # <<<<<<<<<<<<<<
 *             item = next(self.iter_seq)
 *         PySet_Add(self.seen, item)
 */
  while (1) {
    __pyx_t_2 = __pyx_v_self->seen;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PySet_Contains(__pyx_t_2, __pyx_v_item); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (!__pyx_t_4) break;

    /* "cytoolz/itertoolz.pyx":400
 *         item = next(self.iter_seq)
 *         while PySet_Contains(self.seen, item):
 *             item = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *         PySet_Add(self.seen, item)
 *         return item
 */
    __pyx_t_2 = __pyx_v_self->iter_seq;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "cytoolz/itertoolz.pyx":401
 *         while PySet_Contains(self.seen, item):
 *             item = next(self.iter_seq)
 *         PySet_Add(self.seen, item)             # <<<<<<<<<<<<<<
 *         return item
 * 
 */
  __pyx_t_1 = __pyx_v_self->seen;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = PySet_Add(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":402
 *             item = next(self.iter_seq)
 *         PySet_Add(self.seen, item)
 *         return item             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_item);
  __pyx_r = __pyx_v_item;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":396
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object item
 *         item = next(self.iter_seq)
 */

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

/* "cytoolz/itertoolz.pyx":405
 * 
 * 
 * cpdef object unique(object seq, object key=identity):             # <<<<<<<<<<<<<<
 *     """
 *     Return only unique elements of a sequence
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_7unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_unique(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_unique *__pyx_optional_args) {
  PyObject *__pyx_v_key = __pyx_k_;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_key = __pyx_optional_args->key;
    }
  }

  /* "cytoolz/itertoolz.pyx":419
 *     ('cat', 'mouse')
 *     """
 *     if key is identity:             # <<<<<<<<<<<<<<
 *         return _unique_identity(seq)
 *     else:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_identity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_key == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cytoolz/itertoolz.pyx":420
 *     """
 *     if key is identity:
 *         return _unique_identity(seq)             # <<<<<<<<<<<<<<
 *     else:
 *         return _unique_key(seq, key)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_seq);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq);
    __Pyx_GIVEREF(__pyx_v_seq);
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__unique_identity)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":422
 *         return _unique_identity(seq)
 *     else:
 *         return _unique_key(seq, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_seq);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_seq);
    __Pyx_GIVEREF(__pyx_v_seq);
    __Pyx_INCREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__unique_key)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":405
 * 
 * 
 * cpdef object unique(object seq, object key=identity):             # <<<<<<<<<<<<<<
 *     """
 *     Return only unique elements of a sequence
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytoolz.itertoolz.unique", __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_7cytoolz_9itertoolz_7unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_6unique[] = "unique(seq, key=identity)\n\n    Return only unique elements of a sequence\n\n    >>> tuple(unique((1, 2, 3)))\n    (1, 2, 3)\n    >>> tuple(unique((1, 2, 1, 3)))\n    (1, 2, 3)\n\n    Uniqueness can be defined by key keyword\n\n    >>> tuple(unique(['cat', 'mouse', 'dog', 'hen'], key=len))\n    ('cat', 'mouse')\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_7unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_key = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unique (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__pyx_n_s_key,0};
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_;
    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_seq)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __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_seq = values[0];
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("unique", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6unique(__pyx_self, __pyx_v_seq, __pyx_v_key);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_6unique(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytoolz_9itertoolz_unique __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.key = __pyx_v_key;
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_unique(__pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":425
 * 
 * 
 * cpdef object isiterable(object x):             # <<<<<<<<<<<<<<
 *     """
 *     Is x iterable?
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_9isiterable(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_isiterable(PyObject *__pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isiterable", 0);

  /* "cytoolz/itertoolz.pyx":436
 *     False
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         iter(x)
 *         return True
 */
  {
    __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:*/ {

      /* "cytoolz/itertoolz.pyx":437
 *     """
 *     try:
 *         iter(x)             # <<<<<<<<<<<<<<
 *         return True
 *     except TypeError:
 */
      __pyx_t_4 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "cytoolz/itertoolz.pyx":438
 *     try:
 *         iter(x)
 *         return True             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         pass
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L7_try_return;
    }
    __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "cytoolz/itertoolz.pyx":439
 *         iter(x)
 *         return True
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         pass
 *     return False
 */
    __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_5) {
      PyErr_Restore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  /* "cytoolz/itertoolz.pyx":441
 *     except TypeError:
 *         pass
 *     return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":425
 * 
 * 
 * cpdef object isiterable(object x):             # <<<<<<<<<<<<<<
 *     """
 *     Is x iterable?
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytoolz.itertoolz.isiterable", __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_7cytoolz_9itertoolz_9isiterable(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_8isiterable[] = "isiterable(x)\n\n    Is x iterable?\n\n    >>> isiterable([1, 2, 3])\n    True\n    >>> isiterable('abc')\n    True\n    >>> isiterable(5)\n    False\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_9isiterable(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isiterable (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_8isiterable(__pyx_self, ((PyObject *)__pyx_v_x));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_8isiterable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isiterable", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_isiterable(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.isiterable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":444
 * 
 * 
 * cpdef object isdistinct(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     All values in sequence are distinct
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_11isdistinct(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_isdistinct(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_seen = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isdistinct", 0);

  /* "cytoolz/itertoolz.pyx":458
 *     True
 *     """
 *     if iter(seq) is seq:             # <<<<<<<<<<<<<<
 *         seen = set()
 *         for item in seq:
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == __pyx_v_seq);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cytoolz/itertoolz.pyx":459
 *     """
 *     if iter(seq) is seq:
 *         seen = set()             # <<<<<<<<<<<<<<
 *         for item in seq:
 *             if PySet_Contains(seen, item):
 */
    __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_seen = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":460
 *     if iter(seq) is seq:
 *         seen = set()
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             if PySet_Contains(seen, item):
 *                 return False
 */
    if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
      __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cytoolz/itertoolz.pyx":461
 *         seen = set()
 *         for item in seq:
 *             if PySet_Contains(seen, item):             # <<<<<<<<<<<<<<
 *                 return False
 *             seen.add(item)
 */
      __pyx_t_3 = PySet_Contains(__pyx_v_seen, __pyx_v_item); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "cytoolz/itertoolz.pyx":462
 *         for item in seq:
 *             if PySet_Contains(seen, item):
 *                 return False             # <<<<<<<<<<<<<<
 *             seen.add(item)
 *         return True
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }

      /* "cytoolz/itertoolz.pyx":463
 *             if PySet_Contains(seen, item):
 *                 return False
 *             seen.add(item)             # <<<<<<<<<<<<<<
 *         return True
 *     else:
 */
      __pyx_t_7 = PySet_Add(__pyx_v_seen, __pyx_v_item); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "cytoolz/itertoolz.pyx":460
 *     if iter(seq) is seq:
 *         seen = set()
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             if PySet_Contains(seen, item):
 *                 return False
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":464
 *                 return False
 *             seen.add(item)
 *         return True             # <<<<<<<<<<<<<<
 *     else:
 *         return len(seq) == len(set(seq))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":466
 *         return True
 *     else:
 *         return len(seq) == len(set(seq))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PySet_New(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PySet_Size(__pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_4 == __pyx_t_8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":444
 * 
 * 
 * cpdef object isdistinct(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     All values in sequence are distinct
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytoolz.itertoolz.isdistinct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seen);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11isdistinct(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_10isdistinct[] = "isdistinct(seq)\n\n    All values in sequence are distinct\n\n    >>> isdistinct([1, 2, 3])\n    True\n    >>> isdistinct([1, 2, 1])\n    False\n\n    >>> isdistinct(\"Hello\")\n    False\n    >>> isdistinct(\"World\")\n    True\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11isdistinct(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isdistinct (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10isdistinct(__pyx_self, ((PyObject *)__pyx_v_seq));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_10isdistinct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isdistinct", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_isdistinct(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.isdistinct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":469
 * 
 * 
 * cpdef object take(Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The first n elements of a sequence
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_13take(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_take(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take", 0);

  /* "cytoolz/itertoolz.pyx":476
 *     [10, 20]
 *     """
 *     return islice(seq, n)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_islice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __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;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":469
 * 
 * 
 * cpdef object take(Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The first n elements of a sequence
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytoolz.itertoolz.take", __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_7cytoolz_9itertoolz_13take(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_12take[] = "take(Py_ssize_t n, seq)\n\n    The first n elements of a sequence\n\n    >>> list(take(2, [10, 20, 30, 40, 50]))\n    [10, 20]\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13take(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12take(__pyx_self, __pyx_v_n, __pyx_v_seq);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_12take(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_take(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":479
 * 
 * 
 * cpdef object drop(Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The sequence following the first n elements
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_15drop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_drop(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_iter_seq = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("drop", 0);

  /* "cytoolz/itertoolz.pyx":486
 *     [30, 40, 50]
 *     """
 *     if n < 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('n argument for drop() must be non-negative')
 *     cdef Py_ssize_t i
 */
  __pyx_t_1 = ((__pyx_v_n < 0) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":487
 *     """
 *     if n < 0:
 *         raise ValueError('n argument for drop() must be non-negative')             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i
 *     cdef object iter_seq
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cytoolz/itertoolz.pyx":490
 *     cdef Py_ssize_t i
 *     cdef object iter_seq
 *     iter_seq = iter(seq)             # <<<<<<<<<<<<<<
 *     try:
 *         for i in range(n):
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_iter_seq = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":491
 *     cdef object iter_seq
 *     iter_seq = iter(seq)
 *     try:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             next(iter_seq)
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "cytoolz/itertoolz.pyx":492
 *     iter_seq = iter(seq)
 *     try:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             next(iter_seq)
 *     except StopIteration:
 */
      __pyx_t_6 = __pyx_v_n;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;

        /* "cytoolz/itertoolz.pyx":493
 *     try:
 *         for i in range(n):
 *             next(iter_seq)             # <<<<<<<<<<<<<<
 *     except StopIteration:
 *         pass
 */
        __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_iter_seq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__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;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "cytoolz/itertoolz.pyx":494
 *         for i in range(n):
 *             next(iter_seq)
 *     except StopIteration:             # <<<<<<<<<<<<<<
 *         pass
 *     return iter_seq
 */
    __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_8) {
      PyErr_Restore(0,0,0);
      goto __pyx_L5_exception_handled;
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L5_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L11_try_end:;
  }

  /* "cytoolz/itertoolz.pyx":496
 *     except StopIteration:
 *         pass
 *     return iter_seq             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_iter_seq);
  __pyx_r = __pyx_v_iter_seq;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":479
 * 
 * 
 * cpdef object drop(Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The sequence following the first n elements
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytoolz.itertoolz.drop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_iter_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_15drop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_14drop[] = "drop(Py_ssize_t n, seq)\n\n    The sequence following the first n elements\n\n    >>> list(drop(2, [10, 20, 30, 40, 50]))\n    [30, 40, 50]\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_15drop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("drop (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("drop", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("drop", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.drop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14drop(__pyx_self, __pyx_v_n, __pyx_v_seq);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_14drop(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("drop", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_drop(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.drop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":499
 * 
 * 
 * cpdef object take_nth(Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Every nth item in seq
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_17take_nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_take_nth(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_nth", 0);

  /* "cytoolz/itertoolz.pyx":506
 *     [10, 30, 50]
 *     """
 *     return islice(seq, 0, None, n)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_islice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":499
 * 
 * 
 * cpdef object take_nth(Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Every nth item in seq
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytoolz.itertoolz.take_nth", __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_7cytoolz_9itertoolz_17take_nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_16take_nth[] = "take_nth(Py_ssize_t n, seq)\n\n    Every nth item in seq\n\n    >>> list(take_nth(2, [10, 20, 30, 40, 50]))\n    [10, 30, 50]\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_17take_nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_nth (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_nth", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_nth") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_nth", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.take_nth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16take_nth(__pyx_self, __pyx_v_n, __pyx_v_seq);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_16take_nth(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_nth", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_take_nth(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.take_nth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":509
 * 
 * 
 * cpdef object first(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The first element in a sequence
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_19first(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_first(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("first", 0);

  /* "cytoolz/itertoolz.pyx":516
 *     'A'
 *     """
 *     return next(iter(seq))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __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;

  /* "cytoolz/itertoolz.pyx":509
 * 
 * 
 * cpdef object first(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The first element in a sequence
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytoolz.itertoolz.first", __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_7cytoolz_9itertoolz_19first(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_18first[] = "first(seq)\n\n    The first element in a sequence\n\n    >>> first('ABC')\n    'A'\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_19first(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("first (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_18first(__pyx_self, ((PyObject *)__pyx_v_seq));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_18first(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("first", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_first(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.first", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":519
 * 
 * 
 * cpdef object second(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The second element in a sequence
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_21second(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_second(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("second", 0);
  __Pyx_INCREF(__pyx_v_seq);

  /* "cytoolz/itertoolz.pyx":526
 *     'B'
 *     """
 *     seq = iter(seq)             # <<<<<<<<<<<<<<
 *     next(seq)
 *     return next(seq)
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":527
 *     """
 *     seq = iter(seq)
 *     next(seq)             # <<<<<<<<<<<<<<
 *     return next(seq)
 * 
 */
  __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":528
 *     seq = iter(seq)
 *     next(seq)
 *     return next(seq)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":519
 * 
 * 
 * cpdef object second(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The second element in a sequence
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz.second", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_21second(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_20second[] = "second(seq)\n\n    The second element in a sequence\n\n    >>> second('ABC')\n    'B'\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_21second(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("second (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20second(__pyx_self, ((PyObject *)__pyx_v_seq));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_20second(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("second", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_second(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.second", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":531
 * 
 * 
 * cpdef object nth(Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The nth element in a sequence
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_23nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_nth(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nth", 0);
  __Pyx_INCREF(__pyx_v_seq);

  /* "cytoolz/itertoolz.pyx":538
 *     'B'
 *     """
 *     if PySequence_Check(seq):             # <<<<<<<<<<<<<<
 *         return seq[n]
 *     seq = iter(seq)
 */
  __pyx_t_1 = (PySequence_Check(__pyx_v_seq) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":539
 *     """
 *     if PySequence_Check(seq):
 *         return seq[n]             # <<<<<<<<<<<<<<
 *     seq = iter(seq)
 *     while n > 0:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_seq, __pyx_v_n, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":540
 *     if PySequence_Check(seq):
 *         return seq[n]
 *     seq = iter(seq)             # <<<<<<<<<<<<<<
 *     while n > 0:
 *         n -= 1
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":541
 *         return seq[n]
 *     seq = iter(seq)
 *     while n > 0:             # <<<<<<<<<<<<<<
 *         n -= 1
 *         next(seq)
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_n > 0) != 0);
    if (!__pyx_t_1) break;

    /* "cytoolz/itertoolz.pyx":542
 *     seq = iter(seq)
 *     while n > 0:
 *         n -= 1             # <<<<<<<<<<<<<<
 *         next(seq)
 *     return next(seq)
 */
    __pyx_v_n = (__pyx_v_n - 1);

    /* "cytoolz/itertoolz.pyx":543
 *     while n > 0:
 *         n -= 1
 *         next(seq)             # <<<<<<<<<<<<<<
 *     return next(seq)
 * 
 */
    __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "cytoolz/itertoolz.pyx":544
 *         n -= 1
 *         next(seq)
 *     return next(seq)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":531
 * 
 * 
 * cpdef object nth(Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The nth element in a sequence
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytoolz.itertoolz.nth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_23nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_22nth[] = "nth(Py_ssize_t n, seq)\n\n    The nth element in a sequence\n\n    >>> nth(1, 'ABC')\n    'B'\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_23nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nth (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("nth", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nth") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nth", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.nth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_22nth(__pyx_self, __pyx_v_n, __pyx_v_seq);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_22nth(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("nth", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_nth(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.nth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":550
 * 
 * 
 * cpdef object last(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The last element in a sequence
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_25last(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_last(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("last", 0);

  /* "cytoolz/itertoolz.pyx":558
 *     """
 *     cdef object val
 *     if PySequence_Check(seq):             # <<<<<<<<<<<<<<
 *         return seq[-1]
 *     val = no_default
 */
  __pyx_t_1 = (PySequence_Check(__pyx_v_seq) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":559
 *     cdef object val
 *     if PySequence_Check(seq):
 *         return seq[-1]             # <<<<<<<<<<<<<<
 *     val = no_default
 *     for val in seq:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_seq, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":560
 *     if PySequence_Check(seq):
 *         return seq[-1]
 *     val = no_default             # <<<<<<<<<<<<<<
 *     for val in seq:
 *         pass
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":561
 *         return seq[-1]
 *     val = no_default
 *     for val in seq:             # <<<<<<<<<<<<<<
 *         pass
 *     if val is no_default:
 */
  if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
    __pyx_t_2 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_5);
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":563
 *     for val in seq:
 *         pass
 *     if val is no_default:             # <<<<<<<<<<<<<<
 *         raise IndexError
 *     return val
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__pyx_v_val == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "cytoolz/itertoolz.pyx":564
 *         pass
 *     if val is no_default:
 *         raise IndexError             # <<<<<<<<<<<<<<
 *     return val
 * 
 */
    __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cytoolz/itertoolz.pyx":565
 *     if val is no_default:
 *         raise IndexError
 *     return val             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_val);
  __pyx_r = __pyx_v_val;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":550
 * 
 * 
 * cpdef object last(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     The last element in a sequence
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("cytoolz.itertoolz.last", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_25last(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_24last[] = "last(seq)\n\n    The last element in a sequence\n\n    >>> last('ABC')\n    'C'\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_25last(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("last (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_24last(__pyx_self, ((PyObject *)__pyx_v_seq));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_24last(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("last", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_last(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.last", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":568
 * 
 * 
 * cpdef object rest(object seq):             # <<<<<<<<<<<<<<
 *     seq = iter(seq)
 *     next(seq)
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_27rest(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_rest(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rest", 0);
  __Pyx_INCREF(__pyx_v_seq);

  /* "cytoolz/itertoolz.pyx":569
 * 
 * cpdef object rest(object seq):
 *     seq = iter(seq)             # <<<<<<<<<<<<<<
 *     next(seq)
 *     return seq
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":570
 * cpdef object rest(object seq):
 *     seq = iter(seq)
 *     next(seq)             # <<<<<<<<<<<<<<
 *     return seq
 * 
 */
  __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":571
 *     seq = iter(seq)
 *     next(seq)
 *     return seq             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_seq);
  __pyx_r = __pyx_v_seq;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":568
 * 
 * 
 * cpdef object rest(object seq):             # <<<<<<<<<<<<<<
 *     seq = iter(seq)
 *     next(seq)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz.rest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_27rest(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_26rest[] = "rest(seq)";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_27rest(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rest (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_26rest(__pyx_self, ((PyObject *)__pyx_v_seq));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_26rest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rest", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_rest(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.rest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":578
 * 
 * 
 * cpdef object get(object ind, object seq, object default=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     Get element in a sequence or dict
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_29get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_get(PyObject *__pyx_v_ind, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_get *__pyx_optional_args) {
  PyObject *__pyx_v_default = __pyx_k__3;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_obj;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default = __pyx_optional_args->__pyx_default;
    }
  }

  /* "cytoolz/itertoolz.pyx":616
 *     cdef tuple result
 *     cdef PyObject *obj
 *     if isinstance(ind, list):             # <<<<<<<<<<<<<<
 *         i = PyList_GET_SIZE(ind)
 *         result = PyTuple_New(i)
 */
  __pyx_t_1 = PyList_Check(__pyx_v_ind); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":617
 *     cdef PyObject *obj
 *     if isinstance(ind, list):
 *         i = PyList_GET_SIZE(ind)             # <<<<<<<<<<<<<<
 *         result = PyTuple_New(i)
 *         # List of indices, no default
 */
    __pyx_v_i = PyList_GET_SIZE(__pyx_v_ind);

    /* "cytoolz/itertoolz.pyx":618
 *     if isinstance(ind, list):
 *         i = PyList_GET_SIZE(ind)
 *         result = PyTuple_New(i)             # <<<<<<<<<<<<<<
 *         # List of indices, no default
 *         if default is no_default:
 */
    __pyx_t_3 = PyTuple_New(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_result = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":620
 *         result = PyTuple_New(i)
 *         # List of indices, no default
 *         if default is no_default:             # <<<<<<<<<<<<<<
 *             for i, val in enumerate(ind):
 *                 val = seq[val]
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = (__pyx_v_default == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":621
 *         # List of indices, no default
 *         if default is no_default:
 *             for i, val in enumerate(ind):             # <<<<<<<<<<<<<<
 *                 val = seq[val]
 *                 Py_INCREF(val)
 */
      __pyx_t_4 = 0;
      if (PyList_CheckExact(__pyx_v_ind) || PyTuple_CheckExact(__pyx_v_ind)) {
        __pyx_t_3 = __pyx_v_ind; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
      }
      for (;;) {
        if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_7 = __pyx_t_6(__pyx_t_3);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_v_i = __pyx_t_4;
        __pyx_t_4 = (__pyx_t_4 + 1);

        /* "cytoolz/itertoolz.pyx":622
 *         if default is no_default:
 *             for i, val in enumerate(ind):
 *                 val = seq[val]             # <<<<<<<<<<<<<<
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)
 */
        __pyx_t_7 = PyObject_GetItem(__pyx_v_seq, __pyx_v_val); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cytoolz/itertoolz.pyx":623
 *             for i, val in enumerate(ind):
 *                 val = seq[val]
 *                 Py_INCREF(val)             # <<<<<<<<<<<<<<
 *                 PyTuple_SET_ITEM(result, i, val)
 *             return result
 */
        Py_INCREF(__pyx_v_val);

        /* "cytoolz/itertoolz.pyx":624
 *                 val = seq[val]
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
        PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val);

        /* "cytoolz/itertoolz.pyx":621
 *         # List of indices, no default
 *         if default is no_default:
 *             for i, val in enumerate(ind):             # <<<<<<<<<<<<<<
 *                 val = seq[val]
 *                 Py_INCREF(val)
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "cytoolz/itertoolz.pyx":625
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         # List of indices with default
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":628
 * 
 *         # List of indices with default
 *         for i, val in enumerate(ind):             # <<<<<<<<<<<<<<
 *             obj = PtrObject_GetItem(seq, val)
 *             if obj is NULL:
 */
    __pyx_t_4 = 0;
    if (PyList_CheckExact(__pyx_v_ind) || PyTuple_CheckExact(__pyx_v_ind)) {
      __pyx_t_3 = __pyx_v_ind; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "cytoolz/itertoolz.pyx":629
 *         # List of indices with default
 *         for i, val in enumerate(ind):
 *             obj = PtrObject_GetItem(seq, val)             # <<<<<<<<<<<<<<
 *             if obj is NULL:
 *                 if not PyErr_ExceptionMatches(_get_list_exc):
 */
      __pyx_v_obj = PyObject_GetItem(__pyx_v_seq, __pyx_v_val);

      /* "cytoolz/itertoolz.pyx":630
 *         for i, val in enumerate(ind):
 *             obj = PtrObject_GetItem(seq, val)
 *             if obj is NULL:             # <<<<<<<<<<<<<<
 *                 if not PyErr_ExceptionMatches(_get_list_exc):
 *                     raise <object>PyErr_Occurred()
 */
      __pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
      if (__pyx_t_1) {

        /* "cytoolz/itertoolz.pyx":631
 *             obj = PtrObject_GetItem(seq, val)
 *             if obj is NULL:
 *                 if not PyErr_ExceptionMatches(_get_list_exc):             # <<<<<<<<<<<<<<
 *                     raise <object>PyErr_Occurred()
 *                 PyErr_Clear()
 */
        __pyx_t_7 = __pyx_v_7cytoolz_9itertoolz__get_list_exc;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_1 = ((!(PyErr_ExceptionMatches(__pyx_t_7) != 0)) != 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__pyx_t_1) {

          /* "cytoolz/itertoolz.pyx":632
 *             if obj is NULL:
 *                 if not PyErr_ExceptionMatches(_get_list_exc):
 *                     raise <object>PyErr_Occurred()             # <<<<<<<<<<<<<<
 *                 PyErr_Clear()
 *                 Py_INCREF(default)
 */
          __pyx_t_8 = PyErr_Occurred();
          __Pyx_Raise(((PyObject *)__pyx_t_8), 0, 0, 0);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }

        /* "cytoolz/itertoolz.pyx":633
 *                 if not PyErr_ExceptionMatches(_get_list_exc):
 *                     raise <object>PyErr_Occurred()
 *                 PyErr_Clear()             # <<<<<<<<<<<<<<
 *                 Py_INCREF(default)
 *                 PyTuple_SET_ITEM(result, i, default)
 */
        PyErr_Clear();

        /* "cytoolz/itertoolz.pyx":634
 *                     raise <object>PyErr_Occurred()
 *                 PyErr_Clear()
 *                 Py_INCREF(default)             # <<<<<<<<<<<<<<
 *                 PyTuple_SET_ITEM(result, i, default)
 *             else:
 */
        Py_INCREF(__pyx_v_default);

        /* "cytoolz/itertoolz.pyx":635
 *                 PyErr_Clear()
 *                 Py_INCREF(default)
 *                 PyTuple_SET_ITEM(result, i, default)             # <<<<<<<<<<<<<<
 *             else:
 *                 val = <object>obj
 */
        PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_default);
        goto __pyx_L9;
      }
      /*else*/ {

        /* "cytoolz/itertoolz.pyx":637
 *                 PyTuple_SET_ITEM(result, i, default)
 *             else:
 *                 val = <object>obj             # <<<<<<<<<<<<<<
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)
 */
        __pyx_t_7 = ((PyObject *)__pyx_v_obj);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cytoolz/itertoolz.pyx":638
 *             else:
 *                 val = <object>obj
 *                 Py_INCREF(val)             # <<<<<<<<<<<<<<
 *                 PyTuple_SET_ITEM(result, i, val)
 *         return result
 */
        Py_INCREF(__pyx_v_val);

        /* "cytoolz/itertoolz.pyx":639
 *                 val = <object>obj
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
        PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val);
      }
      __pyx_L9:;

      /* "cytoolz/itertoolz.pyx":628
 * 
 *         # List of indices with default
 *         for i, val in enumerate(ind):             # <<<<<<<<<<<<<<
 *             obj = PtrObject_GetItem(seq, val)
 *             if obj is NULL:
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":640
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     obj = PtrObject_GetItem(seq, ind)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_result);
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":642
 *         return result
 * 
 *     obj = PtrObject_GetItem(seq, ind)             # <<<<<<<<<<<<<<
 *     if obj is NULL:
 *         val = <object>PyErr_Occurred()
 */
  __pyx_v_obj = PyObject_GetItem(__pyx_v_seq, __pyx_v_ind);

  /* "cytoolz/itertoolz.pyx":643
 * 
 *     obj = PtrObject_GetItem(seq, ind)
 *     if obj is NULL:             # <<<<<<<<<<<<<<
 *         val = <object>PyErr_Occurred()
 *         if default is no_default:
 */
  __pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":644
 *     obj = PtrObject_GetItem(seq, ind)
 *     if obj is NULL:
 *         val = <object>PyErr_Occurred()             # <<<<<<<<<<<<<<
 *         if default is no_default:
 *             raise val
 */
    __pyx_t_8 = PyErr_Occurred();
    __pyx_t_3 = ((PyObject *)__pyx_t_8);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_val = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":645
 *     if obj is NULL:
 *         val = <object>PyErr_Occurred()
 *         if default is no_default:             # <<<<<<<<<<<<<<
 *             raise val
 *         if PyErr_GivenExceptionMatches(val, _get_exceptions):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = (__pyx_v_default == __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "cytoolz/itertoolz.pyx":646
 *         val = <object>PyErr_Occurred()
 *         if default is no_default:
 *             raise val             # <<<<<<<<<<<<<<
 *         if PyErr_GivenExceptionMatches(val, _get_exceptions):
 *             PyErr_Clear()
 */
      __Pyx_Raise(__pyx_v_val, 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cytoolz/itertoolz.pyx":647
 *         if default is no_default:
 *             raise val
 *         if PyErr_GivenExceptionMatches(val, _get_exceptions):             # <<<<<<<<<<<<<<
 *             PyErr_Clear()
 *             return default
 */
    __pyx_t_3 = __pyx_v_7cytoolz_9itertoolz__get_exceptions;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = (PyErr_GivenExceptionMatches(__pyx_v_val, __pyx_t_3) != 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "cytoolz/itertoolz.pyx":648
 *             raise val
 *         if PyErr_GivenExceptionMatches(val, _get_exceptions):
 *             PyErr_Clear()             # <<<<<<<<<<<<<<
 *             return default
 *         raise val
 */
      PyErr_Clear();

      /* "cytoolz/itertoolz.pyx":649
 *         if PyErr_GivenExceptionMatches(val, _get_exceptions):
 *             PyErr_Clear()
 *             return default             # <<<<<<<<<<<<<<
 *         raise val
 *     return <object>obj
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_default);
      __pyx_r = __pyx_v_default;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":650
 *             PyErr_Clear()
 *             return default
 *         raise val             # <<<<<<<<<<<<<<
 *     return <object>obj
 * 
 */
    __Pyx_Raise(__pyx_v_val, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cytoolz/itertoolz.pyx":651
 *             return default
 *         raise val
 *     return <object>obj             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_obj));
  __pyx_r = ((PyObject *)__pyx_v_obj);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":578
 * 
 * 
 * cpdef object get(object ind, object seq, object default=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     Get element in a sequence or dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytoolz.itertoolz.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_29get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_28get[] = "get(ind, seq, default=no_default)\n\n    Get element in a sequence or dict\n\n    Provides standard indexing\n\n    >>> get(1, 'ABC')       # Same as 'ABC'[1]\n    'B'\n\n    Pass a list to get multiple values\n\n    >>> get([1, 2], 'ABC')  # ('ABC'[1], 'ABC'[2])\n    ('B', 'C')\n\n    Works on any value that supports indexing/getitem\n    For example here we see that it works with dictionaries\n\n    >>> phonebook = {'Alice':  '555-1234',\n    ...              'Bob':    '555-5678',\n    ...              'Charlie':'555-9999'}\n    >>> get('Alice', phonebook)\n    '555-1234'\n\n    >>> get(['Alice', 'Bob'], phonebook)\n    ('555-1234', '555-5678')\n\n    Provide a default for missing values\n\n    >>> get(['Alice', 'Dennis'], phonebook, None)\n    ('555-1234', None)\n\n    See Also:\n        pluck\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_29get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ind = 0;
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seq,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k__3;
    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_ind)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __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_ind = values[0];
    __pyx_v_seq = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_28get(__pyx_self, __pyx_v_ind, __pyx_v_seq, __pyx_v_default);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_28get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seq, PyObject *__pyx_v_default) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytoolz_9itertoolz_get __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.__pyx_default = __pyx_v_default;
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_get(__pyx_v_ind, __pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":654
 * 
 * 
 * cpdef object mapcat(object func, object seqs):             # <<<<<<<<<<<<<<
 *     """
 *     Apply func to each sequence in seqs, concatenating results.
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_31mapcat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_mapcat(PyObject *__pyx_v_func, PyObject *__pyx_v_seqs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapcat", 0);

  /* "cytoolz/itertoolz.pyx":662
 *     ['A', 'B', 'C', 'D', 'E']
 *     """
 *     return concat(map(func, seqs))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_concat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_map); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_func);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  __Pyx_INCREF(__pyx_v_seqs);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_seqs);
  __Pyx_GIVEREF(__pyx_v_seqs);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":654
 * 
 * 
 * cpdef object mapcat(object func, object seqs):             # <<<<<<<<<<<<<<
 *     """
 *     Apply func to each sequence in seqs, concatenating results.
 */

  /* 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("cytoolz.itertoolz.mapcat", __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_7cytoolz_9itertoolz_31mapcat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_30mapcat[] = "mapcat(func, seqs)\n\n    Apply func to each sequence in seqs, concatenating results.\n\n    >>> list(mapcat(lambda s: [c.upper() for c in s],\n    ...             [[\"a\", \"b\"], [\"c\", \"d\", \"e\"]]))\n    ['A', 'B', 'C', 'D', 'E']\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_31mapcat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_seqs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mapcat (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_seqs,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_func)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mapcat", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapcat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_func = values[0];
    __pyx_v_seqs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mapcat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.mapcat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_30mapcat(__pyx_self, __pyx_v_func, __pyx_v_seqs);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_30mapcat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_seqs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mapcat", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_mapcat(__pyx_v_func, __pyx_v_seqs, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.mapcat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":665
 * 
 * 
 * cpdef object cons(object el, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Add el to beginning of (possibly infinite) sequence seq.
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_33cons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_cons(PyObject *__pyx_v_el, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cons", 0);

  /* "cytoolz/itertoolz.pyx":672
 *     [1, 2, 3]
 *     """
 *     return chain((el,), seq)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_chain); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_el);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_el);
  __Pyx_GIVEREF(__pyx_v_el);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_seq);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_seq);
  __Pyx_GIVEREF(__pyx_v_seq);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __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;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":665
 * 
 * 
 * cpdef object cons(object el, object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Add el to beginning of (possibly infinite) sequence seq.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytoolz.itertoolz.cons", __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_7cytoolz_9itertoolz_33cons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_32cons[] = "cons(el, seq)\n\n    Add el to beginning of (possibly infinite) sequence seq.\n\n    >>> list(cons(1, [2, 3]))\n    [1, 2, 3]\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_33cons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_el = 0;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cons (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_el,&__pyx_n_s_seq,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_el)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cons", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cons") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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_el = values[0];
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cons", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.cons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_32cons(__pyx_self, __pyx_v_el, __pyx_v_seq);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_32cons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_el, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cons", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_cons(__pyx_v_el, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.cons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":683
 *     [1, 'a', 2, 'a', 3]
 *     """
 *     def __cinit__(self, object el, object seq):             # <<<<<<<<<<<<<<
 *         self.el = el
 *         self.iter_seq = iter(seq)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_9interpose_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_9interpose_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_el = 0;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_el,&__pyx_n_s_seq,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_el)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __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_el = values[0];
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9interpose___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)__pyx_v_self), __pyx_v_el, __pyx_v_seq);

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

static int __pyx_pf_7cytoolz_9itertoolz_9interpose___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self, PyObject *__pyx_v_el, PyObject *__pyx_v_seq) {
  int __pyx_r;
  __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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":684
 *     """
 *     def __cinit__(self, object el, object seq):
 *         self.el = el             # <<<<<<<<<<<<<<
 *         self.iter_seq = iter(seq)
 *         self.do_el = False
 */
  __Pyx_INCREF(__pyx_v_el);
  __Pyx_GIVEREF(__pyx_v_el);
  __Pyx_GOTREF(__pyx_v_self->el);
  __Pyx_DECREF(__pyx_v_self->el);
  __pyx_v_self->el = __pyx_v_el;

  /* "cytoolz/itertoolz.pyx":685
 *     def __cinit__(self, object el, object seq):
 *         self.el = el
 *         self.iter_seq = iter(seq)             # <<<<<<<<<<<<<<
 *         self.do_el = False
 *         try:
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iter_seq);
  __Pyx_DECREF(__pyx_v_self->iter_seq);
  __pyx_v_self->iter_seq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":686
 *         self.el = el
 *         self.iter_seq = iter(seq)
 *         self.do_el = False             # <<<<<<<<<<<<<<
 *         try:
 *             self.val = next(self.iter_seq)
 */
  __pyx_v_self->do_el = 0;

  /* "cytoolz/itertoolz.pyx":687
 *         self.iter_seq = iter(seq)
 *         self.do_el = False
 *         try:             # <<<<<<<<<<<<<<
 *             self.val = next(self.iter_seq)
 *         except StopIteration:
 */
  {
    __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:*/ {

      /* "cytoolz/itertoolz.pyx":688
 *         self.do_el = False
 *         try:
 *             self.val = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             self.do_el = True
 */
      __pyx_t_1 = __pyx_v_self->iter_seq;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->val);
      __Pyx_DECREF(__pyx_v_self->val);
      __pyx_v_self->val = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __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_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "cytoolz/itertoolz.pyx":689
 *         try:
 *             self.val = next(self.iter_seq)
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             self.do_el = True
 * 
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_7);

      /* "cytoolz/itertoolz.pyx":690
 *             self.val = next(self.iter_seq)
 *         except StopIteration:
 *             self.do_el = True             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
      __pyx_v_self->do_el = 1;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;
    __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_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:;
  }

  /* "cytoolz/itertoolz.pyx":683
 *     [1, 'a', 2, 'a', 3]
 *     """
 *     def __cinit__(self, object el, object seq):             # <<<<<<<<<<<<<<
 *         self.el = el
 *         self.iter_seq = iter(seq)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":692
 *             self.do_el = True
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9interpose_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":693
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":692
 *             self.do_el = True
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":695
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.do_el:
 *             self.val = next(self.iter_seq)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9interpose_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":696
 * 
 *     def __next__(self):
 *         if self.do_el:             # <<<<<<<<<<<<<<
 *             self.val = next(self.iter_seq)
 *             self.do_el = False
 */
  __pyx_t_1 = (__pyx_v_self->do_el != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":697
 *     def __next__(self):
 *         if self.do_el:
 *             self.val = next(self.iter_seq)             # <<<<<<<<<<<<<<
 *             self.do_el = False
 *             return self.el
 */
    __pyx_t_2 = __pyx_v_self->iter_seq;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->val);
    __Pyx_DECREF(__pyx_v_self->val);
    __pyx_v_self->val = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":698
 *         if self.do_el:
 *             self.val = next(self.iter_seq)
 *             self.do_el = False             # <<<<<<<<<<<<<<
 *             return self.el
 *         else:
 */
    __pyx_v_self->do_el = 0;

    /* "cytoolz/itertoolz.pyx":699
 *             self.val = next(self.iter_seq)
 *             self.do_el = False
 *             return self.el             # <<<<<<<<<<<<<<
 *         else:
 *             self.do_el = True
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->el);
    __pyx_r = __pyx_v_self->el;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":701
 *             return self.el
 *         else:
 *             self.do_el = True             # <<<<<<<<<<<<<<
 *             return self.val
 * 
 */
    __pyx_v_self->do_el = 1;

    /* "cytoolz/itertoolz.pyx":702
 *         else:
 *             self.do_el = True
 *             return self.val             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->val);
    __pyx_r = __pyx_v_self->val;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":695
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.do_el:
 *             self.val = next(self.iter_seq)
 */

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

/* "cytoolz/itertoolz.pyx":705
 * 
 * 
 * cpdef dict frequencies(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Find number of occurrences of each value in seq
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_35frequencies(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_frequencies(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_obj;
  Py_ssize_t __pyx_v_val;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frequencies", 0);

  /* "cytoolz/itertoolz.pyx":716
 *         groupby
 *     """
 *     cdef dict d = {}             # <<<<<<<<<<<<<<
 *     cdef PyObject *obj
 *     cdef Py_ssize_t val
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":719
 *     cdef PyObject *obj
 *     cdef Py_ssize_t val
 *     for item in seq:             # <<<<<<<<<<<<<<
 *         obj = PyDict_GetItem(d, item)
 *         if obj is NULL:
 */
  if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
    __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytoolz/itertoolz.pyx":720
 *     cdef Py_ssize_t val
 *     for item in seq:
 *         obj = PyDict_GetItem(d, item)             # <<<<<<<<<<<<<<
 *         if obj is NULL:
 *             d[item] = 1
 */
    __pyx_v_obj = PyDict_GetItem(__pyx_v_d, __pyx_v_item);

    /* "cytoolz/itertoolz.pyx":721
 *     for item in seq:
 *         obj = PyDict_GetItem(d, item)
 *         if obj is NULL:             # <<<<<<<<<<<<<<
 *             d[item] = 1
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_obj == NULL) != 0);
    if (__pyx_t_5) {

      /* "cytoolz/itertoolz.pyx":722
 *         obj = PyDict_GetItem(d, item)
 *         if obj is NULL:
 *             d[item] = 1             # <<<<<<<<<<<<<<
 *         else:
 *             val = <object>obj
 */
      if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_v_item, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    /*else*/ {

      /* "cytoolz/itertoolz.pyx":724
 *             d[item] = 1
 *         else:
 *             val = <object>obj             # <<<<<<<<<<<<<<
 *             d[item] = val + 1
 *     return d
 */
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(((PyObject *)__pyx_v_obj)); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_val = __pyx_t_6;

      /* "cytoolz/itertoolz.pyx":725
 *         else:
 *             val = <object>obj
 *             d[item] = val + 1             # <<<<<<<<<<<<<<
 *     return d
 * 
 */
      __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_val + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_v_item, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L5:;

    /* "cytoolz/itertoolz.pyx":719
 *     cdef PyObject *obj
 *     cdef Py_ssize_t val
 *     for item in seq:             # <<<<<<<<<<<<<<
 *         obj = PyDict_GetItem(d, item)
 *         if obj is NULL:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":726
 *             val = <object>obj
 *             d[item] = val + 1
 *     return d             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_d);
  __pyx_r = __pyx_v_d;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":705
 * 
 * 
 * cpdef dict frequencies(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Find number of occurrences of each value in seq
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytoolz.itertoolz.frequencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_35frequencies(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_34frequencies[] = "frequencies(seq) -> dict\n\n    Find number of occurrences of each value in seq\n\n    >>> frequencies(['cat', 'cat', 'ox', 'pig', 'pig', 'cat'])  #doctest: +SKIP\n    {'cat': 3, 'ox': 1, 'pig': 2}\n\n    See Also:\n        countby\n        groupby\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_35frequencies(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("frequencies (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_34frequencies(__pyx_self, ((PyObject *)__pyx_v_seq));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_34frequencies(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frequencies", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_frequencies(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.frequencies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":729
 * 
 * 
 * cdef inline object _reduceby_core(dict d, object key, object item, object binop,             # <<<<<<<<<<<<<<
 *                                 object init, bint skip_init):
 *     cdef PyObject *obj = PyDict_GetItem(d, key)
 */

static CYTHON_INLINE PyObject *__pyx_f_7cytoolz_9itertoolz__reduceby_core(PyObject *__pyx_v_d, PyObject *__pyx_v_key, PyObject *__pyx_v_item, PyObject *__pyx_v_binop, PyObject *__pyx_v_init, int __pyx_v_skip_init) {
  PyObject *__pyx_v_obj;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reduceby_core", 0);

  /* "cytoolz/itertoolz.pyx":731
 * cdef inline object _reduceby_core(dict d, object key, object item, object binop,
 *                                 object init, bint skip_init):
 *     cdef PyObject *obj = PyDict_GetItem(d, key)             # <<<<<<<<<<<<<<
 *     if obj is not NULL:
 *         PyDict_SetItem(d, key, binop(<object>obj, item))
 */
  __pyx_v_obj = PyDict_GetItem(__pyx_v_d, __pyx_v_key);

  /* "cytoolz/itertoolz.pyx":732
 *                                 object init, bint skip_init):
 *     cdef PyObject *obj = PyDict_GetItem(d, key)
 *     if obj is not NULL:             # <<<<<<<<<<<<<<
 *         PyDict_SetItem(d, key, binop(<object>obj, item))
 *     elif skip_init:
 */
  __pyx_t_1 = ((__pyx_v_obj != NULL) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":733
 *     cdef PyObject *obj = PyDict_GetItem(d, key)
 *     if obj is not NULL:
 *         PyDict_SetItem(d, key, binop(<object>obj, item))             # <<<<<<<<<<<<<<
 *     elif skip_init:
 *         PyDict_SetItem(d, key, item)
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_obj));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_obj));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_obj));
    __Pyx_INCREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_binop, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }

  /* "cytoolz/itertoolz.pyx":734
 *     if obj is not NULL:
 *         PyDict_SetItem(d, key, binop(<object>obj, item))
 *     elif skip_init:             # <<<<<<<<<<<<<<
 *         PyDict_SetItem(d, key, item)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_skip_init != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":735
 *         PyDict_SetItem(d, key, binop(<object>obj, item))
 *     elif skip_init:
 *         PyDict_SetItem(d, key, item)             # <<<<<<<<<<<<<<
 *     else:
 *         PyDict_SetItem(d, key, binop(init, item))
 */
    __pyx_t_4 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_v_item); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":737
 *         PyDict_SetItem(d, key, item)
 *     else:
 *         PyDict_SetItem(d, key, binop(init, item))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_init);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_init);
    __Pyx_GIVEREF(__pyx_v_init);
    __Pyx_INCREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_item);
    __Pyx_GIVEREF(__pyx_v_item);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_binop, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":729
 * 
 * 
 * cdef inline object _reduceby_core(dict d, object key, object item, object binop,             # <<<<<<<<<<<<<<
 *                                 object init, bint skip_init):
 *     cdef PyObject *obj = PyDict_GetItem(d, key)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytoolz.itertoolz._reduceby_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":740
 * 
 * 
 * cpdef dict reduceby(object key, object binop, object seq, object init=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     Perform a simultaneous groupby and reduction
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_37reduceby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_reduceby(PyObject *__pyx_v_key, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby *__pyx_optional_args) {
  PyObject *__pyx_v_init = __pyx_k__4;
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_keyval = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  int __pyx_v_skip_init;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reduceby", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_init = __pyx_optional_args->init;
    }
  }

  /* "cytoolz/itertoolz.pyx":787
 *     {'CA': 1200000, 'IL': 2100000}
 *     """
 *     cdef dict d = {}             # <<<<<<<<<<<<<<
 *     cdef object item, keyval
 *     cdef Py_ssize_t i, N
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":790
 *     cdef object item, keyval
 *     cdef Py_ssize_t i, N
 *     cdef bint skip_init = init is no_default             # <<<<<<<<<<<<<<
 *     if callable(key):
 *         for item in seq:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_init == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_skip_init = __pyx_t_2;

  /* "cytoolz/itertoolz.pyx":791
 *     cdef Py_ssize_t i, N
 *     cdef bint skip_init = init is no_default
 *     if callable(key):             # <<<<<<<<<<<<<<
 *         for item in seq:
 *             keyval = key(item)
 */
  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_key); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cytoolz/itertoolz.pyx":792
 *     cdef bint skip_init = init is no_default
 *     if callable(key):
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = key(item)
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 */
    if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
      __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "cytoolz/itertoolz.pyx":793
 *     if callable(key):
 *         for item in seq:
 *             keyval = key(item)             # <<<<<<<<<<<<<<
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 *     elif isinstance(key, list):
 */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_item);
      __Pyx_GIVEREF(__pyx_v_item);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_key, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":794
 *         for item in seq:
 *             keyval = key(item)
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)             # <<<<<<<<<<<<<<
 *     elif isinstance(key, list):
 *         N = PyList_GET_SIZE(key)
 */
      __pyx_t_7 = __pyx_f_7cytoolz_9itertoolz__reduceby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item, __pyx_v_binop, __pyx_v_init, __pyx_v_skip_init); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":792
 *     cdef bint skip_init = init is no_default
 *     if callable(key):
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = key(item)
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }

  /* "cytoolz/itertoolz.pyx":795
 *             keyval = key(item)
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 *     elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *         N = PyList_GET_SIZE(key)
 *         for item in seq:
 */
  __pyx_t_3 = PyList_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":796
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 *     elif isinstance(key, list):
 *         N = PyList_GET_SIZE(key)             # <<<<<<<<<<<<<<
 *         for item in seq:
 *             keyval = PyTuple_New(N)
 */
    __pyx_v_N = PyList_GET_SIZE(__pyx_v_key);

    /* "cytoolz/itertoolz.pyx":797
 *     elif isinstance(key, list):
 *         N = PyList_GET_SIZE(key)
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = PyTuple_New(N)
 *             for i in range(N):
 */
    if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
      __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_7 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":798
 *         N = PyList_GET_SIZE(key)
 *         for item in seq:
 *             keyval = PyTuple_New(N)             # <<<<<<<<<<<<<<
 *             for i in range(N):
 *                 val = <object>PyList_GET_ITEM(key, i)
 */
      __pyx_t_7 = PyTuple_New(__pyx_v_N); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":799
 *         for item in seq:
 *             keyval = PyTuple_New(N)
 *             for i in range(N):             # <<<<<<<<<<<<<<
 *                 val = <object>PyList_GET_ITEM(key, i)
 *                 val = item[val]
 */
      __pyx_t_8 = __pyx_v_N;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
        __pyx_v_i = __pyx_t_9;

        /* "cytoolz/itertoolz.pyx":800
 *             keyval = PyTuple_New(N)
 *             for i in range(N):
 *                 val = <object>PyList_GET_ITEM(key, i)             # <<<<<<<<<<<<<<
 *                 val = item[val]
 *                 Py_INCREF(val)
 */
        __pyx_t_10 = PyList_GET_ITEM(__pyx_v_key, __pyx_v_i);
        __pyx_t_7 = ((PyObject *)__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cytoolz/itertoolz.pyx":801
 *             for i in range(N):
 *                 val = <object>PyList_GET_ITEM(key, i)
 *                 val = item[val]             # <<<<<<<<<<<<<<
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(keyval, i, val)
 */
        __pyx_t_7 = PyObject_GetItem(__pyx_v_item, __pyx_v_val); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "cytoolz/itertoolz.pyx":802
 *                 val = <object>PyList_GET_ITEM(key, i)
 *                 val = item[val]
 *                 Py_INCREF(val)             # <<<<<<<<<<<<<<
 *                 PyTuple_SET_ITEM(keyval, i, val)
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 */
        Py_INCREF(__pyx_v_val);

        /* "cytoolz/itertoolz.pyx":803
 *                 val = item[val]
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(keyval, i, val)             # <<<<<<<<<<<<<<
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 *     else:
 */
        PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val);
      }

      /* "cytoolz/itertoolz.pyx":804
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(keyval, i, val)
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)             # <<<<<<<<<<<<<<
 *     else:
 *         for item in seq:
 */
      __pyx_t_7 = __pyx_f_7cytoolz_9itertoolz__reduceby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item, __pyx_v_binop, __pyx_v_init, __pyx_v_skip_init); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":797
 *     elif isinstance(key, list):
 *         N = PyList_GET_SIZE(key)
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = PyTuple_New(N)
 *             for i in range(N):
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":806
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 *     else:
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = item[key]
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 */
    if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
      __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_7 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":807
 *     else:
 *         for item in seq:
 *             keyval = item[key]             # <<<<<<<<<<<<<<
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 *     return d
 */
      __pyx_t_7 = PyObject_GetItem(__pyx_v_item, __pyx_v_key); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":808
 *         for item in seq:
 *             keyval = item[key]
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)             # <<<<<<<<<<<<<<
 *     return d
 * 
 */
      __pyx_t_7 = __pyx_f_7cytoolz_9itertoolz__reduceby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item, __pyx_v_binop, __pyx_v_init, __pyx_v_skip_init); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "cytoolz/itertoolz.pyx":806
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 *     else:
 *         for item in seq:             # <<<<<<<<<<<<<<
 *             keyval = item[key]
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":809
 *             keyval = item[key]
 *             _reduceby_core(d, keyval, item, binop, init, skip_init)
 *     return d             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_d);
  __pyx_r = __pyx_v_d;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":740
 * 
 * 
 * cpdef dict reduceby(object key, object binop, object seq, object init=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     Perform a simultaneous groupby and reduction
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytoolz.itertoolz.reduceby", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_keyval);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_37reduceby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_36reduceby[] = "reduceby(key, binop, seq, init=no_default) -> dict\n\n    Perform a simultaneous groupby and reduction\n\n    The computation:\n\n    >>> result = reduceby(key, binop, seq, init)      # doctest: +SKIP\n\n    is equivalent to the following:\n\n    >>> def reduction(group):                           # doctest: +SKIP\n    ...     return reduce(binop, group, init)           # doctest: +SKIP\n\n    >>> groups = groupby(key, seq)                    # doctest: +SKIP\n    >>> result = valmap(reduction, groups)              # doctest: +SKIP\n\n    But the former does not build the intermediate groups, allowing it to\n    operate in much less space.  This makes it suitable for larger datasets\n    that do not fit comfortably in memory\n\n    Simple Examples\n    ---------------\n\n    >>> from operator import add, mul\n    >>> iseven = lambda x: x % 2 == 0\n\n    >>> data = [1, 2, 3, 4, 5]\n\n    >>> reduceby(iseven, add, data)\n    {False: 9, True: 6}\n\n    >>> reduceby(iseven, mul, data)\n    {False: 15, True: 8}\n\n    Complex Example\n    ---------------\n\n    >>> projects = [{'name': 'build roads', 'state': 'CA', 'cost': 1000000},\n    ...             {'name': 'fight crime', 'state': 'IL', 'cost': 100000},\n    ...             {'name': 'help farmers', 'state': 'IL', 'cost': 2000000},\n    ...             {'name': 'help farmers', 'state': 'CA', 'cost': 200000}]\n\n    >>> reduceby('state',                        # doctest: +SKIP\n    ...          lambda acc, x: acc + x['cost'],\n    ...          projects, 0)\n    {'CA': 1200000, 'IL': 2100000}\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_37reduceby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_binop = 0;
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_init = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reduceby (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_binop,&__pyx_n_s_seq,&__pyx_n_s_init,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k__4;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_binop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reduceby", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reduceby", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_init);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduceby") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_key = values[0];
    __pyx_v_binop = values[1];
    __pyx_v_seq = values[2];
    __pyx_v_init = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reduceby", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.reduceby", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_36reduceby(__pyx_self, __pyx_v_key, __pyx_v_binop, __pyx_v_seq, __pyx_v_init);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_36reduceby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq, PyObject *__pyx_v_init) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reduceby", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.init = __pyx_v_init;
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_reduceby(__pyx_v_key, __pyx_v_binop, __pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.reduceby", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":840
 * 
 *     """
 *     def __cinit__(self, object func, object x):             # <<<<<<<<<<<<<<
 *         self.func = func
 *         self.x = x
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_7iterate_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_7iterate_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_x = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_x,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_func)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_func = values[0];
    __pyx_v_x = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.iterate.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_7iterate___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)__pyx_v_self), __pyx_v_func, __pyx_v_x);

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

static int __pyx_pf_7cytoolz_9itertoolz_7iterate___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_x) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":841
 *     """
 *     def __cinit__(self, object func, object x):
 *         self.func = func             # <<<<<<<<<<<<<<
 *         self.x = x
 *         self.val = self  # sentinel
 */
  __Pyx_INCREF(__pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  __Pyx_GOTREF(__pyx_v_self->func);
  __Pyx_DECREF(__pyx_v_self->func);
  __pyx_v_self->func = __pyx_v_func;

  /* "cytoolz/itertoolz.pyx":842
 *     def __cinit__(self, object func, object x):
 *         self.func = func
 *         self.x = x             # <<<<<<<<<<<<<<
 *         self.val = self  # sentinel
 * 
 */
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_GOTREF(__pyx_v_self->x);
  __Pyx_DECREF(__pyx_v_self->x);
  __pyx_v_self->x = __pyx_v_x;

  /* "cytoolz/itertoolz.pyx":843
 *         self.func = func
 *         self.x = x
 *         self.val = self  # sentinel             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_GOTREF(__pyx_v_self->val);
  __Pyx_DECREF(__pyx_v_self->val);
  __pyx_v_self->val = ((PyObject *)__pyx_v_self);

  /* "cytoolz/itertoolz.pyx":840
 * 
 *     """
 *     def __cinit__(self, object func, object x):             # <<<<<<<<<<<<<<
 *         self.func = func
 *         self.x = x
 */

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

/* "cytoolz/itertoolz.pyx":845
 *         self.val = self  # sentinel
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_7iterate_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":846
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":845
 *         self.val = self  # sentinel
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":848
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.val is self:
 *             self.val = self.x
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_7iterate_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self) {
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":849
 * 
 *     def __next__(self):
 *         if self.val is self:             # <<<<<<<<<<<<<<
 *             self.val = self.x
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->val == ((PyObject *)__pyx_v_self));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":850
 *     def __next__(self):
 *         if self.val is self:
 *             self.val = self.x             # <<<<<<<<<<<<<<
 *         else:
 *             self.x = self.func(self.x)
 */
    __pyx_t_3 = __pyx_v_self->x;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->val);
    __Pyx_DECREF(__pyx_v_self->val);
    __pyx_v_self->val = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":852
 *             self.val = self.x
 *         else:
 *             self.x = self.func(self.x)             # <<<<<<<<<<<<<<
 *         return self.x
 * 
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->x);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->x);
    __Pyx_GIVEREF(__pyx_v_self->x);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_self->func, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->x);
    __Pyx_DECREF(__pyx_v_self->x);
    __pyx_v_self->x = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":853
 *         else:
 *             self.x = self.func(self.x)
 *         return self.x             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->x);
  __pyx_r = __pyx_v_self->x;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":848
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.val is self:
 *             self.val = self.x
 */

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

/* "cytoolz/itertoolz.pyx":871
 *     [1.5, 2.5, 3.5]
 *     """
 *     def __cinit__(self, Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         self.iterseq = iter(seq)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_14sliding_window_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_14sliding_window_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.sliding_window.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14sliding_window___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)__pyx_v_self), __pyx_v_n, __pyx_v_seq);

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

static int __pyx_pf_7cytoolz_9itertoolz_14sliding_window___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) {
  Py_ssize_t __pyx_v_i;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_seq);

  /* "cytoolz/itertoolz.pyx":873
 *     def __cinit__(self, Py_ssize_t n, object seq):
 *         cdef Py_ssize_t i
 *         self.iterseq = iter(seq)             # <<<<<<<<<<<<<<
 *         self.prev = PyTuple_New(n)
 *         for i in range(1, n):
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iterseq);
  __Pyx_DECREF(__pyx_v_self->iterseq);
  __pyx_v_self->iterseq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":874
 *         cdef Py_ssize_t i
 *         self.iterseq = iter(seq)
 *         self.prev = PyTuple_New(n)             # <<<<<<<<<<<<<<
 *         for i in range(1, n):
 *             seq = next(self.iterseq)
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->prev);
  __Pyx_DECREF(__pyx_v_self->prev);
  __pyx_v_self->prev = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":875
 *         self.iterseq = iter(seq)
 *         self.prev = PyTuple_New(n)
 *         for i in range(1, n):             # <<<<<<<<<<<<<<
 *             seq = next(self.iterseq)
 *             Py_INCREF(seq)
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytoolz/itertoolz.pyx":876
 *         self.prev = PyTuple_New(n)
 *         for i in range(1, n):
 *             seq = next(self.iterseq)             # <<<<<<<<<<<<<<
 *             Py_INCREF(seq)
 *             PyTuple_SET_ITEM(self.prev, i, seq)
 */
    __pyx_t_1 = __pyx_v_self->iterseq;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytoolz/itertoolz.pyx":877
 *         for i in range(1, n):
 *             seq = next(self.iterseq)
 *             Py_INCREF(seq)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(self.prev, i, seq)
 *         self.n = n
 */
    Py_INCREF(__pyx_v_seq);

    /* "cytoolz/itertoolz.pyx":878
 *             seq = next(self.iterseq)
 *             Py_INCREF(seq)
 *             PyTuple_SET_ITEM(self.prev, i, seq)             # <<<<<<<<<<<<<<
 *         self.n = n
 * 
 */
    __pyx_t_4 = __pyx_v_self->prev;
    __Pyx_INCREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, __pyx_v_i, __pyx_v_seq);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "cytoolz/itertoolz.pyx":879
 *             Py_INCREF(seq)
 *             PyTuple_SET_ITEM(self.prev, i, seq)
 *         self.n = n             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_v_self->n = __pyx_v_n;

  /* "cytoolz/itertoolz.pyx":871
 *     [1.5, 2.5, 3.5]
 *     """
 *     def __cinit__(self, Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         self.iterseq = iter(seq)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytoolz.itertoolz.sliding_window.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":881
 *         self.n = n
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14sliding_window_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":882
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":881
 *         self.n = n
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":884
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef tuple current
 *         cdef object item
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14sliding_window_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self) {
  PyObject *__pyx_v_current = 0;
  PyObject *__pyx_v_item = 0;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":888
 *         cdef object item
 *         cdef Py_ssize_t i
 *         current = PyTuple_New(self.n)             # <<<<<<<<<<<<<<
 *         for i in range(1, self.n):
 *             item = self.prev[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_current = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":889
 *         cdef Py_ssize_t i
 *         current = PyTuple_New(self.n)
 *         for i in range(1, self.n):             # <<<<<<<<<<<<<<
 *             item = self.prev[i]
 *             Py_INCREF(item)
 */
  __pyx_t_2 = __pyx_v_self->n;
  for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytoolz/itertoolz.pyx":890
 *         current = PyTuple_New(self.n)
 *         for i in range(1, self.n):
 *             item = self.prev[i]             # <<<<<<<<<<<<<<
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(current, i-1, item)
 */
    if (unlikely(__pyx_v_self->prev == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->prev, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":891
 *         for i in range(1, self.n):
 *             item = self.prev[i]
 *             Py_INCREF(item)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(current, i-1, item)
 *         item = next(self.iterseq)
 */
    Py_INCREF(__pyx_v_item);

    /* "cytoolz/itertoolz.pyx":892
 *             item = self.prev[i]
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(current, i-1, item)             # <<<<<<<<<<<<<<
 *         item = next(self.iterseq)
 *         Py_INCREF(item)
 */
    PyTuple_SET_ITEM(__pyx_v_current, (__pyx_v_i - 1), __pyx_v_item);
  }

  /* "cytoolz/itertoolz.pyx":893
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(current, i-1, item)
 *         item = next(self.iterseq)             # <<<<<<<<<<<<<<
 *         Py_INCREF(item)
 *         PyTuple_SET_ITEM(current, self.n-1, item)
 */
  __pyx_t_1 = __pyx_v_self->iterseq;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "cytoolz/itertoolz.pyx":894
 *             PyTuple_SET_ITEM(current, i-1, item)
 *         item = next(self.iterseq)
 *         Py_INCREF(item)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(current, self.n-1, item)
 *         self.prev = current
 */
  Py_INCREF(__pyx_v_item);

  /* "cytoolz/itertoolz.pyx":895
 *         item = next(self.iterseq)
 *         Py_INCREF(item)
 *         PyTuple_SET_ITEM(current, self.n-1, item)             # <<<<<<<<<<<<<<
 *         self.prev = current
 *         return current
 */
  PyTuple_SET_ITEM(__pyx_v_current, (__pyx_v_self->n - 1), __pyx_v_item);

  /* "cytoolz/itertoolz.pyx":896
 *         Py_INCREF(item)
 *         PyTuple_SET_ITEM(current, self.n-1, item)
 *         self.prev = current             # <<<<<<<<<<<<<<
 *         return current
 * 
 */
  __Pyx_INCREF(__pyx_v_current);
  __Pyx_GIVEREF(__pyx_v_current);
  __Pyx_GOTREF(__pyx_v_self->prev);
  __Pyx_DECREF(__pyx_v_self->prev);
  __pyx_v_self->prev = __pyx_v_current;

  /* "cytoolz/itertoolz.pyx":897
 *         PyTuple_SET_ITEM(current, self.n-1, item)
 *         self.prev = current
 *         return current             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_current);
  __pyx_r = __pyx_v_current;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":884
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef tuple current
 *         cdef object item
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytoolz.itertoolz.sliding_window.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_current);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":903
 * 
 * 
 * cpdef object partition(Py_ssize_t n, object seq, object pad=no_pad):             # <<<<<<<<<<<<<<
 *     """
 *     Partition sequence into tuples of length n
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_39partition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_partition(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_partition *__pyx_optional_args) {
  PyObject *__pyx_v_pad = __pyx_k__5;
  PyObject *__pyx_v_args = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("partition", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_pad = __pyx_optional_args->pad;
    }
  }

  /* "cytoolz/itertoolz.pyx":922
 *         partition_all
 *     """
 *     args = [iter(seq)] * n             # <<<<<<<<<<<<<<
 *     if pad is no_pad:
 *         return zip(*args)
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
      __Pyx_INCREF(__pyx_t_1);
      PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_args = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":923
 *     """
 *     args = [iter(seq)] * n
 *     if pad is no_pad:             # <<<<<<<<<<<<<<
 *         return zip(*args)
 *     else:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_pad); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__pyx_v_pad == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "cytoolz/itertoolz.pyx":924
 *     args = [iter(seq)] * n
 *     if pad is no_pad:
 *         return zip(*args)             # <<<<<<<<<<<<<<
 *     else:
 *         return zip_longest(*args, fillvalue=pad)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":926
 *         return zip(*args)
 *     else:
 *         return zip_longest(*args, fillvalue=pad)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip_longest); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fillvalue, __pyx_v_pad) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":903
 * 
 * 
 * cpdef object partition(Py_ssize_t n, object seq, object pad=no_pad):             # <<<<<<<<<<<<<<
 *     """
 *     Partition sequence into tuples of length n
 */

  /* 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("cytoolz.itertoolz.partition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_39partition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_38partition[] = "partition(Py_ssize_t n, seq, pad=no_pad)\n\n    Partition sequence into tuples of length n\n\n    >>> list(partition(2, [1, 2, 3, 4]))\n    [(1, 2), (3, 4)]\n\n    If the length of ``seq`` is not evenly divisible by ``n``, the final tuple\n    is dropped if ``pad`` is not specified, or filled to length ``n`` by pad:\n\n    >>> list(partition(2, [1, 2, 3, 4, 5]))\n    [(1, 2), (3, 4)]\n\n    >>> list(partition(2, [1, 2, 3, 4, 5], pad=None))\n    [(1, 2), (3, 4), (5, None)]\n\n    See Also:\n        partition_all\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_39partition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_pad = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partition (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,&__pyx_n_s_pad,0};
    PyObject* values[3] = {0,0,0};
    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_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("partition", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pad);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partition") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_seq = values[1];
    __pyx_v_pad = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("partition", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.partition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_38partition(__pyx_self, __pyx_v_n, __pyx_v_seq, __pyx_v_pad);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_38partition(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, PyObject *__pyx_v_pad) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytoolz_9itertoolz_partition __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("partition", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.pad = __pyx_v_pad;
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_partition(__pyx_v_n, __pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.partition", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":945
 *         partition
 *     """
 *     def __cinit__(self, Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *         self.n = n
 *         self.iterseq = iter(seq)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_13partition_all_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_13partition_all_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_seq = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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_n)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_seq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.partition_all.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13partition_all___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)__pyx_v_self), __pyx_v_n, __pyx_v_seq);

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

static int __pyx_pf_7cytoolz_9itertoolz_13partition_all___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":946
 *     """
 *     def __cinit__(self, Py_ssize_t n, object seq):
 *         self.n = n             # <<<<<<<<<<<<<<
 *         self.iterseq = iter(seq)
 * 
 */
  __pyx_v_self->n = __pyx_v_n;

  /* "cytoolz/itertoolz.pyx":947
 *     def __cinit__(self, Py_ssize_t n, object seq):
 *         self.n = n
 *         self.iterseq = iter(seq)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iterseq);
  __Pyx_DECREF(__pyx_v_self->iterseq);
  __pyx_v_self->iterseq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":945
 *         partition
 *     """
 *     def __cinit__(self, Py_ssize_t n, object seq):             # <<<<<<<<<<<<<<
 *         self.n = n
 *         self.iterseq = iter(seq)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz.partition_all.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":949
 *         self.iterseq = iter(seq)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13partition_all_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":950
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":949
 *         self.iterseq = iter(seq)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":952
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef tuple result
 *         cdef object item
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13partition_all_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self) {
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_item = 0;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":955
 *         cdef tuple result
 *         cdef object item
 *         cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 *         result = PyTuple_New(self.n)
 *         for item in self.iterseq:
 */
  __pyx_v_i = 0;

  /* "cytoolz/itertoolz.pyx":956
 *         cdef object item
 *         cdef Py_ssize_t i = 0
 *         result = PyTuple_New(self.n)             # <<<<<<<<<<<<<<
 *         for item in self.iterseq:
 *             Py_INCREF(item)
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":957
 *         cdef Py_ssize_t i = 0
 *         result = PyTuple_New(self.n)
 *         for item in self.iterseq:             # <<<<<<<<<<<<<<
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(result, i, item)
 */
  if (PyList_CheckExact(__pyx_v_self->iterseq) || PyTuple_CheckExact(__pyx_v_self->iterseq)) {
    __pyx_t_1 = __pyx_v_self->iterseq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->iterseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "cytoolz/itertoolz.pyx":958
 *         result = PyTuple_New(self.n)
 *         for item in self.iterseq:
 *             Py_INCREF(item)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(result, i, item)
 *             i += 1
 */
    Py_INCREF(__pyx_v_item);

    /* "cytoolz/itertoolz.pyx":959
 *         for item in self.iterseq:
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(result, i, item)             # <<<<<<<<<<<<<<
 *             i += 1
 *             if i == self.n:
 */
    PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_item);

    /* "cytoolz/itertoolz.pyx":960
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(result, i, item)
 *             i += 1             # <<<<<<<<<<<<<<
 *             if i == self.n:
 *                 return result
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "cytoolz/itertoolz.pyx":961
 *             PyTuple_SET_ITEM(result, i, item)
 *             i += 1
 *             if i == self.n:             # <<<<<<<<<<<<<<
 *                 return result
 *         # iterable exhausted before filling the tuple
 */
    __pyx_t_5 = ((__pyx_v_i == __pyx_v_self->n) != 0);
    if (__pyx_t_5) {

      /* "cytoolz/itertoolz.pyx":962
 *             i += 1
 *             if i == self.n:
 *                 return result             # <<<<<<<<<<<<<<
 *         # iterable exhausted before filling the tuple
 *         if i == 0:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":957
 *         cdef Py_ssize_t i = 0
 *         result = PyTuple_New(self.n)
 *         for item in self.iterseq:             # <<<<<<<<<<<<<<
 *             Py_INCREF(item)
 *             PyTuple_SET_ITEM(result, i, item)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":964
 *                 return result
 *         # iterable exhausted before filling the tuple
 *         if i == 0:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return PyTuple_GetSlice(result, 0, i)
 */
  __pyx_t_5 = ((__pyx_v_i == 0) != 0);
  if (__pyx_t_5) {

    /* "cytoolz/itertoolz.pyx":965
 *         # iterable exhausted before filling the tuple
 *         if i == 0:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return PyTuple_GetSlice(result, 0, i)
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "cytoolz/itertoolz.pyx":966
 *         if i == 0:
 *             raise StopIteration
 *         return PyTuple_GetSlice(result, 0, i)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_GetSlice(__pyx_v_result, 0, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":952
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef tuple result
 *         cdef object item
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("cytoolz.itertoolz.partition_all.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":969
 * 
 * 
 * cpdef object count(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Count the number of items in seq
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_41count(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_count(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("count", 0);

  /* "cytoolz/itertoolz.pyx":980
 *         len
 *     """
 *     if iter(seq) is not seq and hasattr(seq, '__len__'):             # <<<<<<<<<<<<<<
 *         return len(seq)
 *     cdef Py_ssize_t i = 0
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != __pyx_v_seq);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((__pyx_t_2 != 0)) {
    __pyx_t_3 = PyObject_HasAttr(__pyx_v_seq, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = (__pyx_t_3 != 0);
  } else {
    __pyx_t_4 = (__pyx_t_2 != 0);
  }
  if (__pyx_t_4) {

    /* "cytoolz/itertoolz.pyx":981
 *     """
 *     if iter(seq) is not seq and hasattr(seq, '__len__'):
 *         return len(seq)             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = 0
 *     for _ in seq:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":982
 *     if iter(seq) is not seq and hasattr(seq, '__len__'):
 *         return len(seq)
 *     cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 *     for _ in seq:
 *         i += 1
 */
  __pyx_v_i = 0;

  /* "cytoolz/itertoolz.pyx":983
 *         return len(seq)
 *     cdef Py_ssize_t i = 0
 *     for _ in seq:             # <<<<<<<<<<<<<<
 *         i += 1
 *     return i
 */
  if (PyList_CheckExact(__pyx_v_seq) || PyTuple_CheckExact(__pyx_v_seq)) {
    __pyx_t_1 = __pyx_v_seq; __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_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_1);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "cytoolz/itertoolz.pyx":984
 *     cdef Py_ssize_t i = 0
 *     for _ in seq:
 *         i += 1             # <<<<<<<<<<<<<<
 *     return i
 * 
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "cytoolz/itertoolz.pyx":983
 *         return len(seq)
 *     cdef Py_ssize_t i = 0
 *     for _ in seq:             # <<<<<<<<<<<<<<
 *         i += 1
 *     return i
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":985
 *     for _ in seq:
 *         i += 1
 *     return i             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":969
 * 
 * 
 * cpdef object count(object seq):             # <<<<<<<<<<<<<<
 *     """
 *     Count the number of items in seq
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("cytoolz.itertoolz.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_41count(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_40count[] = "count(seq)\n\n    Count the number of items in seq\n\n    Like the builtin ``len`` but works on lazy sequencies.\n\n    Not to be confused with ``itertools.count``\n\n    See also:\n        len\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_41count(PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("count (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_40count(__pyx_self, ((PyObject *)__pyx_v_seq));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_40count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("count", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_count(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":989
 * 
 * cdef class _pluck_index:
 *     def __cinit__(self, object ind, object seqs):             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ind = 0;
  PyObject *__pyx_v_seqs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,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_ind)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __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_ind = values[0];
    __pyx_v_seqs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_pluck_index___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)__pyx_v_self), __pyx_v_ind, __pyx_v_seqs);

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

static int __pyx_pf_7cytoolz_9itertoolz_12_pluck_index___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":990
 * cdef class _pluck_index:
 *     def __cinit__(self, object ind, object seqs):
 *         self.ind = ind             # <<<<<<<<<<<<<<
 *         self.iterseqs = iter(seqs)
 * 
 */
  __Pyx_INCREF(__pyx_v_ind);
  __Pyx_GIVEREF(__pyx_v_ind);
  __Pyx_GOTREF(__pyx_v_self->ind);
  __Pyx_DECREF(__pyx_v_self->ind);
  __pyx_v_self->ind = __pyx_v_ind;

  /* "cytoolz/itertoolz.pyx":991
 *     def __cinit__(self, object ind, object seqs):
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iterseqs);
  __Pyx_DECREF(__pyx_v_self->iterseqs);
  __pyx_v_self->iterseqs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":989
 * 
 * cdef class _pluck_index:
 *     def __cinit__(self, object ind, object seqs):             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":993
 *         self.iterseqs = iter(seqs)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_pluck_index_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":994
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":993
 *         self.iterseqs = iter(seqs)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":996
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         val = next(self.iterseqs)
 *         return val[self.ind]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_pluck_index_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self) {
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":997
 * 
 *     def __next__(self):
 *         val = next(self.iterseqs)             # <<<<<<<<<<<<<<
 *         return val[self.ind]
 * 
 */
  __pyx_t_1 = __pyx_v_self->iterseqs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":998
 *     def __next__(self):
 *         val = next(self.iterseqs)
 *         return val[self.ind]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyObject_GetItem(__pyx_v_val, __pyx_v_self->ind); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":996
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         val = next(self.iterseqs)
 *         return val[self.ind]
 */

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

/* "cytoolz/itertoolz.pyx":1002
 * 
 * cdef class _pluck_index_default:
 *     def __cinit__(self, object ind, object seqs, object default):             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ind = 0;
  PyObject *__pyx_v_seqs = 0;
  CYTHON_UNUSED PyObject *__pyx_v_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_ind)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_ind = values[0];
    __pyx_v_seqs = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index_default.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)__pyx_v_self), __pyx_v_ind, __pyx_v_seqs, __pyx_v_default);

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

static int __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, CYTHON_UNUSED PyObject *__pyx_v_default) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":1003
 * cdef class _pluck_index_default:
 *     def __cinit__(self, object ind, object seqs, object default):
 *         self.ind = ind             # <<<<<<<<<<<<<<
 *         self.iterseqs = iter(seqs)
 * 
 */
  __Pyx_INCREF(__pyx_v_ind);
  __Pyx_GIVEREF(__pyx_v_ind);
  __Pyx_GOTREF(__pyx_v_self->ind);
  __Pyx_DECREF(__pyx_v_self->ind);
  __pyx_v_self->ind = __pyx_v_ind;

  /* "cytoolz/itertoolz.pyx":1004
 *     def __cinit__(self, object ind, object seqs, object default):
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iterseqs);
  __Pyx_DECREF(__pyx_v_self->iterseqs);
  __pyx_v_self->iterseqs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1002
 * 
 * cdef class _pluck_index_default:
 *     def __cinit__(self, object ind, object seqs, object default):             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index_default.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1006
 *         self.iterseqs = iter(seqs)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":1007
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1006
 *         self.iterseqs = iter(seqs)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":1009
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj
 *         cdef object val
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self) {
  PyObject *__pyx_v_obj;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":1012
 *         cdef PyObject *obj
 *         cdef object val
 *         val = next(self.iterseqs)             # <<<<<<<<<<<<<<
 *         obj = PtrObject_GetItem(val, self.ind)
 *         if obj is NULL:
 */
  __pyx_t_1 = __pyx_v_self->iterseqs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1013
 *         cdef object val
 *         val = next(self.iterseqs)
 *         obj = PtrObject_GetItem(val, self.ind)             # <<<<<<<<<<<<<<
 *         if obj is NULL:
 *             if not PyErr_ExceptionMatches(_get_exceptions):
 */
  __pyx_t_2 = __pyx_v_self->ind;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_obj = PyObject_GetItem(__pyx_v_val, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1014
 *         val = next(self.iterseqs)
 *         obj = PtrObject_GetItem(val, self.ind)
 *         if obj is NULL:             # <<<<<<<<<<<<<<
 *             if not PyErr_ExceptionMatches(_get_exceptions):
 *                 raise <object>PyErr_Occurred()
 */
  __pyx_t_3 = ((__pyx_v_obj == NULL) != 0);
  if (__pyx_t_3) {

    /* "cytoolz/itertoolz.pyx":1015
 *         obj = PtrObject_GetItem(val, self.ind)
 *         if obj is NULL:
 *             if not PyErr_ExceptionMatches(_get_exceptions):             # <<<<<<<<<<<<<<
 *                 raise <object>PyErr_Occurred()
 *             PyErr_Clear()
 */
    __pyx_t_2 = __pyx_v_7cytoolz_9itertoolz__get_exceptions;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = ((!(PyErr_ExceptionMatches(__pyx_t_2) != 0)) != 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "cytoolz/itertoolz.pyx":1016
 *         if obj is NULL:
 *             if not PyErr_ExceptionMatches(_get_exceptions):
 *                 raise <object>PyErr_Occurred()             # <<<<<<<<<<<<<<
 *             PyErr_Clear()
 *             return self.default
 */
      __pyx_t_4 = PyErr_Occurred();
      __Pyx_Raise(((PyObject *)__pyx_t_4), 0, 0, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "cytoolz/itertoolz.pyx":1017
 *             if not PyErr_ExceptionMatches(_get_exceptions):
 *                 raise <object>PyErr_Occurred()
 *             PyErr_Clear()             # <<<<<<<<<<<<<<
 *             return self.default
 *         return <object>obj
 */
    PyErr_Clear();

    /* "cytoolz/itertoolz.pyx":1018
 *                 raise <object>PyErr_Occurred()
 *             PyErr_Clear()
 *             return self.default             # <<<<<<<<<<<<<<
 *         return <object>obj
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->__pyx_default);
    __pyx_r = __pyx_v_self->__pyx_default;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":1019
 *             PyErr_Clear()
 *             return self.default
 *         return <object>obj             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_obj));
  __pyx_r = ((PyObject *)__pyx_v_obj);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1009
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj
 *         cdef object val
 */

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

/* "cytoolz/itertoolz.pyx":1023
 * 
 * cdef class _pluck_list:
 *     def __cinit__(self, list ind not None, object seqs):             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ind = 0;
  PyObject *__pyx_v_seqs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,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_ind)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __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_ind = ((PyObject*)values[0]);
    __pyx_v_seqs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ind), (&PyList_Type), 0, "ind", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_pluck_list___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)__pyx_v_self), __pyx_v_ind, __pyx_v_seqs);

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

static int __pyx_pf_7cytoolz_9itertoolz_11_pluck_list___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":1024
 * cdef class _pluck_list:
 *     def __cinit__(self, list ind not None, object seqs):
 *         self.ind = ind             # <<<<<<<<<<<<<<
 *         self.iterseqs = iter(seqs)
 *         self.n = len(ind)
 */
  __Pyx_INCREF(__pyx_v_ind);
  __Pyx_GIVEREF(__pyx_v_ind);
  __Pyx_GOTREF(__pyx_v_self->ind);
  __Pyx_DECREF(__pyx_v_self->ind);
  __pyx_v_self->ind = __pyx_v_ind;

  /* "cytoolz/itertoolz.pyx":1025
 *     def __cinit__(self, list ind not None, object seqs):
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)             # <<<<<<<<<<<<<<
 *         self.n = len(ind)
 * 
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iterseqs);
  __Pyx_DECREF(__pyx_v_self->iterseqs);
  __pyx_v_self->iterseqs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1026
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 *         self.n = len(ind)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_2 = PyList_GET_SIZE(__pyx_v_ind); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->n = __pyx_t_2;

  /* "cytoolz/itertoolz.pyx":1023
 * 
 * cdef class _pluck_list:
 *     def __cinit__(self, list ind not None, object seqs):             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1028
 *         self.n = len(ind)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_pluck_list_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":1029
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1028
 *         self.n = len(ind)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":1031
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef tuple result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_pluck_list_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":1035
 *         cdef tuple result
 *         cdef object val, seq
 *         seq = next(self.iterseqs)             # <<<<<<<<<<<<<<
 *         result = PyTuple_New(self.n)
 *         for i, val in enumerate(self.ind):
 */
  __pyx_t_1 = __pyx_v_self->iterseqs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seq = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1036
 *         cdef object val, seq
 *         seq = next(self.iterseqs)
 *         result = PyTuple_New(self.n)             # <<<<<<<<<<<<<<
 *         for i, val in enumerate(self.ind):
 *             val = seq[val]
 */
  __pyx_t_2 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1037
 *         seq = next(self.iterseqs)
 *         result = PyTuple_New(self.n)
 *         for i, val in enumerate(self.ind):             # <<<<<<<<<<<<<<
 *             val = seq[val]
 *             Py_INCREF(val)
 */
  __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_v_self->ind; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_v_i = __pyx_t_3;
    __pyx_t_3 = (__pyx_t_3 + 1);

    /* "cytoolz/itertoolz.pyx":1038
 *         result = PyTuple_New(self.n)
 *         for i, val in enumerate(self.ind):
 *             val = seq[val]             # <<<<<<<<<<<<<<
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(result, i, val)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_seq, __pyx_v_val); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1039
 *         for i, val in enumerate(self.ind):
 *             val = seq[val]
 *             Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(result, i, val)
 *         return result
 */
    Py_INCREF(__pyx_v_val);

    /* "cytoolz/itertoolz.pyx":1040
 *             val = seq[val]
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(result, i, val)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val);

    /* "cytoolz/itertoolz.pyx":1037
 *         seq = next(self.iterseqs)
 *         result = PyTuple_New(self.n)
 *         for i, val in enumerate(self.ind):             # <<<<<<<<<<<<<<
 *             val = seq[val]
 *             Py_INCREF(val)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1041
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(result, i, val)
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1031
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef tuple result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1045
 * 
 * cdef class _pluck_list_default:
 *     def __cinit__(self, list ind not None, object seqs, object default):             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ind = 0;
  PyObject *__pyx_v_seqs = 0;
  PyObject *__pyx_v_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_ind)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_ind = ((PyObject*)values[0]);
    __pyx_v_seqs = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list_default.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ind), (&PyList_Type), 0, "ind", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)__pyx_v_self), __pyx_v_ind, __pyx_v_seqs, __pyx_v_default);

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

static int __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":1046
 * cdef class _pluck_list_default:
 *     def __cinit__(self, list ind not None, object seqs, object default):
 *         self.ind = ind             # <<<<<<<<<<<<<<
 *         self.iterseqs = iter(seqs)
 *         self.default = default
 */
  __Pyx_INCREF(__pyx_v_ind);
  __Pyx_GIVEREF(__pyx_v_ind);
  __Pyx_GOTREF(__pyx_v_self->ind);
  __Pyx_DECREF(__pyx_v_self->ind);
  __pyx_v_self->ind = __pyx_v_ind;

  /* "cytoolz/itertoolz.pyx":1047
 *     def __cinit__(self, list ind not None, object seqs, object default):
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)             # <<<<<<<<<<<<<<
 *         self.default = default
 *         self.n = len(ind)
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->iterseqs);
  __Pyx_DECREF(__pyx_v_self->iterseqs);
  __pyx_v_self->iterseqs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1048
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 *         self.default = default             # <<<<<<<<<<<<<<
 *         self.n = len(ind)
 * 
 */
  __Pyx_INCREF(__pyx_v_default);
  __Pyx_GIVEREF(__pyx_v_default);
  __Pyx_GOTREF(__pyx_v_self->__pyx_default);
  __Pyx_DECREF(__pyx_v_self->__pyx_default);
  __pyx_v_self->__pyx_default = __pyx_v_default;

  /* "cytoolz/itertoolz.pyx":1049
 *         self.iterseqs = iter(seqs)
 *         self.default = default
 *         self.n = len(ind)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_2 = PyList_GET_SIZE(__pyx_v_ind); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->n = __pyx_t_2;

  /* "cytoolz/itertoolz.pyx":1045
 * 
 * cdef class _pluck_list_default:
 *     def __cinit__(self, list ind not None, object seqs, object default):             # <<<<<<<<<<<<<<
 *         self.ind = ind
 *         self.iterseqs = iter(seqs)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list_default.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1051
 *         self.n = len(ind)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":1052
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1051
 *         self.n = len(ind)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":1054
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef object val, seq
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_obj;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":1058
 *         cdef object val, seq
 *         cdef tuple result
 *         seq = next(self.iterseqs)             # <<<<<<<<<<<<<<
 *         result = PyTuple_New(self.n)
 *         for i, val in enumerate(self.ind):
 */
  __pyx_t_1 = __pyx_v_self->iterseqs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_seq = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1059
 *         cdef tuple result
 *         seq = next(self.iterseqs)
 *         result = PyTuple_New(self.n)             # <<<<<<<<<<<<<<
 *         for i, val in enumerate(self.ind):
 *             obj = PtrObject_GetItem(seq, val)
 */
  __pyx_t_2 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1060
 *         seq = next(self.iterseqs)
 *         result = PyTuple_New(self.n)
 *         for i, val in enumerate(self.ind):             # <<<<<<<<<<<<<<
 *             obj = PtrObject_GetItem(seq, val)
 *             if obj is NULL:
 */
  __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_v_self->ind; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_v_i = __pyx_t_3;
    __pyx_t_3 = (__pyx_t_3 + 1);

    /* "cytoolz/itertoolz.pyx":1061
 *         result = PyTuple_New(self.n)
 *         for i, val in enumerate(self.ind):
 *             obj = PtrObject_GetItem(seq, val)             # <<<<<<<<<<<<<<
 *             if obj is NULL:
 *                 if not PyErr_ExceptionMatches(_get_list_exc):
 */
    __pyx_v_obj = PyObject_GetItem(__pyx_v_seq, __pyx_v_val);

    /* "cytoolz/itertoolz.pyx":1062
 *         for i, val in enumerate(self.ind):
 *             obj = PtrObject_GetItem(seq, val)
 *             if obj is NULL:             # <<<<<<<<<<<<<<
 *                 if not PyErr_ExceptionMatches(_get_list_exc):
 *                     raise <object>PyErr_Occurred()
 */
    __pyx_t_5 = ((__pyx_v_obj == NULL) != 0);
    if (__pyx_t_5) {

      /* "cytoolz/itertoolz.pyx":1063
 *             obj = PtrObject_GetItem(seq, val)
 *             if obj is NULL:
 *                 if not PyErr_ExceptionMatches(_get_list_exc):             # <<<<<<<<<<<<<<
 *                     raise <object>PyErr_Occurred()
 *                 PyErr_Clear()
 */
      __pyx_t_1 = __pyx_v_7cytoolz_9itertoolz__get_list_exc;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = ((!(PyErr_ExceptionMatches(__pyx_t_1) != 0)) != 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_5) {

        /* "cytoolz/itertoolz.pyx":1064
 *             if obj is NULL:
 *                 if not PyErr_ExceptionMatches(_get_list_exc):
 *                     raise <object>PyErr_Occurred()             # <<<<<<<<<<<<<<
 *                 PyErr_Clear()
 *                 Py_INCREF(self.default)
 */
        __pyx_t_6 = PyErr_Occurred();
        __Pyx_Raise(((PyObject *)__pyx_t_6), 0, 0, 0);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "cytoolz/itertoolz.pyx":1065
 *                 if not PyErr_ExceptionMatches(_get_list_exc):
 *                     raise <object>PyErr_Occurred()
 *                 PyErr_Clear()             # <<<<<<<<<<<<<<
 *                 Py_INCREF(self.default)
 *                 PyTuple_SET_ITEM(result, i, self.default)
 */
      PyErr_Clear();

      /* "cytoolz/itertoolz.pyx":1066
 *                     raise <object>PyErr_Occurred()
 *                 PyErr_Clear()
 *                 Py_INCREF(self.default)             # <<<<<<<<<<<<<<
 *                 PyTuple_SET_ITEM(result, i, self.default)
 *             else:
 */
      __pyx_t_1 = __pyx_v_self->__pyx_default;
      __Pyx_INCREF(__pyx_t_1);
      Py_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "cytoolz/itertoolz.pyx":1067
 *                 PyErr_Clear()
 *                 Py_INCREF(self.default)
 *                 PyTuple_SET_ITEM(result, i, self.default)             # <<<<<<<<<<<<<<
 *             else:
 *                 val = <object>obj
 */
      __pyx_t_1 = __pyx_v_self->__pyx_default;
      __Pyx_INCREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "cytoolz/itertoolz.pyx":1069
 *                 PyTuple_SET_ITEM(result, i, self.default)
 *             else:
 *                 val = <object>obj             # <<<<<<<<<<<<<<
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)  # TODO: redefine with "PyObject* val" and avoid cast
 */
      __pyx_t_1 = ((PyObject *)__pyx_v_obj);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "cytoolz/itertoolz.pyx":1070
 *             else:
 *                 val = <object>obj
 *                 Py_INCREF(val)             # <<<<<<<<<<<<<<
 *                 PyTuple_SET_ITEM(result, i, val)  # TODO: redefine with "PyObject* val" and avoid cast
 *         return result
 */
      Py_INCREF(__pyx_v_val);

      /* "cytoolz/itertoolz.pyx":1071
 *                 val = <object>obj
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)  # TODO: redefine with "PyObject* val" and avoid cast             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
      PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val);
    }
    __pyx_L5:;

    /* "cytoolz/itertoolz.pyx":1060
 *         seq = next(self.iterseqs)
 *         result = PyTuple_New(self.n)
 *         for i, val in enumerate(self.ind):             # <<<<<<<<<<<<<<
 *             obj = PtrObject_GetItem(seq, val)
 *             if obj is NULL:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1072
 *                 Py_INCREF(val)
 *                 PyTuple_SET_ITEM(result, i, val)  # TODO: redefine with "PyObject* val" and avoid cast
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1054
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i
 *         cdef object val, seq
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list_default.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1075
 * 
 * 
 * cpdef object pluck(object ind, object seqs, object default=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     plucks an element or several elements from each item in a sequence.
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_43pluck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_pluck(PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_pluck *__pyx_optional_args) {
  PyObject *__pyx_v_default = __pyx_k__6;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pluck", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default = __pyx_optional_args->__pyx_default;
    }
  }

  /* "cytoolz/itertoolz.pyx":1100
 *         map
 *     """
 *     if isinstance(ind, list):             # <<<<<<<<<<<<<<
 *         if default is not no_default:
 *             return _pluck_list_default(ind, seqs, default)
 */
  __pyx_t_1 = PyList_Check(__pyx_v_ind); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":1101
 *     """
 *     if isinstance(ind, list):
 *         if default is not no_default:             # <<<<<<<<<<<<<<
 *             return _pluck_list_default(ind, seqs, default)
 *         if PyList_GET_SIZE(ind) < 10:
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = (__pyx_v_default != __pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":1102
 *     if isinstance(ind, list):
 *         if default is not no_default:
 *             return _pluck_list_default(ind, seqs, default)             # <<<<<<<<<<<<<<
 *         if PyList_GET_SIZE(ind) < 10:
 *             return _pluck_list(ind, seqs)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_ind);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ind);
      __Pyx_GIVEREF(__pyx_v_ind);
      __Pyx_INCREF(__pyx_v_seqs);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_seqs);
      __Pyx_GIVEREF(__pyx_v_seqs);
      __Pyx_INCREF(__pyx_v_default);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_default);
      __Pyx_GIVEREF(__pyx_v_default);
      __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__pluck_list_default)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":1103
 *         if default is not no_default:
 *             return _pluck_list_default(ind, seqs, default)
 *         if PyList_GET_SIZE(ind) < 10:             # <<<<<<<<<<<<<<
 *             return _pluck_list(ind, seqs)
 *         return map(itemgetter(*ind), seqs)
 */
    __pyx_t_1 = ((PyList_GET_SIZE(__pyx_v_ind) < 10) != 0);
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":1104
 *             return _pluck_list_default(ind, seqs, default)
 *         if PyList_GET_SIZE(ind) < 10:
 *             return _pluck_list(ind, seqs)             # <<<<<<<<<<<<<<
 *         return map(itemgetter(*ind), seqs)
 *     if default is no_default:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_ind);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ind);
      __Pyx_GIVEREF(__pyx_v_ind);
      __Pyx_INCREF(__pyx_v_seqs);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_seqs);
      __Pyx_GIVEREF(__pyx_v_seqs);
      __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__pluck_list)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":1105
 *         if PyList_GET_SIZE(ind) < 10:
 *             return _pluck_list(ind, seqs)
 *         return map(itemgetter(*ind), seqs)             # <<<<<<<<<<<<<<
 *     if default is no_default:
 *         return _pluck_index(ind, seqs)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_map); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_itemgetter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_Tuple(__pyx_v_ind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_seqs);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_seqs);
    __Pyx_GIVEREF(__pyx_v_seqs);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":1106
 *             return _pluck_list(ind, seqs)
 *         return map(itemgetter(*ind), seqs)
 *     if default is no_default:             # <<<<<<<<<<<<<<
 *         return _pluck_index(ind, seqs)
 *     return _pluck_index_default(ind, seqs, default)
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = (__pyx_v_default == __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":1107
 *         return map(itemgetter(*ind), seqs)
 *     if default is no_default:
 *         return _pluck_index(ind, seqs)             # <<<<<<<<<<<<<<
 *     return _pluck_index_default(ind, seqs, default)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_ind);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ind);
    __Pyx_GIVEREF(__pyx_v_ind);
    __Pyx_INCREF(__pyx_v_seqs);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_seqs);
    __Pyx_GIVEREF(__pyx_v_seqs);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__pluck_index)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":1108
 *     if default is no_default:
 *         return _pluck_index(ind, seqs)
 *     return _pluck_index_default(ind, seqs, default)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_ind);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ind);
  __Pyx_GIVEREF(__pyx_v_ind);
  __Pyx_INCREF(__pyx_v_seqs);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_seqs);
  __Pyx_GIVEREF(__pyx_v_seqs);
  __Pyx_INCREF(__pyx_v_default);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_default);
  __Pyx_GIVEREF(__pyx_v_default);
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__pluck_index_default)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1075
 * 
 * 
 * cpdef object pluck(object ind, object seqs, object default=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     plucks an element or several elements from each item in a sequence.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("cytoolz.itertoolz.pluck", __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_7cytoolz_9itertoolz_43pluck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_42pluck[] = "pluck(ind, seqs, default=no_default)\n\n    plucks an element or several elements from each item in a sequence.\n\n    ``pluck`` maps ``itertoolz.get`` over a sequence and returns one or more\n    elements of each item in the sequence.\n\n    This is equivalent to running `map(curried.get(ind), seqs)`\n\n    ``ind`` can be either a single string/index or a sequence of\n    strings/indices.\n    ``seqs`` should be sequence containing sequences or dicts.\n\n    e.g.\n\n    >>> data = [{'id': 1, 'name': 'Cheese'}, {'id': 2, 'name': 'Pies'}]\n    >>> list(pluck('name', data))\n    ['Cheese', 'Pies']\n    >>> list(pluck([0, 1], [[1, 2, 3], [4, 5, 7]]))\n    [(1, 2), (4, 5)]\n\n    See Also:\n        get\n        map\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_43pluck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ind = 0;
  PyObject *__pyx_v_seqs = 0;
  PyObject *__pyx_v_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pluck (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,&__pyx_n_s_default,0};
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k__6;
    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_ind)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("pluck", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pluck") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __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_ind = values[0];
    __pyx_v_seqs = values[1];
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pluck", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.pluck", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_42pluck(__pyx_self, __pyx_v_ind, __pyx_v_seqs, __pyx_v_default);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_42pluck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytoolz_9itertoolz_pluck __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pluck", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.__pyx_default = __pyx_v_default;
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_pluck(__pyx_v_ind, __pyx_v_seqs, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.pluck", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1111
 * 
 * 
 * cpdef object join(object leftkey, object leftseq,             # <<<<<<<<<<<<<<
 *                   object rightkey, object rightseq,
 *                   object left_default=no_default,
 */

static PyObject *__pyx_pw_7cytoolz_9itertoolz_45join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7cytoolz_9itertoolz_join(PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_join *__pyx_optional_args) {
  PyObject *__pyx_v_left_default = __pyx_k__7;
  PyObject *__pyx_v_right_default = __pyx_k__8;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("join", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_left_default = __pyx_optional_args->left_default;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_right_default = __pyx_optional_args->right_default;
      }
    }
  }

  /* "cytoolz/itertoolz.pyx":1168
 *     >>> result = join(1, friends, 0, cities)  # doctest: +SKIP
 *     """
 *     if left_default == no_default and right_default == no_default:             # <<<<<<<<<<<<<<
 *         if callable(rightkey):
 *             return _inner_join_key(leftkey, leftseq, rightkey, rightseq,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_left_default, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_right_default, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "cytoolz/itertoolz.pyx":1169
 *     """
 *     if left_default == no_default and right_default == no_default:
 *         if callable(rightkey):             # <<<<<<<<<<<<<<
 *             return _inner_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                    left_default, right_default)
 */
    __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_rightkey); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = (__pyx_t_5 != 0);
    if (__pyx_t_3) {

      /* "cytoolz/itertoolz.pyx":1170
 *     if left_default == no_default and right_default == no_default:
 *         if callable(rightkey):
 *             return _inner_join_key(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1171
 *         if callable(rightkey):
 *             return _inner_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                    left_default, right_default)             # <<<<<<<<<<<<<<
 *         elif isinstance(rightkey, list):
 *             return _inner_join_indices(leftkey, leftseq, rightkey, rightseq,
 */
      __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1170
 *     if left_default == no_default and right_default == no_default:
 *         if callable(rightkey):
 *             return _inner_join_key(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):
 */
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__inner_join_key)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __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;
    }

    /* "cytoolz/itertoolz.pyx":1172
 *             return _inner_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):             # <<<<<<<<<<<<<<
 *             return _inner_join_indices(leftkey, leftseq, rightkey, rightseq,
 *                                        left_default, right_default)
 */
    __pyx_t_3 = PyList_Check(__pyx_v_rightkey); 
    __pyx_t_5 = (__pyx_t_3 != 0);
    if (__pyx_t_5) {

      /* "cytoolz/itertoolz.pyx":1173
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):
 *             return _inner_join_indices(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                        left_default, right_default)
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1174
 *         elif isinstance(rightkey, list):
 *             return _inner_join_indices(leftkey, leftseq, rightkey, rightseq,
 *                                        left_default, right_default)             # <<<<<<<<<<<<<<
 *         else:
 *             return _inner_join_index(leftkey, leftseq, rightkey, rightseq,
 */
      __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1173
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):
 *             return _inner_join_indices(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                        left_default, right_default)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__inner_join_indices)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cytoolz/itertoolz.pyx":1176
 *                                        left_default, right_default)
 *         else:
 *             return _inner_join_index(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                      left_default, right_default)
 *     elif left_default != no_default and right_default == no_default:
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1177
 *         else:
 *             return _inner_join_index(leftkey, leftseq, rightkey, rightseq,
 *                                      left_default, right_default)             # <<<<<<<<<<<<<<
 *     elif left_default != no_default and right_default == no_default:
 *         if callable(rightkey):
 */
      __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1176
 *                                        left_default, right_default)
 *         else:
 *             return _inner_join_index(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                      left_default, right_default)
 *     elif left_default != no_default and right_default == no_default:
 */
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__inner_join_index)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __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;
    }
  }

  /* "cytoolz/itertoolz.pyx":1178
 *             return _inner_join_index(leftkey, leftseq, rightkey, rightseq,
 *                                      left_default, right_default)
 *     elif left_default != no_default and right_default == no_default:             # <<<<<<<<<<<<<<
 *         if callable(rightkey):
 *             return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_left_default, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_right_default, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_5;
  }
  if (__pyx_t_4) {

    /* "cytoolz/itertoolz.pyx":1179
 *                                      left_default, right_default)
 *     elif left_default != no_default and right_default == no_default:
 *         if callable(rightkey):             # <<<<<<<<<<<<<<
 *             return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                          left_default, right_default)
 */
    __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_rightkey); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = (__pyx_t_4 != 0);
    if (__pyx_t_5) {

      /* "cytoolz/itertoolz.pyx":1180
 *     elif left_default != no_default and right_default == no_default:
 *         if callable(rightkey):
 *             return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                          left_default, right_default)
 *         elif isinstance(rightkey, list):
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1181
 *         if callable(rightkey):
 *             return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                          left_default, right_default)             # <<<<<<<<<<<<<<
 *         elif isinstance(rightkey, list):
 *             return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 */
      __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1180
 *     elif left_default != no_default and right_default == no_default:
 *         if callable(rightkey):
 *             return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                          left_default, right_default)
 *         elif isinstance(rightkey, list):
 */
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":1182
 *             return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                          left_default, right_default)
 *         elif isinstance(rightkey, list):             # <<<<<<<<<<<<<<
 *             return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 *                                              left_default, right_default)
 */
    __pyx_t_5 = PyList_Check(__pyx_v_rightkey); 
    __pyx_t_4 = (__pyx_t_5 != 0);
    if (__pyx_t_4) {

      /* "cytoolz/itertoolz.pyx":1183
 *                                          left_default, right_default)
 *         elif isinstance(rightkey, list):
 *             return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                              left_default, right_default)
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1184
 *         elif isinstance(rightkey, list):
 *             return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 *                                              left_default, right_default)             # <<<<<<<<<<<<<<
 *         else:
 *             return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq,
 */
      __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1183
 *                                          left_default, right_default)
 *         elif isinstance(rightkey, list):
 *             return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                              left_default, right_default)
 *         else:
 */
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __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;
    }
    /*else*/ {

      /* "cytoolz/itertoolz.pyx":1186
 *                                              left_default, right_default)
 *         else:
 *             return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                            left_default, right_default)
 *     elif left_default == no_default and right_default != no_default:
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1187
 *         else:
 *             return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq,
 *                                            left_default, right_default)             # <<<<<<<<<<<<<<
 *     elif left_default == no_default and right_default != no_default:
 *         if callable(rightkey):
 */
      __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1186
 *                                              left_default, right_default)
 *         else:
 *             return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                            left_default, right_default)
 *     elif left_default == no_default and right_default != no_default:
 */
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }

  /* "cytoolz/itertoolz.pyx":1188
 *             return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq,
 *                                            left_default, right_default)
 *     elif left_default == no_default and right_default != no_default:             # <<<<<<<<<<<<<<
 *         if callable(rightkey):
 *             return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_left_default, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_right_default, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = __pyx_t_5;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  if (__pyx_t_3) {

    /* "cytoolz/itertoolz.pyx":1189
 *                                            left_default, right_default)
 *     elif left_default == no_default and right_default != no_default:
 *         if callable(rightkey):             # <<<<<<<<<<<<<<
 *             return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                         left_default, right_default)
 */
    __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_rightkey); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (__pyx_t_4) {

      /* "cytoolz/itertoolz.pyx":1190
 *     elif left_default == no_default and right_default != no_default:
 *         if callable(rightkey):
 *             return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                         left_default, right_default)
 *         elif isinstance(rightkey, list):
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1191
 *         if callable(rightkey):
 *             return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                         left_default, right_default)             # <<<<<<<<<<<<<<
 *         elif isinstance(rightkey, list):
 *             return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 */
      __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1190
 *     elif left_default == no_default and right_default != no_default:
 *         if callable(rightkey):
 *             return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                         left_default, right_default)
 *         elif isinstance(rightkey, list):
 */
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __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;
    }

    /* "cytoolz/itertoolz.pyx":1192
 *             return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                         left_default, right_default)
 *         elif isinstance(rightkey, list):             # <<<<<<<<<<<<<<
 *             return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 *                                             left_default, right_default)
 */
    __pyx_t_4 = PyList_Check(__pyx_v_rightkey); 
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "cytoolz/itertoolz.pyx":1193
 *                                         left_default, right_default)
 *         elif isinstance(rightkey, list):
 *             return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                             left_default, right_default)
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1194
 *         elif isinstance(rightkey, list):
 *             return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 *                                             left_default, right_default)             # <<<<<<<<<<<<<<
 *         else:
 *             return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq,
 */
      __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1193
 *                                         left_default, right_default)
 *         elif isinstance(rightkey, list):
 *             return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                             left_default, right_default)
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "cytoolz/itertoolz.pyx":1196
 *                                             left_default, right_default)
 *         else:
 *             return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                           left_default, right_default)
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1197
 *         else:
 *             return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq,
 *                                           left_default, right_default)             # <<<<<<<<<<<<<<
 *     else:
 *         if callable(rightkey):
 */
      __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1196
 *                                             left_default, right_default)
 *         else:
 *             return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                           left_default, right_default)
 *     else:
 */
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __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;
    }
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":1199
 *                                           left_default, right_default)
 *     else:
 *         if callable(rightkey):             # <<<<<<<<<<<<<<
 *             return _outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                    left_default, right_default)
 */
    __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_rightkey); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (__pyx_t_4) {

      /* "cytoolz/itertoolz.pyx":1200
 *     else:
 *         if callable(rightkey):
 *             return _outer_join_key(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1201
 *         if callable(rightkey):
 *             return _outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                    left_default, right_default)             # <<<<<<<<<<<<<<
 *         elif isinstance(rightkey, list):
 *             return _outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 */
      __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1200
 *     else:
 *         if callable(rightkey):
 *             return _outer_join_key(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):
 */
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__outer_join_key)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":1202
 *             return _outer_join_key(leftkey, leftseq, rightkey, rightseq,
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):             # <<<<<<<<<<<<<<
 *             return _outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 *                                        left_default, right_default)
 */
    __pyx_t_4 = PyList_Check(__pyx_v_rightkey); 
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "cytoolz/itertoolz.pyx":1203
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):
 *             return _outer_join_indices(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                        left_default, right_default)
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1204
 *         elif isinstance(rightkey, list):
 *             return _outer_join_indices(leftkey, leftseq, rightkey, rightseq,
 *                                        left_default, right_default)             # <<<<<<<<<<<<<<
 *         else:
 *             return _outer_join_index(leftkey, leftseq, rightkey, rightseq,
 */
      __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1203
 *                                    left_default, right_default)
 *         elif isinstance(rightkey, list):
 *             return _outer_join_indices(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                        left_default, right_default)
 *         else:
 */
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__outer_join_indices)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __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;
    }
    /*else*/ {

      /* "cytoolz/itertoolz.pyx":1206
 *                                        left_default, right_default)
 *         else:
 *             return _outer_join_index(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                      left_default, right_default)
 * 
 */
      __Pyx_XDECREF(__pyx_r);

      /* "cytoolz/itertoolz.pyx":1207
 *         else:
 *             return _outer_join_index(leftkey, leftseq, rightkey, rightseq,
 *                                      left_default, right_default)             # <<<<<<<<<<<<<<
 * 
 * cdef class _join:
 */
      __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_leftkey);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey);
      __Pyx_GIVEREF(__pyx_v_leftkey);
      __Pyx_INCREF(__pyx_v_leftseq);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq);
      __Pyx_GIVEREF(__pyx_v_leftseq);
      __Pyx_INCREF(__pyx_v_rightkey);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey);
      __Pyx_GIVEREF(__pyx_v_rightkey);
      __Pyx_INCREF(__pyx_v_rightseq);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq);
      __Pyx_GIVEREF(__pyx_v_rightseq);
      __Pyx_INCREF(__pyx_v_left_default);
      PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default);
      __Pyx_GIVEREF(__pyx_v_left_default);
      __Pyx_INCREF(__pyx_v_right_default);
      PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default);
      __Pyx_GIVEREF(__pyx_v_right_default);

      /* "cytoolz/itertoolz.pyx":1206
 *                                        left_default, right_default)
 *         else:
 *             return _outer_join_index(leftkey, leftseq, rightkey, rightseq,             # <<<<<<<<<<<<<<
 *                                      left_default, right_default)
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cytoolz_9itertoolz__outer_join_index)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }

  /* "cytoolz/itertoolz.pyx":1111
 * 
 * 
 * cpdef object join(object leftkey, object leftseq,             # <<<<<<<<<<<<<<
 *                   object rightkey, object rightseq,
 *                   object left_default=no_default,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cytoolz.itertoolz.join", __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_7cytoolz_9itertoolz_45join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7cytoolz_9itertoolz_44join[] = "join(leftkey, leftseq, rightkey, rightseq, left_default=no_default, right_default=no_default)\n\n    Join two sequences on common attributes\n\n    This is a semi-streaming operation.  The LEFT sequence is fully evaluated\n    and placed into memory.  The RIGHT sequence is evaluated lazily and so can\n    be arbitrarily large.\n\n    >>> friends = [('Alice', 'Edith'),\n    ...            ('Alice', 'Zhao'),\n    ...            ('Edith', 'Alice'),\n    ...            ('Zhao', 'Alice'),\n    ...            ('Zhao', 'Edith')]\n\n    >>> cities = [('Alice', 'NYC'),\n    ...           ('Alice', 'Chicago'),\n    ...           ('Dan', 'Syndey'),\n    ...           ('Edith', 'Paris'),\n    ...           ('Edith', 'Berlin'),\n    ...           ('Zhao', 'Shanghai')]\n\n    >>> # Vacation opportunities\n    >>> # In what cities do people have friends?\n    >>> result = join(second, friends,\n    ...               first, cities)\n    >>> for ((a, b), (c, d)) in sorted(unique(result)):\n    ...     print((a, d))\n    ('Alice', 'Berlin')\n    ('Alice', 'Paris')\n    ('Alice', 'Shanghai')\n    ('Edith', 'Chicago')\n    ('Edith', 'NYC')\n    ('Zhao', 'Chicago')\n    ('Zhao', 'NYC')\n    ('Zhao', 'Berlin')\n    ('Zhao', 'Paris')\n\n    Specify outer joins with keyword arguments ``left_default`` and/or\n    ``right_default``.  Here is a full outer join in which unmatched elements\n    are paired with None.\n\n    >>> identity = lambda x: x\n    >>> list(join(identity, [1, 2, 3],\n    ...           identity, [2, 3, 4],\n    ...           left_default=None, right_default=None))\n    [(2, 2), (3, 3), (None, 4), (1, None)]\n\n    Usually the key arguments are callables to be applied to the sequences.  If\n    the keys are not obviously callable then it is assumed that indexing was\n    intended, e.g. the following is a legal change\n\n    >>> # result = join(second, friends, first, cities)\n    >>> result = join(1, friends, 0, cities)  # doctest: +SKIP\n    ";
static PyObject *__pyx_pw_7cytoolz_9itertoolz_45join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_leftkey = 0;
  PyObject *__pyx_v_leftseq = 0;
  PyObject *__pyx_v_rightkey = 0;
  PyObject *__pyx_v_rightseq = 0;
  PyObject *__pyx_v_left_default = 0;
  PyObject *__pyx_v_right_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("join (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_leftkey,&__pyx_n_s_leftseq,&__pyx_n_s_rightkey,&__pyx_n_s_rightseq,&__pyx_n_s_left_default,&__pyx_n_s_right_default,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[4] = __pyx_k__7;
    values[5] = __pyx_k__8;
    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_leftkey)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leftseq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("join", 0, 4, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rightkey)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("join", 0, 4, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rightseq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("join", 0, 4, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_default);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_default);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __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);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_leftkey = values[0];
    __pyx_v_leftseq = values[1];
    __pyx_v_rightkey = values[2];
    __pyx_v_rightseq = values[3];
    __pyx_v_left_default = values[4];
    __pyx_v_right_default = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("join", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_44join(__pyx_self, __pyx_v_leftkey, __pyx_v_leftseq, __pyx_v_rightkey, __pyx_v_rightseq, __pyx_v_left_default, __pyx_v_right_default);

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_44join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, PyObject *__pyx_v_left_default, PyObject *__pyx_v_right_default) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7cytoolz_9itertoolz_join __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("join", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.left_default = __pyx_v_left_default;
  __pyx_t_2.right_default = __pyx_v_right_default;
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_join(__pyx_v_leftkey, __pyx_v_leftseq, __pyx_v_rightkey, __pyx_v_rightseq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __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("cytoolz.itertoolz.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1210
 * 
 * cdef class _join:
 *     def __cinit__(self,             # <<<<<<<<<<<<<<
 *                   object leftkey, object leftseq,
 *                   object rightkey, object rightseq,
 */

/* Python wrapper */
static int __pyx_pw_7cytoolz_9itertoolz_5_join_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7cytoolz_9itertoolz_5_join_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_leftkey = 0;
  PyObject *__pyx_v_leftseq = 0;
  PyObject *__pyx_v_rightkey = 0;
  PyObject *__pyx_v_rightseq = 0;
  PyObject *__pyx_v_left_default = 0;
  PyObject *__pyx_v_right_default = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_leftkey,&__pyx_n_s_leftseq,&__pyx_n_s_rightkey,&__pyx_n_s_rightseq,&__pyx_n_s_left_default,&__pyx_n_s_right_default,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[4] = __pyx_k__9;
    values[5] = __pyx_k__10;
    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_leftkey)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leftseq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rightkey)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rightseq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left_default);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right_default);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __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);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_leftkey = values[0];
    __pyx_v_leftseq = values[1];
    __pyx_v_rightkey = values[2];
    __pyx_v_rightseq = values[3];
    __pyx_v_left_default = values[4];
    __pyx_v_right_default = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("cytoolz.itertoolz._join.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_5_join___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self), __pyx_v_leftkey, __pyx_v_leftseq, __pyx_v_rightkey, __pyx_v_rightseq, __pyx_v_left_default, __pyx_v_right_default);

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

static int __pyx_pf_7cytoolz_9itertoolz_5_join___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self, PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, PyObject *__pyx_v_left_default, PyObject *__pyx_v_right_default) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "cytoolz/itertoolz.pyx":1215
 *                   object left_default=no_default,
 *                   object right_default=no_default):
 *         self.left_default = left_default             # <<<<<<<<<<<<<<
 *         self.right_default = right_default
 * 
 */
  __Pyx_INCREF(__pyx_v_left_default);
  __Pyx_GIVEREF(__pyx_v_left_default);
  __Pyx_GOTREF(__pyx_v_self->left_default);
  __Pyx_DECREF(__pyx_v_self->left_default);
  __pyx_v_self->left_default = __pyx_v_left_default;

  /* "cytoolz/itertoolz.pyx":1216
 *                   object right_default=no_default):
 *         self.left_default = left_default
 *         self.right_default = right_default             # <<<<<<<<<<<<<<
 * 
 *         self._rightkey = rightkey
 */
  __Pyx_INCREF(__pyx_v_right_default);
  __Pyx_GIVEREF(__pyx_v_right_default);
  __Pyx_GOTREF(__pyx_v_self->right_default);
  __Pyx_DECREF(__pyx_v_self->right_default);
  __pyx_v_self->right_default = __pyx_v_right_default;

  /* "cytoolz/itertoolz.pyx":1218
 *         self.right_default = right_default
 * 
 *         self._rightkey = rightkey             # <<<<<<<<<<<<<<
 *         self.rightseq = iter(rightseq)
 *         if isinstance(rightkey, list):
 */
  __Pyx_INCREF(__pyx_v_rightkey);
  __Pyx_GIVEREF(__pyx_v_rightkey);
  __Pyx_GOTREF(__pyx_v_self->_rightkey);
  __Pyx_DECREF(__pyx_v_self->_rightkey);
  __pyx_v_self->_rightkey = __pyx_v_rightkey;

  /* "cytoolz/itertoolz.pyx":1219
 * 
 *         self._rightkey = rightkey
 *         self.rightseq = iter(rightseq)             # <<<<<<<<<<<<<<
 *         if isinstance(rightkey, list):
 *             self.N = len(rightkey)
 */
  __pyx_t_1 = PyObject_GetIter(__pyx_v_rightseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->rightseq);
  __Pyx_DECREF(__pyx_v_self->rightseq);
  __pyx_v_self->rightseq = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1220
 *         self._rightkey = rightkey
 *         self.rightseq = iter(rightseq)
 *         if isinstance(rightkey, list):             # <<<<<<<<<<<<<<
 *             self.N = len(rightkey)
 * 
 */
  __pyx_t_2 = PyList_Check(__pyx_v_rightkey); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "cytoolz/itertoolz.pyx":1221
 *         self.rightseq = iter(rightseq)
 *         if isinstance(rightkey, list):
 *             self.N = len(rightkey)             # <<<<<<<<<<<<<<
 * 
 *         self.d = groupby(leftkey, leftseq)
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_rightkey); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->N = __pyx_t_4;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":1223
 *             self.N = len(rightkey)
 * 
 *         self.d = groupby(leftkey, leftseq)             # <<<<<<<<<<<<<<
 *         self.seen_keys = set()
 *         self.matches = []
 */
  __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_groupby(__pyx_v_leftkey, __pyx_v_leftseq, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->d);
  __Pyx_DECREF(__pyx_v_self->d);
  __pyx_v_self->d = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1224
 * 
 *         self.d = groupby(leftkey, leftseq)
 *         self.seen_keys = set()             # <<<<<<<<<<<<<<
 *         self.matches = []
 *         self.right = None
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->seen_keys);
  __Pyx_DECREF(__pyx_v_self->seen_keys);
  __pyx_v_self->seen_keys = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1225
 *         self.d = groupby(leftkey, leftseq)
 *         self.seen_keys = set()
 *         self.matches = []             # <<<<<<<<<<<<<<
 *         self.right = None
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->matches);
  __Pyx_DECREF(__pyx_v_self->matches);
  __pyx_v_self->matches = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1226
 *         self.seen_keys = set()
 *         self.matches = []
 *         self.right = None             # <<<<<<<<<<<<<<
 * 
 *         self.is_rightseq_exhausted = False
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->right);
  __Pyx_DECREF(__pyx_v_self->right);
  __pyx_v_self->right = Py_None;

  /* "cytoolz/itertoolz.pyx":1228
 *         self.right = None
 * 
 *         self.is_rightseq_exhausted = False             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_v_self->is_rightseq_exhausted = 0;

  /* "cytoolz/itertoolz.pyx":1210
 * 
 * cdef class _join:
 *     def __cinit__(self,             # <<<<<<<<<<<<<<
 *                   object leftkey, object leftseq,
 *                   object rightkey, object rightseq,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._join.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1230
 *         self.is_rightseq_exhausted = False
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_5_join_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_5_join_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "cytoolz/itertoolz.pyx":1231
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef object rightkey(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1230
 *         self.is_rightseq_exhausted = False
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "cytoolz/itertoolz.pyx":1233
 *         return self
 * 
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_5_join_rightkey(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rightkey", 0);

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

/* "cytoolz/itertoolz.pyx":1238
 * 
 * cdef class _right_outer_join(_join):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj
 *         if self.i == PyList_GET_SIZE(self.matches):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_right_outer_join___next__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_right_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *__pyx_v_self) {
  PyObject *__pyx_v_obj;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_match = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":1240
 *     def __next__(self):
 *         cdef PyObject *obj
 *         if self.i == PyList_GET_SIZE(self.matches):             # <<<<<<<<<<<<<<
 *             self.right = next(self.rightseq)
 *             key = self.rightkey()
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.matches;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_1)) != 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":1241
 *         cdef PyObject *obj
 *         if self.i == PyList_GET_SIZE(self.matches):
 *             self.right = next(self.rightseq)             # <<<<<<<<<<<<<<
 *             key = self.rightkey()
 *             obj = PyDict_GetItem(self.d, key)
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base.rightseq;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->__pyx_base.right);
    __Pyx_DECREF(__pyx_v_self->__pyx_base.right);
    __pyx_v_self->__pyx_base.right = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":1242
 *         if self.i == PyList_GET_SIZE(self.matches):
 *             self.right = next(self.rightseq)
 *             key = self.rightkey()             # <<<<<<<<<<<<<<
 *             obj = PyDict_GetItem(self.d, key)
 *             if obj is NULL:
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.rightkey(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_key = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":1243
 *             self.right = next(self.rightseq)
 *             key = self.rightkey()
 *             obj = PyDict_GetItem(self.d, key)             # <<<<<<<<<<<<<<
 *             if obj is NULL:
 *                 return (self.left_default, self.right)
 */
    __pyx_t_3 = __pyx_v_self->__pyx_base.d;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_obj = PyDict_GetItem(__pyx_t_3, __pyx_v_key);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":1244
 *             key = self.rightkey()
 *             obj = PyDict_GetItem(self.d, key)
 *             if obj is NULL:             # <<<<<<<<<<<<<<
 *                 return (self.left_default, self.right)
 *             self.matches = <object>obj
 */
    __pyx_t_2 = ((__pyx_v_obj == NULL) != 0);
    if (__pyx_t_2) {

      /* "cytoolz/itertoolz.pyx":1245
 *             obj = PyDict_GetItem(self.d, key)
 *             if obj is NULL:
 *                 return (self.left_default, self.right)             # <<<<<<<<<<<<<<
 *             self.matches = <object>obj
 *             self.i = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_self->__pyx_base.left_default);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.left_default);
      __Pyx_GIVEREF(__pyx_v_self->__pyx_base.left_default);
      __Pyx_INCREF(__pyx_v_self->__pyx_base.right);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.right);
      __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "cytoolz/itertoolz.pyx":1246
 *             if obj is NULL:
 *                 return (self.left_default, self.right)
 *             self.matches = <object>obj             # <<<<<<<<<<<<<<
 *             self.i = 0
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 */
    if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = ((PyObject *)__pyx_v_obj);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches);
    __Pyx_DECREF(__pyx_v_self->__pyx_base.matches);
    __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":1247
 *                 return (self.left_default, self.right)
 *             self.matches = <object>obj
 *             self.i = 0             # <<<<<<<<<<<<<<
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *         self.i += 1
 */
    __pyx_v_self->__pyx_base.i = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":1248
 *             self.matches = <object>obj
 *             self.i = 0
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking             # <<<<<<<<<<<<<<
 *         self.i += 1
 *         return (match, self.right)
 */
  __pyx_t_3 = __pyx_v_self->__pyx_base.matches;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_v_self->__pyx_base.i);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_t_4);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_match = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytoolz/itertoolz.pyx":1249
 *             self.i = 0
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *         self.i += 1             # <<<<<<<<<<<<<<
 *         return (match, self.right)
 * 
 */
  __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1);

  /* "cytoolz/itertoolz.pyx":1250
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *         self.i += 1
 *         return (match, self.right)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_match);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_match);
  __Pyx_GIVEREF(__pyx_v_match);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.right);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.right);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1238
 * 
 * cdef class _right_outer_join(_join):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj
 *         if self.i == PyList_GET_SIZE(self.matches):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_match);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1254
 * 
 * cdef class _right_outer_join_key(_right_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self._rightkey(self.right)
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_21_right_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1255
 * cdef class _right_outer_join_key(_right_outer_join):
 *     cdef object rightkey(self):
 *         return self._rightkey(self.right)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.right);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.__pyx_base.right);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.right);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.__pyx_base._rightkey, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __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;

  /* "cytoolz/itertoolz.pyx":1254
 * 
 * cdef class _right_outer_join_key(_right_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self._rightkey(self.right)
 * 
 */

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

/* "cytoolz/itertoolz.pyx":1259
 * 
 * cdef class _right_outer_join_index(_right_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self.right[self._rightkey]
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_23_right_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1260
 * cdef class _right_outer_join_index(_right_outer_join):
 *     cdef object rightkey(self):
 *         return self.right[self._rightkey]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_self->__pyx_base.__pyx_base._rightkey); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1259
 * 
 * cdef class _right_outer_join_index(_right_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self.right[self._rightkey]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_index.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1264
 * 
 * cdef class _right_outer_join_indices(_right_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_25_right_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_v_self) {
  PyObject *__pyx_v_keyval = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1265
 * cdef class _right_outer_join_indices(_right_outer_join):
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)             # <<<<<<<<<<<<<<
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_self->__pyx_base.__pyx_base.N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_keyval = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1266
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):             # <<<<<<<<<<<<<<
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]
 */
  __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.N;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytoolz/itertoolz.pyx":1267
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)             # <<<<<<<<<<<<<<
 *             val = self.right[val]
 *             Py_INCREF(val)
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._rightkey;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_v_i);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1268
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]             # <<<<<<<<<<<<<<
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_val); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1269
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]
 *             Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(keyval, i, val)
 *         return keyval
 */
    Py_INCREF(__pyx_v_val);

    /* "cytoolz/itertoolz.pyx":1270
 *             val = self.right[val]
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)             # <<<<<<<<<<<<<<
 *         return keyval
 * 
 */
    PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val);
  }

  /* "cytoolz/itertoolz.pyx":1271
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)
 *         return keyval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_keyval);
  __pyx_r = __pyx_v_keyval;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1264
 * 
 * cdef class _right_outer_join_indices(_right_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_indices.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keyval);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1275
 * 
 * cdef class _outer_join(_join):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj
 *         if not self.is_rightseq_exhausted:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_outer_join___next__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__outer_join *__pyx_v_self) {
  PyObject *__pyx_v_obj;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_match = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":1277
 *     def __next__(self):
 *         cdef PyObject *obj
 *         if not self.is_rightseq_exhausted:             # <<<<<<<<<<<<<<
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 try:
 */
  __pyx_t_1 = ((!(__pyx_v_self->__pyx_base.is_rightseq_exhausted != 0)) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":1278
 *         cdef PyObject *obj
 *         if not self.is_rightseq_exhausted:
 *             if self.i == PyList_GET_SIZE(self.matches):             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.right = next(self.rightseq)
 */
    __pyx_t_2 = __pyx_v_self->__pyx_base.matches;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_2)) != 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":1279
 *         if not self.is_rightseq_exhausted:
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.right = next(self.rightseq)
 *                 except StopIteration:
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_5);
        /*try:*/ {

          /* "cytoolz/itertoolz.pyx":1280
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 try:
 *                     self.right = next(self.rightseq)             # <<<<<<<<<<<<<<
 *                 except StopIteration:
 *                     self.is_rightseq_exhausted = True
 */
          __pyx_t_2 = __pyx_v_self->__pyx_base.rightseq;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_6 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GIVEREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_v_self->__pyx_base.right);
          __Pyx_DECREF(__pyx_v_self->__pyx_base.right);
          __pyx_v_self->__pyx_base.right = __pyx_t_6;
          __pyx_t_6 = 0;
        }
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L12_try_end;
        __pyx_L5_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "cytoolz/itertoolz.pyx":1281
 *                 try:
 *                     self.right = next(self.rightseq)
 *                 except StopIteration:             # <<<<<<<<<<<<<<
 *                     self.is_rightseq_exhausted = True
 *                     self.keys = iter(self.d)
 */
        __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("cytoolz.itertoolz._outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_8);

          /* "cytoolz/itertoolz.pyx":1282
 *                     self.right = next(self.rightseq)
 *                 except StopIteration:
 *                     self.is_rightseq_exhausted = True             # <<<<<<<<<<<<<<
 *                     self.keys = iter(self.d)
 *                     return next(self)
 */
          __pyx_v_self->__pyx_base.is_rightseq_exhausted = 1;

          /* "cytoolz/itertoolz.pyx":1283
 *                 except StopIteration:
 *                     self.is_rightseq_exhausted = True
 *                     self.keys = iter(self.d)             # <<<<<<<<<<<<<<
 *                     return next(self)
 *                 key = self.rightkey()
 */
          __pyx_t_9 = __pyx_v_self->__pyx_base.d;
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GIVEREF(__pyx_t_10);
          __Pyx_GOTREF(__pyx_v_self->__pyx_base.keys);
          __Pyx_DECREF(__pyx_v_self->__pyx_base.keys);
          __pyx_v_self->__pyx_base.keys = __pyx_t_10;
          __pyx_t_10 = 0;

          /* "cytoolz/itertoolz.pyx":1284
 *                     self.is_rightseq_exhausted = True
 *                     self.keys = iter(self.d)
 *                     return next(self)             # <<<<<<<<<<<<<<
 *                 key = self.rightkey()
 *                 PySet_Add(self.seen_keys, key)
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_10 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_r = __pyx_t_10;
          __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L8_except_return;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L6_exception_handled;
        }
        goto __pyx_L7_except_error;
        __pyx_L7_except_error:;
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
        goto __pyx_L1_error;
        __pyx_L8_except_return:;
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
        goto __pyx_L0;
        __pyx_L6_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
        __pyx_L12_try_end:;
      }

      /* "cytoolz/itertoolz.pyx":1285
 *                     self.keys = iter(self.d)
 *                     return next(self)
 *                 key = self.rightkey()             # <<<<<<<<<<<<<<
 *                 PySet_Add(self.seen_keys, key)
 *                 obj = PyDict_GetItem(self.d, key)
 */
      __pyx_t_8 = ((struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.rightkey(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_v_key = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1286
 *                     return next(self)
 *                 key = self.rightkey()
 *                 PySet_Add(self.seen_keys, key)             # <<<<<<<<<<<<<<
 *                 obj = PyDict_GetItem(self.d, key)
 *                 if obj is NULL:
 */
      __pyx_t_8 = __pyx_v_self->__pyx_base.seen_keys;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_7 = PySet_Add(__pyx_t_8, __pyx_v_key); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1287
 *                 key = self.rightkey()
 *                 PySet_Add(self.seen_keys, key)
 *                 obj = PyDict_GetItem(self.d, key)             # <<<<<<<<<<<<<<
 *                 if obj is NULL:
 *                     return (self.left_default, self.right)
 */
      __pyx_t_8 = __pyx_v_self->__pyx_base.d;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_obj = PyDict_GetItem(__pyx_t_8, __pyx_v_key);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1288
 *                 PySet_Add(self.seen_keys, key)
 *                 obj = PyDict_GetItem(self.d, key)
 *                 if obj is NULL:             # <<<<<<<<<<<<<<
 *                     return (self.left_default, self.right)
 *                 self.matches = <object>obj
 */
      __pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
      if (__pyx_t_1) {

        /* "cytoolz/itertoolz.pyx":1289
 *                 obj = PyDict_GetItem(self.d, key)
 *                 if obj is NULL:
 *                     return (self.left_default, self.right)             # <<<<<<<<<<<<<<
 *                 self.matches = <object>obj
 *                 self.i = 0
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_self->__pyx_base.left_default);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self->__pyx_base.left_default);
        __Pyx_GIVEREF(__pyx_v_self->__pyx_base.left_default);
        __Pyx_INCREF(__pyx_v_self->__pyx_base.right);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right);
        __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }

      /* "cytoolz/itertoolz.pyx":1290
 *                 if obj is NULL:
 *                     return (self.left_default, self.right)
 *                 self.matches = <object>obj             # <<<<<<<<<<<<<<
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 */
      if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = ((PyObject *)__pyx_v_obj);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches);
      __Pyx_DECREF(__pyx_v_self->__pyx_base.matches);
      __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1291
 *                     return (self.left_default, self.right)
 *                 self.matches = <object>obj
 *                 self.i = 0             # <<<<<<<<<<<<<<
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1
 */
      __pyx_v_self->__pyx_base.i = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "cytoolz/itertoolz.pyx":1292
 *                 self.matches = <object>obj
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking             # <<<<<<<<<<<<<<
 *             self.i += 1
 *             return (match, self.right)
 */
    __pyx_t_8 = __pyx_v_self->__pyx_base.matches;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_v_self->__pyx_base.i);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = ((PyObject *)__pyx_t_11);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_v_match = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "cytoolz/itertoolz.pyx":1293
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1             # <<<<<<<<<<<<<<
 *             return (match, self.right)
 * 
 */
    __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1);

    /* "cytoolz/itertoolz.pyx":1294
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1
 *             return (match, self.right)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_match);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_match);
    __Pyx_GIVEREF(__pyx_v_match);
    __Pyx_INCREF(__pyx_v_self->__pyx_base.right);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right);
    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":1297
 * 
 *         else:
 *             if self.i == PyList_GET_SIZE(self.matches):             # <<<<<<<<<<<<<<
 *                 key = next(self.keys)
 *                 while key in self.seen_keys:
 */
    __pyx_t_8 = __pyx_v_self->__pyx_base.matches;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_1 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_8)) != 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":1298
 *         else:
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 key = next(self.keys)             # <<<<<<<<<<<<<<
 *                 while key in self.seen_keys:
 *                     key = next(self.keys)
 */
      __pyx_t_8 = __pyx_v_self->__pyx_base.keys;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_key = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "cytoolz/itertoolz.pyx":1299
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 key = next(self.keys)
 *                 while key in self.seen_keys:             # <<<<<<<<<<<<<<
 *                     key = next(self.keys)
 *                 obj = PyDict_GetItem(self.d, key)
 */
      while (1) {
        __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->__pyx_base.seen_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_12 = (__pyx_t_1 != 0);
        if (!__pyx_t_12) break;

        /* "cytoolz/itertoolz.pyx":1300
 *                 key = next(self.keys)
 *                 while key in self.seen_keys:
 *                     key = next(self.keys)             # <<<<<<<<<<<<<<
 *                 obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj
 */
        __pyx_t_2 = __pyx_v_self->__pyx_base.keys;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_8);
        __pyx_t_8 = 0;
      }

      /* "cytoolz/itertoolz.pyx":1301
 *                 while key in self.seen_keys:
 *                     key = next(self.keys)
 *                 obj = PyDict_GetItem(self.d, key)             # <<<<<<<<<<<<<<
 *                 self.matches = <object>obj
 *                 self.i = 0
 */
      __pyx_t_8 = __pyx_v_self->__pyx_base.d;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_obj = PyDict_GetItem(__pyx_t_8, __pyx_v_key);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1302
 *                     key = next(self.keys)
 *                 obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj             # <<<<<<<<<<<<<<
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 */
      if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = ((PyObject *)__pyx_v_obj);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches);
      __Pyx_DECREF(__pyx_v_self->__pyx_base.matches);
      __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1303
 *                 obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj
 *                 self.i = 0             # <<<<<<<<<<<<<<
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1
 */
      __pyx_v_self->__pyx_base.i = 0;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "cytoolz/itertoolz.pyx":1304
 *                 self.matches = <object>obj
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking             # <<<<<<<<<<<<<<
 *             self.i += 1
 *             return (match, self.right_default)
 */
    __pyx_t_8 = __pyx_v_self->__pyx_base.matches;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_v_self->__pyx_base.i);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = ((PyObject *)__pyx_t_11);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_v_match = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "cytoolz/itertoolz.pyx":1305
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1             # <<<<<<<<<<<<<<
 *             return (match, self.right_default)
 * 
 */
    __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1);

    /* "cytoolz/itertoolz.pyx":1306
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1
 *             return (match, self.right_default)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_match);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_match);
    __Pyx_GIVEREF(__pyx_v_match);
    __Pyx_INCREF(__pyx_v_self->__pyx_base.right_default);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right_default);
    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right_default);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":1275
 * 
 * cdef class _outer_join(_join):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj
 *         if not self.is_rightseq_exhausted:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytoolz.itertoolz._outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_match);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1310
 * 
 * cdef class _outer_join_key(_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self._rightkey(self.right)
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_15_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1311
 * cdef class _outer_join_key(_outer_join):
 *     cdef object rightkey(self):
 *         return self._rightkey(self.right)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.right);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.__pyx_base.right);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.right);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.__pyx_base._rightkey, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __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;

  /* "cytoolz/itertoolz.pyx":1310
 * 
 * cdef class _outer_join_key(_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self._rightkey(self.right)
 * 
 */

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

/* "cytoolz/itertoolz.pyx":1315
 * 
 * cdef class _outer_join_index(_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self.right[self._rightkey]
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_17_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1316
 * cdef class _outer_join_index(_outer_join):
 *     cdef object rightkey(self):
 *         return self.right[self._rightkey]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_self->__pyx_base.__pyx_base._rightkey); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1315
 * 
 * cdef class _outer_join_index(_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self.right[self._rightkey]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_index.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1320
 * 
 * cdef class _outer_join_indices(_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_19_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *__pyx_v_self) {
  PyObject *__pyx_v_keyval = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1321
 * cdef class _outer_join_indices(_outer_join):
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)             # <<<<<<<<<<<<<<
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_self->__pyx_base.__pyx_base.N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_keyval = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1322
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):             # <<<<<<<<<<<<<<
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]
 */
  __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.N;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytoolz/itertoolz.pyx":1323
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)             # <<<<<<<<<<<<<<
 *             val = self.right[val]
 *             Py_INCREF(val)
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._rightkey;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_v_i);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1324
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]             # <<<<<<<<<<<<<<
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_val); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1325
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]
 *             Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(keyval, i, val)
 *         return keyval
 */
    Py_INCREF(__pyx_v_val);

    /* "cytoolz/itertoolz.pyx":1326
 *             val = self.right[val]
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)             # <<<<<<<<<<<<<<
 *         return keyval
 * 
 */
    PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val);
  }

  /* "cytoolz/itertoolz.pyx":1327
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)
 *         return keyval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_keyval);
  __pyx_r = __pyx_v_keyval;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1320
 * 
 * cdef class _outer_join_indices(_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_indices.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keyval);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1331
 * 
 * cdef class _left_outer_join(_join):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj
 *         if not self.is_rightseq_exhausted:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_left_outer_join___next__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_left_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *__pyx_v_self) {
  PyObject *__pyx_v_obj;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_match = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":1333
 *     def __next__(self):
 *         cdef PyObject *obj
 *         if not self.is_rightseq_exhausted:             # <<<<<<<<<<<<<<
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 obj = NULL
 */
  __pyx_t_1 = ((!(__pyx_v_self->__pyx_base.is_rightseq_exhausted != 0)) != 0);
  if (__pyx_t_1) {

    /* "cytoolz/itertoolz.pyx":1334
 *         cdef PyObject *obj
 *         if not self.is_rightseq_exhausted:
 *             if self.i == PyList_GET_SIZE(self.matches):             # <<<<<<<<<<<<<<
 *                 obj = NULL
 *                 while obj is NULL:
 */
    __pyx_t_2 = __pyx_v_self->__pyx_base.matches;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_2)) != 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":1335
 *         if not self.is_rightseq_exhausted:
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 obj = NULL             # <<<<<<<<<<<<<<
 *                 while obj is NULL:
 *                     try:
 */
      __pyx_v_obj = NULL;

      /* "cytoolz/itertoolz.pyx":1336
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 obj = NULL
 *                 while obj is NULL:             # <<<<<<<<<<<<<<
 *                     try:
 *                         self.right = next(self.rightseq)
 */
      while (1) {
        __pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
        if (!__pyx_t_1) break;

        /* "cytoolz/itertoolz.pyx":1337
 *                 obj = NULL
 *                 while obj is NULL:
 *                     try:             # <<<<<<<<<<<<<<
 *                         self.right = next(self.rightseq)
 *                     except StopIteration:
 */
        {
          __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_5);
          /*try:*/ {

            /* "cytoolz/itertoolz.pyx":1338
 *                 while obj is NULL:
 *                     try:
 *                         self.right = next(self.rightseq)             # <<<<<<<<<<<<<<
 *                     except StopIteration:
 *                         self.is_rightseq_exhausted = True
 */
            __pyx_t_2 = __pyx_v_self->__pyx_base.rightseq;
            __Pyx_INCREF(__pyx_t_2);
            __pyx_t_6 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_GOTREF(__pyx_v_self->__pyx_base.right);
            __Pyx_DECREF(__pyx_v_self->__pyx_base.right);
            __pyx_v_self->__pyx_base.right = __pyx_t_6;
            __pyx_t_6 = 0;
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L14_try_end;
          __pyx_L7_error:;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "cytoolz/itertoolz.pyx":1339
 *                     try:
 *                         self.right = next(self.rightseq)
 *                     except StopIteration:             # <<<<<<<<<<<<<<
 *                         self.is_rightseq_exhausted = True
 *                         self.keys = iter(self.d)
 */
          __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
          if (__pyx_t_7) {
            __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_8);

            /* "cytoolz/itertoolz.pyx":1340
 *                         self.right = next(self.rightseq)
 *                     except StopIteration:
 *                         self.is_rightseq_exhausted = True             # <<<<<<<<<<<<<<
 *                         self.keys = iter(self.d)
 *                         return next(self)
 */
            __pyx_v_self->__pyx_base.is_rightseq_exhausted = 1;

            /* "cytoolz/itertoolz.pyx":1341
 *                     except StopIteration:
 *                         self.is_rightseq_exhausted = True
 *                         self.keys = iter(self.d)             # <<<<<<<<<<<<<<
 *                         return next(self)
 *                     key = self.rightkey()
 */
            __pyx_t_9 = __pyx_v_self->__pyx_base.d;
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_GIVEREF(__pyx_t_10);
            __Pyx_GOTREF(__pyx_v_self->__pyx_base.keys);
            __Pyx_DECREF(__pyx_v_self->__pyx_base.keys);
            __pyx_v_self->__pyx_base.keys = __pyx_t_10;
            __pyx_t_10 = 0;

            /* "cytoolz/itertoolz.pyx":1342
 *                         self.is_rightseq_exhausted = True
 *                         self.keys = iter(self.d)
 *                         return next(self)             # <<<<<<<<<<<<<<
 *                     key = self.rightkey()
 *                     PySet_Add(self.seen_keys, key)
 */
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_10 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_r = __pyx_t_10;
            __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L10_except_return;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L8_exception_handled;
          }
          goto __pyx_L9_except_error;
          __pyx_L9_except_error:;
          __Pyx_XGIVEREF(__pyx_t_3);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
          goto __pyx_L1_error;
          __pyx_L10_except_return:;
          __Pyx_XGIVEREF(__pyx_t_3);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
          goto __pyx_L0;
          __pyx_L8_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_3);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
          __pyx_L14_try_end:;
        }

        /* "cytoolz/itertoolz.pyx":1343
 *                         self.keys = iter(self.d)
 *                         return next(self)
 *                     key = self.rightkey()             # <<<<<<<<<<<<<<
 *                     PySet_Add(self.seen_keys, key)
 *                     obj = PyDict_GetItem(self.d, key)
 */
        __pyx_t_8 = ((struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.rightkey(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "cytoolz/itertoolz.pyx":1344
 *                         return next(self)
 *                     key = self.rightkey()
 *                     PySet_Add(self.seen_keys, key)             # <<<<<<<<<<<<<<
 *                     obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj
 */
        __pyx_t_8 = __pyx_v_self->__pyx_base.seen_keys;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_7 = PySet_Add(__pyx_t_8, __pyx_v_key); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "cytoolz/itertoolz.pyx":1345
 *                     key = self.rightkey()
 *                     PySet_Add(self.seen_keys, key)
 *                     obj = PyDict_GetItem(self.d, key)             # <<<<<<<<<<<<<<
 *                 self.matches = <object>obj
 *                 self.i = 0
 */
        __pyx_t_8 = __pyx_v_self->__pyx_base.d;
        __Pyx_INCREF(__pyx_t_8);
        __pyx_v_obj = PyDict_GetItem(__pyx_t_8, __pyx_v_key);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }

      /* "cytoolz/itertoolz.pyx":1346
 *                     PySet_Add(self.seen_keys, key)
 *                     obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj             # <<<<<<<<<<<<<<
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 */
      if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = ((PyObject *)__pyx_v_obj);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches);
      __Pyx_DECREF(__pyx_v_self->__pyx_base.matches);
      __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1347
 *                     obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj
 *                 self.i = 0             # <<<<<<<<<<<<<<
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1
 */
      __pyx_v_self->__pyx_base.i = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "cytoolz/itertoolz.pyx":1348
 *                 self.matches = <object>obj
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking             # <<<<<<<<<<<<<<
 *             self.i += 1
 *             return (match, self.right)
 */
    __pyx_t_8 = __pyx_v_self->__pyx_base.matches;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_v_self->__pyx_base.i);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = ((PyObject *)__pyx_t_11);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_v_match = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "cytoolz/itertoolz.pyx":1349
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1             # <<<<<<<<<<<<<<
 *             return (match, self.right)
 * 
 */
    __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1);

    /* "cytoolz/itertoolz.pyx":1350
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1
 *             return (match, self.right)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_match);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_match);
    __Pyx_GIVEREF(__pyx_v_match);
    __Pyx_INCREF(__pyx_v_self->__pyx_base.right);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right);
    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "cytoolz/itertoolz.pyx":1353
 * 
 *         else:
 *             if self.i == PyList_GET_SIZE(self.matches):             # <<<<<<<<<<<<<<
 *                 key = next(self.keys)
 *                 while key in self.seen_keys:
 */
    __pyx_t_8 = __pyx_v_self->__pyx_base.matches;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_1 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_8)) != 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_1) {

      /* "cytoolz/itertoolz.pyx":1354
 *         else:
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 key = next(self.keys)             # <<<<<<<<<<<<<<
 *                 while key in self.seen_keys:
 *                     key = next(self.keys)
 */
      __pyx_t_8 = __pyx_v_self->__pyx_base.keys;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_key = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "cytoolz/itertoolz.pyx":1355
 *             if self.i == PyList_GET_SIZE(self.matches):
 *                 key = next(self.keys)
 *                 while key in self.seen_keys:             # <<<<<<<<<<<<<<
 *                     key = next(self.keys)
 *                 obj = PyDict_GetItem(self.d, key)
 */
      while (1) {
        __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_self->__pyx_base.seen_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_12 = (__pyx_t_1 != 0);
        if (!__pyx_t_12) break;

        /* "cytoolz/itertoolz.pyx":1356
 *                 key = next(self.keys)
 *                 while key in self.seen_keys:
 *                     key = next(self.keys)             # <<<<<<<<<<<<<<
 *                 obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj
 */
        __pyx_t_2 = __pyx_v_self->__pyx_base.keys;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_8);
        __pyx_t_8 = 0;
      }

      /* "cytoolz/itertoolz.pyx":1357
 *                 while key in self.seen_keys:
 *                     key = next(self.keys)
 *                 obj = PyDict_GetItem(self.d, key)             # <<<<<<<<<<<<<<
 *                 self.matches = <object>obj
 *                 self.i = 0
 */
      __pyx_t_8 = __pyx_v_self->__pyx_base.d;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_v_obj = PyDict_GetItem(__pyx_t_8, __pyx_v_key);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1358
 *                     key = next(self.keys)
 *                 obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj             # <<<<<<<<<<<<<<
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 */
      if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = ((PyObject *)__pyx_v_obj);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches);
      __Pyx_DECREF(__pyx_v_self->__pyx_base.matches);
      __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "cytoolz/itertoolz.pyx":1359
 *                 obj = PyDict_GetItem(self.d, key)
 *                 self.matches = <object>obj
 *                 self.i = 0             # <<<<<<<<<<<<<<
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1
 */
      __pyx_v_self->__pyx_base.i = 0;
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "cytoolz/itertoolz.pyx":1360
 *                 self.matches = <object>obj
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking             # <<<<<<<<<<<<<<
 *             self.i += 1
 *             return (match, self.right_default)
 */
    __pyx_t_8 = __pyx_v_self->__pyx_base.matches;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_v_self->__pyx_base.i);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = ((PyObject *)__pyx_t_11);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_v_match = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "cytoolz/itertoolz.pyx":1361
 *                 self.i = 0
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1             # <<<<<<<<<<<<<<
 *             return (match, self.right_default)
 * 
 */
    __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1);

    /* "cytoolz/itertoolz.pyx":1362
 *             match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *             self.i += 1
 *             return (match, self.right_default)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_match);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_match);
    __Pyx_GIVEREF(__pyx_v_match);
    __Pyx_INCREF(__pyx_v_self->__pyx_base.right_default);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right_default);
    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right_default);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }

  /* "cytoolz/itertoolz.pyx":1331
 * 
 * cdef class _left_outer_join(_join):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj
 *         if not self.is_rightseq_exhausted:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_match);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1366
 * 
 * cdef class _left_outer_join_key(_left_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self._rightkey(self.right)
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_20_left_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1367
 * cdef class _left_outer_join_key(_left_outer_join):
 *     cdef object rightkey(self):
 *         return self._rightkey(self.right)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.right);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.__pyx_base.right);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.right);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.__pyx_base._rightkey, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __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;

  /* "cytoolz/itertoolz.pyx":1366
 * 
 * cdef class _left_outer_join_key(_left_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self._rightkey(self.right)
 * 
 */

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

/* "cytoolz/itertoolz.pyx":1371
 * 
 * cdef class _left_outer_join_index(_left_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self.right[self._rightkey]
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_22_left_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1372
 * cdef class _left_outer_join_index(_left_outer_join):
 *     cdef object rightkey(self):
 *         return self.right[self._rightkey]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_self->__pyx_base.__pyx_base._rightkey); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1371
 * 
 * cdef class _left_outer_join_index(_left_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self.right[self._rightkey]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_index.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1376
 * 
 * cdef class _left_outer_join_indices(_left_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_24_left_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_v_self) {
  PyObject *__pyx_v_keyval = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1377
 * cdef class _left_outer_join_indices(_left_outer_join):
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)             # <<<<<<<<<<<<<<
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_self->__pyx_base.__pyx_base.N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_keyval = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1378
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):             # <<<<<<<<<<<<<<
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]
 */
  __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.N;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytoolz/itertoolz.pyx":1379
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)             # <<<<<<<<<<<<<<
 *             val = self.right[val]
 *             Py_INCREF(val)
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._rightkey;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_v_i);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1380
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]             # <<<<<<<<<<<<<<
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_val); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1381
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]
 *             Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(keyval, i, val)
 *         return keyval
 */
    Py_INCREF(__pyx_v_val);

    /* "cytoolz/itertoolz.pyx":1382
 *             val = self.right[val]
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)             # <<<<<<<<<<<<<<
 *         return keyval
 * 
 */
    PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val);
  }

  /* "cytoolz/itertoolz.pyx":1383
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)
 *         return keyval             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_keyval);
  __pyx_r = __pyx_v_keyval;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1376
 * 
 * cdef class _left_outer_join_indices(_left_outer_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_indices.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keyval);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1387
 * 
 * cdef class _inner_join(_join):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj = NULL
 *         if self.i == PyList_GET_SIZE(self.matches):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_inner_join___next__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join *)__pyx_v_self));

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

static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_inner_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__inner_join *__pyx_v_self) {
  PyObject *__pyx_v_obj;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_match = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "cytoolz/itertoolz.pyx":1388
 * cdef class _inner_join(_join):
 *     def __next__(self):
 *         cdef PyObject *obj = NULL             # <<<<<<<<<<<<<<
 *         if self.i == PyList_GET_SIZE(self.matches):
 *             while obj is NULL:
 */
  __pyx_v_obj = NULL;

  /* "cytoolz/itertoolz.pyx":1389
 *     def __next__(self):
 *         cdef PyObject *obj = NULL
 *         if self.i == PyList_GET_SIZE(self.matches):             # <<<<<<<<<<<<<<
 *             while obj is NULL:
 *                 self.right = next(self.rightseq)
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.matches;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_1)) != 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "cytoolz/itertoolz.pyx":1390
 *         cdef PyObject *obj = NULL
 *         if self.i == PyList_GET_SIZE(self.matches):
 *             while obj is NULL:             # <<<<<<<<<<<<<<
 *                 self.right = next(self.rightseq)
 *                 key = self.rightkey()
 */
    while (1) {
      __pyx_t_2 = ((__pyx_v_obj == NULL) != 0);
      if (!__pyx_t_2) break;

      /* "cytoolz/itertoolz.pyx":1391
 *         if self.i == PyList_GET_SIZE(self.matches):
 *             while obj is NULL:
 *                 self.right = next(self.rightseq)             # <<<<<<<<<<<<<<
 *                 key = self.rightkey()
 *                 obj = PyDict_GetItem(self.d, key)
 */
      __pyx_t_1 = __pyx_v_self->__pyx_base.rightseq;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->__pyx_base.right);
      __Pyx_DECREF(__pyx_v_self->__pyx_base.right);
      __pyx_v_self->__pyx_base.right = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "cytoolz/itertoolz.pyx":1392
 *             while obj is NULL:
 *                 self.right = next(self.rightseq)
 *                 key = self.rightkey()             # <<<<<<<<<<<<<<
 *                 obj = PyDict_GetItem(self.d, key)
 *             self.matches = <object>obj
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.rightkey(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "cytoolz/itertoolz.pyx":1393
 *                 self.right = next(self.rightseq)
 *                 key = self.rightkey()
 *                 obj = PyDict_GetItem(self.d, key)             # <<<<<<<<<<<<<<
 *             self.matches = <object>obj
 *             self.i = 0
 */
      __pyx_t_3 = __pyx_v_self->__pyx_base.d;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_obj = PyDict_GetItem(__pyx_t_3, __pyx_v_key);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }

    /* "cytoolz/itertoolz.pyx":1394
 *                 key = self.rightkey()
 *                 obj = PyDict_GetItem(self.d, key)
 *             self.matches = <object>obj             # <<<<<<<<<<<<<<
 *             self.i = 0
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 */
    if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = ((PyObject *)__pyx_v_obj);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches);
    __Pyx_DECREF(__pyx_v_self->__pyx_base.matches);
    __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "cytoolz/itertoolz.pyx":1395
 *                 obj = PyDict_GetItem(self.d, key)
 *             self.matches = <object>obj
 *             self.i = 0             # <<<<<<<<<<<<<<
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *         self.i += 1
 */
    __pyx_v_self->__pyx_base.i = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "cytoolz/itertoolz.pyx":1396
 *             self.matches = <object>obj
 *             self.i = 0
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking             # <<<<<<<<<<<<<<
 *         self.i += 1
 *         return (match, self.right)
 */
  __pyx_t_3 = __pyx_v_self->__pyx_base.matches;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_v_self->__pyx_base.i);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((PyObject *)__pyx_t_4);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_match = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "cytoolz/itertoolz.pyx":1397
 *             self.i = 0
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *         self.i += 1             # <<<<<<<<<<<<<<
 *         return (match, self.right)
 * 
 */
  __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1);

  /* "cytoolz/itertoolz.pyx":1398
 *         match = <object>PyList_GET_ITEM(self.matches, self.i)  # skip error checking
 *         self.i += 1
 *         return (match, self.right)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_match);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_match);
  __Pyx_GIVEREF(__pyx_v_match);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.right);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.right);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1387
 * 
 * cdef class _inner_join(_join):
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef PyObject *obj = NULL
 *         if self.i == PyList_GET_SIZE(self.matches):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cytoolz.itertoolz._inner_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_match);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1402
 * 
 * cdef class _inner_join_key(_inner_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self._rightkey(self.right)
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_15_inner_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1403
 * cdef class _inner_join_key(_inner_join):
 *     cdef object rightkey(self):
 *         return self._rightkey(self.right)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.right);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.__pyx_base.right);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.right);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_self->__pyx_base.__pyx_base._rightkey, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __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;

  /* "cytoolz/itertoolz.pyx":1402
 * 
 * cdef class _inner_join_key(_inner_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self._rightkey(self.right)
 * 
 */

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

/* "cytoolz/itertoolz.pyx":1407
 * 
 * cdef class _inner_join_index(_inner_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self.right[self._rightkey]
 * 
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_17_inner_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1408
 * cdef class _inner_join_index(_inner_join):
 *     cdef object rightkey(self):
 *         return self.right[self._rightkey]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_self->__pyx_base.__pyx_base._rightkey); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1407
 * 
 * cdef class _inner_join_index(_inner_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         return self.right[self._rightkey]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_index.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cytoolz/itertoolz.pyx":1412
 * 
 * cdef class _inner_join_indices(_inner_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 */

static PyObject *__pyx_f_7cytoolz_9itertoolz_19_inner_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *__pyx_v_self) {
  PyObject *__pyx_v_keyval = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rightkey", 0);

  /* "cytoolz/itertoolz.pyx":1413
 * cdef class _inner_join_indices(_inner_join):
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)             # <<<<<<<<<<<<<<
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_self->__pyx_base.__pyx_base.N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_keyval = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":1414
 *     cdef object rightkey(self):
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):             # <<<<<<<<<<<<<<
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]
 */
  __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.N;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "cytoolz/itertoolz.pyx":1415
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)             # <<<<<<<<<<<<<<
 *             val = self.right[val]
 *             Py_INCREF(val)
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._rightkey;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_v_i);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1416
 *         for i in range(self.N):
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]             # <<<<<<<<<<<<<<
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_val); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "cytoolz/itertoolz.pyx":1417
 *             val = <object>PyList_GET_ITEM(self._rightkey, i)
 *             val = self.right[val]
 *             Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(keyval, i, val)
 *         return keyval
 */
    Py_INCREF(__pyx_v_val);

    /* "cytoolz/itertoolz.pyx":1418
 *             val = self.right[val]
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)             # <<<<<<<<<<<<<<
 *         return keyval
 */
    PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val);
  }

  /* "cytoolz/itertoolz.pyx":1419
 *             Py_INCREF(val)
 *             PyTuple_SET_ITEM(keyval, i, val)
 *         return keyval             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_keyval);
  __pyx_r = __pyx_v_keyval;
  goto __pyx_L0;

  /* "cytoolz/itertoolz.pyx":1412
 * 
 * cdef class _inner_join_indices(_inner_join):
 *     cdef object rightkey(self):             # <<<<<<<<<<<<<<
 *         keyval = PyTuple_New(self.N)
 *         for i in range(self.N):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_indices.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keyval);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_remove(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz_remove *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz_remove *)o);
  p->predicate = Py_None; Py_INCREF(Py_None);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_6remove_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz_remove(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz_remove *p = (struct __pyx_obj_7cytoolz_9itertoolz_remove *)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->predicate);
  Py_CLEAR(p->iter_seq);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz_remove(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz_remove *p = (struct __pyx_obj_7cytoolz_9itertoolz_remove *)o;
  if (p->predicate) {
    e = (*v)(p->predicate, a); if (e) return e;
  }
  if (p->iter_seq) {
    e = (*v)(p->iter_seq, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz_remove(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz_remove *p = (struct __pyx_obj_7cytoolz_9itertoolz_remove *)o;
  tmp = ((PyObject*)p->predicate);
  p->predicate = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iter_seq);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_remove[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_6remove_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz_remove = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz.remove"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz_remove), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz_remove, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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*/
  __Pyx_DOCSTR(" remove(predicate, seq)\n\n    Return those items of sequence for which predicate(item) is False\n\n    >>> def iseven(x):\n    ...     return x % 2 == 0\n    >>> list(remove(iseven, [1, 2, 3, 4]))\n    [1, 3]\n    "), /*tp_doc*/
  __pyx_tp_traverse_7cytoolz_9itertoolz_remove, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz_remove, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_6remove_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_6remove_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz_remove, /*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_7cytoolz_9itertoolz_remove, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_accumulate(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz_accumulate *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)o);
  p->binop = Py_None; Py_INCREF(Py_None);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  p->result = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_10accumulate_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz_accumulate(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz_accumulate *p = (struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)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->binop);
  Py_CLEAR(p->iter_seq);
  Py_CLEAR(p->result);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz_accumulate(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz_accumulate *p = (struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)o;
  if (p->binop) {
    e = (*v)(p->binop, a); if (e) return e;
  }
  if (p->iter_seq) {
    e = (*v)(p->iter_seq, a); if (e) return e;
  }
  if (p->result) {
    e = (*v)(p->result, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz_accumulate(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz_accumulate *p = (struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)o;
  tmp = ((PyObject*)p->binop);
  p->binop = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iter_seq);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->result);
  p->result = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_accumulate[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz_accumulate = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz.accumulate"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz_accumulate), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz_accumulate, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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*/
  __Pyx_DOCSTR(" accumulate(binop, seq)\n\n    Repeatedly apply binary function to a sequence, accumulating results\n\n    >>> from operator import add, mul\n    >>> list(accumulate(add, [1, 2, 3, 4, 5]))\n    [1, 3, 6, 10, 15]\n    >>> list(accumulate(mul, [1, 2, 3, 4, 5]))\n    [1, 2, 6, 24, 120]\n\n    Accumulate is similar to ``reduce`` and is good for making functions like\n    cumulative sum:\n\n    >>> from functools import partial, reduce\n    >>> sum    = partial(reduce, add)\n    >>> cumsum = partial(accumulate, add)\n\n    See Also:\n        itertools.accumulate :  In standard itertools for Python 3.2+\n    "), /*tp_doc*/
  __pyx_tp_traverse_7cytoolz_9itertoolz_accumulate, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz_accumulate, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_10accumulate_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz_accumulate, /*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_7cytoolz_9itertoolz_accumulate, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__merge_sorted(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)o);
  p->pq = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->shortcut = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__merge_sorted(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)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->pq);
  Py_CLEAR(p->shortcut);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__merge_sorted(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)o;
  if (p->pq) {
    e = (*v)(p->pq, a); if (e) return e;
  }
  if (p->shortcut) {
    e = (*v)(p->shortcut, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__merge_sorted(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)o;
  tmp = ((PyObject*)p->pq);
  p->pq = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->shortcut);
  p->shortcut = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__merge_sorted[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__merge_sorted = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._merge_sorted"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__merge_sorted, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__merge_sorted, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__merge_sorted, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__merge_sorted, /*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_7cytoolz_9itertoolz__merge_sorted, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__merge_sorted_key(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)o);
  p->pq = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->key = Py_None; Py_INCREF(Py_None);
  p->shortcut = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__merge_sorted_key(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)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->pq);
  Py_CLEAR(p->key);
  Py_CLEAR(p->shortcut);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__merge_sorted_key(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)o;
  if (p->pq) {
    e = (*v)(p->pq, a); if (e) return e;
  }
  if (p->key) {
    e = (*v)(p->key, a); if (e) return e;
  }
  if (p->shortcut) {
    e = (*v)(p->shortcut, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__merge_sorted_key(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)o;
  tmp = ((PyObject*)p->pq);
  p->pq = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->key);
  p->key = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->shortcut);
  p->shortcut = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__merge_sorted_key[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__merge_sorted_key = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._merge_sorted_key"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__merge_sorted_key, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__merge_sorted_key, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__merge_sorted_key, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__merge_sorted_key, /*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_7cytoolz_9itertoolz__merge_sorted_key, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_interleave(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz_interleave *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)o);
  p->iters = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->newiters = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->pass_exceptions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_10interleave_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz_interleave(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz_interleave *p = (struct __pyx_obj_7cytoolz_9itertoolz_interleave *)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->iters);
  Py_CLEAR(p->newiters);
  Py_CLEAR(p->pass_exceptions);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz_interleave(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz_interleave *p = (struct __pyx_obj_7cytoolz_9itertoolz_interleave *)o;
  if (p->iters) {
    e = (*v)(p->iters, a); if (e) return e;
  }
  if (p->newiters) {
    e = (*v)(p->newiters, a); if (e) return e;
  }
  if (p->pass_exceptions) {
    e = (*v)(p->pass_exceptions, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz_interleave(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz_interleave *p = (struct __pyx_obj_7cytoolz_9itertoolz_interleave *)o;
  tmp = ((PyObject*)p->iters);
  p->iters = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->newiters);
  p->newiters = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pass_exceptions);
  p->pass_exceptions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_interleave[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz_interleave = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz.interleave"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz_interleave), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz_interleave, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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*/
  __Pyx_DOCSTR(" interleave(seqs, pass_exceptions=())\n\n    Interleave a sequence of sequences\n\n    >>> list(interleave([[1, 2], [3, 4]]))\n    [1, 3, 2, 4]\n\n    >>> ''.join(interleave(('ABC', 'XY')))\n    'AXBYC'\n\n    Both the individual sequences and the sequence of sequences may be infinite\n\n    Returns a lazy iterator\n    "), /*tp_doc*/
  __pyx_tp_traverse_7cytoolz_9itertoolz_interleave, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz_interleave, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_10interleave_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz_interleave, /*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_7cytoolz_9itertoolz_interleave, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__unique_key(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__unique_key *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)o);
  p->key = Py_None; Py_INCREF(Py_None);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  p->seen = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_11_unique_key_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__unique_key(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__unique_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)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->key);
  Py_CLEAR(p->iter_seq);
  Py_CLEAR(p->seen);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__unique_key(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__unique_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)o;
  if (p->key) {
    e = (*v)(p->key, a); if (e) return e;
  }
  if (p->iter_seq) {
    e = (*v)(p->iter_seq, a); if (e) return e;
  }
  if (p->seen) {
    e = (*v)(p->seen, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__unique_key(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__unique_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)o;
  tmp = ((PyObject*)p->key);
  p->key = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iter_seq);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->seen);
  p->seen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__unique_key[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__unique_key = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._unique_key"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__unique_key), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__unique_key, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__unique_key, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__unique_key, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_11_unique_key_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__unique_key, /*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_7cytoolz_9itertoolz__unique_key, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__unique_identity(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)o);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  p->seen = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__unique_identity(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)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->iter_seq);
  Py_CLEAR(p->seen);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__unique_identity(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)o;
  if (p->iter_seq) {
    e = (*v)(p->iter_seq, a); if (e) return e;
  }
  if (p->seen) {
    e = (*v)(p->seen, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__unique_identity(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)o;
  tmp = ((PyObject*)p->iter_seq);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->seen);
  p->seen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__unique_identity[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__unique_identity = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._unique_identity"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__unique_identity, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__unique_identity, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__unique_identity, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__unique_identity, /*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_7cytoolz_9itertoolz__unique_identity, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_interpose(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz_interpose *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)o);
  p->el = Py_None; Py_INCREF(Py_None);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  p->val = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_9interpose_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz_interpose(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz_interpose *p = (struct __pyx_obj_7cytoolz_9itertoolz_interpose *)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->el);
  Py_CLEAR(p->iter_seq);
  Py_CLEAR(p->val);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz_interpose(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz_interpose *p = (struct __pyx_obj_7cytoolz_9itertoolz_interpose *)o;
  if (p->el) {
    e = (*v)(p->el, a); if (e) return e;
  }
  if (p->iter_seq) {
    e = (*v)(p->iter_seq, a); if (e) return e;
  }
  if (p->val) {
    e = (*v)(p->val, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz_interpose(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz_interpose *p = (struct __pyx_obj_7cytoolz_9itertoolz_interpose *)o;
  tmp = ((PyObject*)p->el);
  p->el = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iter_seq);
  p->iter_seq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->val);
  p->val = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_interpose[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz_interpose = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz.interpose"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz_interpose), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz_interpose, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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*/
  __Pyx_DOCSTR(" interpose(el, seq)\n\n    Introduce element between each pair of elements in seq\n\n    >>> list(interpose(\"a\", [1, 2, 3]))\n    [1, 'a', 2, 'a', 3]\n    "), /*tp_doc*/
  __pyx_tp_traverse_7cytoolz_9itertoolz_interpose, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz_interpose, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_9interpose_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz_interpose, /*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_7cytoolz_9itertoolz_interpose, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_iterate(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz_iterate *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)o);
  p->func = Py_None; Py_INCREF(Py_None);
  p->x = Py_None; Py_INCREF(Py_None);
  p->val = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_7iterate_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz_iterate(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz_iterate *p = (struct __pyx_obj_7cytoolz_9itertoolz_iterate *)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->func);
  Py_CLEAR(p->x);
  Py_CLEAR(p->val);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz_iterate(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz_iterate *p = (struct __pyx_obj_7cytoolz_9itertoolz_iterate *)o;
  if (p->func) {
    e = (*v)(p->func, a); if (e) return e;
  }
  if (p->x) {
    e = (*v)(p->x, a); if (e) return e;
  }
  if (p->val) {
    e = (*v)(p->val, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz_iterate(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz_iterate *p = (struct __pyx_obj_7cytoolz_9itertoolz_iterate *)o;
  tmp = ((PyObject*)p->func);
  p->func = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->x);
  p->x = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->val);
  p->val = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_iterate[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz_iterate = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz.iterate"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz_iterate), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz_iterate, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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*/
  __Pyx_DOCSTR(" iterate(func, x)\n\n    Repeatedly apply a function func onto an original input\n\n    Yields x, then func(x), then func(func(x)), then func(func(func(x))), etc..\n\n    >>> def inc(x):  return x + 1\n    >>> counter = iterate(inc, 0)\n    >>> next(counter)\n    0\n    >>> next(counter)\n    1\n    >>> next(counter)\n    2\n\n    >>> double = lambda x: x * 2\n    >>> powers_of_two = iterate(double, 1)\n    >>> next(powers_of_two)\n    1\n    >>> next(powers_of_two)\n    2\n    >>> next(powers_of_two)\n    4\n    >>> next(powers_of_two)\n    8\n\n    "), /*tp_doc*/
  __pyx_tp_traverse_7cytoolz_9itertoolz_iterate, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz_iterate, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_7iterate_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz_iterate, /*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_7cytoolz_9itertoolz_iterate, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_sliding_window(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)o);
  p->iterseq = Py_None; Py_INCREF(Py_None);
  p->prev = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_14sliding_window_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz_sliding_window(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *p = (struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)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->iterseq);
  Py_CLEAR(p->prev);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz_sliding_window(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *p = (struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)o;
  if (p->iterseq) {
    e = (*v)(p->iterseq, a); if (e) return e;
  }
  if (p->prev) {
    e = (*v)(p->prev, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz_sliding_window(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *p = (struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)o;
  tmp = ((PyObject*)p->iterseq);
  p->iterseq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->prev);
  p->prev = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_sliding_window[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz_sliding_window = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz.sliding_window"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz_sliding_window, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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*/
  __Pyx_DOCSTR(" sliding_window(n, seq)\n\n    A sequence of overlapping subsequences\n\n    >>> list(sliding_window(2, [1, 2, 3, 4]))\n    [(1, 2), (2, 3), (3, 4)]\n\n    This function creates a sliding window suitable for transformations like\n    sliding means / smoothing\n\n    >>> mean = lambda seq: float(sum(seq)) / len(seq)\n    >>> list(map(mean, sliding_window(2, [1, 2, 3, 4])))\n    [1.5, 2.5, 3.5]\n    "), /*tp_doc*/
  __pyx_tp_traverse_7cytoolz_9itertoolz_sliding_window, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz_sliding_window, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_14sliding_window_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz_sliding_window, /*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_7cytoolz_9itertoolz_sliding_window, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_partition_all(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz_partition_all *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)o);
  p->iterseq = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_13partition_all_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz_partition_all(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz_partition_all *p = (struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)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->iterseq);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz_partition_all(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz_partition_all *p = (struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)o;
  if (p->iterseq) {
    e = (*v)(p->iterseq, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz_partition_all(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz_partition_all *p = (struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)o;
  tmp = ((PyObject*)p->iterseq);
  p->iterseq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_partition_all[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz_partition_all = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz.partition_all"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz_partition_all), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz_partition_all, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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*/
  __Pyx_DOCSTR(" partition_all(n, seq)\n\n    Partition all elements of sequence into tuples of length at most n\n\n    The final tuple may be shorter to accommodate extra elements.\n\n    >>> list(partition_all(2, [1, 2, 3, 4]))\n    [(1, 2), (3, 4)]\n\n    >>> list(partition_all(2, [1, 2, 3, 4, 5]))\n    [(1, 2), (3, 4), (5,)]\n\n    See Also:\n        partition\n    "), /*tp_doc*/
  __pyx_tp_traverse_7cytoolz_9itertoolz_partition_all, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz_partition_all, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_13partition_all_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz_partition_all, /*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_7cytoolz_9itertoolz_partition_all, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_index(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)o);
  p->ind = Py_None; Py_INCREF(Py_None);
  p->iterseqs = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_index(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)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->ind);
  Py_CLEAR(p->iterseqs);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__pluck_index(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)o;
  if (p->ind) {
    e = (*v)(p->ind, a); if (e) return e;
  }
  if (p->iterseqs) {
    e = (*v)(p->iterseqs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__pluck_index(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)o;
  tmp = ((PyObject*)p->ind);
  p->ind = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iterseqs);
  p->iterseqs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__pluck_index[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__pluck_index = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._pluck_index"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_index, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__pluck_index, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__pluck_index, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__pluck_index, /*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_7cytoolz_9itertoolz__pluck_index, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_index_default(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)o);
  p->ind = Py_None; Py_INCREF(Py_None);
  p->iterseqs = Py_None; Py_INCREF(Py_None);
  p->__pyx_default = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_index_default(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)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->ind);
  Py_CLEAR(p->iterseqs);
  Py_CLEAR(p->__pyx_default);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__pluck_index_default(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)o;
  if (p->ind) {
    e = (*v)(p->ind, a); if (e) return e;
  }
  if (p->iterseqs) {
    e = (*v)(p->iterseqs, a); if (e) return e;
  }
  if (p->__pyx_default) {
    e = (*v)(p->__pyx_default, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__pluck_index_default(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)o;
  tmp = ((PyObject*)p->ind);
  p->ind = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iterseqs);
  p->iterseqs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_default);
  p->__pyx_default = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__pluck_index_default[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__pluck_index_default = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._pluck_index_default"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_index_default, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__pluck_index_default, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__pluck_index_default, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__pluck_index_default, /*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_7cytoolz_9itertoolz__pluck_index_default, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_list(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)o);
  p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->iterseqs = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_list(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)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->ind);
  Py_CLEAR(p->iterseqs);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__pluck_list(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)o;
  if (p->ind) {
    e = (*v)(p->ind, a); if (e) return e;
  }
  if (p->iterseqs) {
    e = (*v)(p->iterseqs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__pluck_list(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)o;
  tmp = ((PyObject*)p->ind);
  p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iterseqs);
  p->iterseqs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__pluck_list[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__pluck_list = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._pluck_list"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_list, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__pluck_list, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__pluck_list, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__pluck_list, /*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_7cytoolz_9itertoolz__pluck_list, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_list_default(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)o);
  p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->iterseqs = Py_None; Py_INCREF(Py_None);
  p->__pyx_default = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_list_default(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)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->ind);
  Py_CLEAR(p->iterseqs);
  Py_CLEAR(p->__pyx_default);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__pluck_list_default(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)o;
  if (p->ind) {
    e = (*v)(p->ind, a); if (e) return e;
  }
  if (p->iterseqs) {
    e = (*v)(p->iterseqs, a); if (e) return e;
  }
  if (p->__pyx_default) {
    e = (*v)(p->__pyx_default, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__pluck_list_default(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)o;
  tmp = ((PyObject*)p->ind);
  p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iterseqs);
  p->iterseqs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_default);
  p->__pyx_default = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__pluck_list_default[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__pluck_list_default = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._pluck_list_default"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_list_default, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__pluck_list_default, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__pluck_list_default, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_3__iter__, /*tp_iter*/
  __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__pluck_list_default, /*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_7cytoolz_9itertoolz__pluck_list_default, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_vtable_7cytoolz_9itertoolz__join;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__join(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__join *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__join *)o);
  p->__pyx_vtab = __pyx_vtabptr_7cytoolz_9itertoolz__join;
  p->d = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->matches = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->seen_keys = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->leftseq = Py_None; Py_INCREF(Py_None);
  p->rightseq = Py_None; Py_INCREF(Py_None);
  p->_rightkey = Py_None; Py_INCREF(Py_None);
  p->right = Py_None; Py_INCREF(Py_None);
  p->left_default = Py_None; Py_INCREF(Py_None);
  p->right_default = Py_None; Py_INCREF(Py_None);
  p->keys = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7cytoolz_9itertoolz_5_join_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7cytoolz_9itertoolz__join(PyObject *o) {
  struct __pyx_obj_7cytoolz_9itertoolz__join *p = (struct __pyx_obj_7cytoolz_9itertoolz__join *)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->d);
  Py_CLEAR(p->matches);
  Py_CLEAR(p->seen_keys);
  Py_CLEAR(p->leftseq);
  Py_CLEAR(p->rightseq);
  Py_CLEAR(p->_rightkey);
  Py_CLEAR(p->right);
  Py_CLEAR(p->left_default);
  Py_CLEAR(p->right_default);
  Py_CLEAR(p->keys);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7cytoolz_9itertoolz__join(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7cytoolz_9itertoolz__join *p = (struct __pyx_obj_7cytoolz_9itertoolz__join *)o;
  if (p->d) {
    e = (*v)(p->d, a); if (e) return e;
  }
  if (p->matches) {
    e = (*v)(p->matches, a); if (e) return e;
  }
  if (p->seen_keys) {
    e = (*v)(p->seen_keys, a); if (e) return e;
  }
  if (p->leftseq) {
    e = (*v)(p->leftseq, a); if (e) return e;
  }
  if (p->rightseq) {
    e = (*v)(p->rightseq, a); if (e) return e;
  }
  if (p->_rightkey) {
    e = (*v)(p->_rightkey, a); if (e) return e;
  }
  if (p->right) {
    e = (*v)(p->right, a); if (e) return e;
  }
  if (p->left_default) {
    e = (*v)(p->left_default, a); if (e) return e;
  }
  if (p->right_default) {
    e = (*v)(p->right_default, a); if (e) return e;
  }
  if (p->keys) {
    e = (*v)(p->keys, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7cytoolz_9itertoolz__join(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7cytoolz_9itertoolz__join *p = (struct __pyx_obj_7cytoolz_9itertoolz__join *)o;
  tmp = ((PyObject*)p->d);
  p->d = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->matches);
  p->matches = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->seen_keys);
  p->seen_keys = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->leftseq);
  p->leftseq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rightseq);
  p->rightseq = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_rightkey);
  p->_rightkey = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->right);
  p->right = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->left_default);
  p->left_default = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->right_default);
  p->right_default = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->keys);
  p->keys = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__join[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__join = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._join"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__join), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__join, /*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_7cytoolz_9itertoolz__join, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_vtable_7cytoolz_9itertoolz__inner_join;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__inner_join *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__inner_join *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__inner_join;
  return o;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__inner_join[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__inner_join = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._inner_join"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__inner_join, /*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_7cytoolz_9itertoolz__inner_join, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_vtable_7cytoolz_9itertoolz__right_outer_join;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join;
  return o;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__right_outer_join[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__right_outer_join = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._right_outer_join"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__right_outer_join, /*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_7cytoolz_9itertoolz__right_outer_join, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_vtable_7cytoolz_9itertoolz__left_outer_join;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join;
  return o;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__left_outer_join[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__left_outer_join = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._left_outer_join"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__left_outer_join, /*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_7cytoolz_9itertoolz__left_outer_join, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_vtable_7cytoolz_9itertoolz__outer_join;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__outer_join *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__outer_join *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__outer_join;
  return o;
}

static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__outer_join[] = {
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__outer_join = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._outer_join"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, /*tp_iternext*/
  __pyx_methods_7cytoolz_9itertoolz__outer_join, /*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_7cytoolz_9itertoolz__outer_join, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key __pyx_vtable_7cytoolz_9itertoolz__inner_join_key;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_key(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__inner_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__inner_join_key = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._inner_join_key"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__inner_join_key, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index __pyx_vtable_7cytoolz_9itertoolz__inner_join_index;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_index(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__inner_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__inner_join_index = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._inner_join_index"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__inner_join_index, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices __pyx_vtable_7cytoolz_9itertoolz__inner_join_indices;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_indices(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__inner_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__inner_join_indices = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._inner_join_indices"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__inner_join_indices, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_key;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__right_outer_join_key = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._right_outer_join_key"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__right_outer_join_key, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_index;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__right_outer_join_index = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._right_outer_join_index"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__right_outer_join_index, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_indices;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__right_outer_join_indices = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._right_outer_join_indices"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__right_outer_join_indices, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_key;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__left_outer_join_key = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._left_outer_join_key"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__left_outer_join_key, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_index;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__left_outer_join_index = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._left_outer_join_index"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__left_outer_join_index, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_indices;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__left_outer_join_indices = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._left_outer_join_indices"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__left_outer_join_indices, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key __pyx_vtable_7cytoolz_9itertoolz__outer_join_key;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__outer_join_key = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._outer_join_key"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__outer_join_key, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index __pyx_vtable_7cytoolz_9itertoolz__outer_join_index;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__outer_join_index = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._outer_join_index"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__outer_join_index, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices __pyx_vtable_7cytoolz_9itertoolz__outer_join_indices;

static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *p;
  PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__outer_join(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices;
  return o;
}

static PyTypeObject __pyx_type_7cytoolz_9itertoolz__outer_join_indices = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("cytoolz.itertoolz._outer_join_indices"), /*tp_name*/
  sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_7cytoolz_9itertoolz__join, /*tp_traverse*/
  __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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_7cytoolz_9itertoolz__outer_join_indices, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("identity"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_1identity, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_identity)},
  {__Pyx_NAMESTR("groupby"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_3groupby, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_2groupby)},
  {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_7unique, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_6unique)},
  {__Pyx_NAMESTR("isiterable"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9isiterable, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_8isiterable)},
  {__Pyx_NAMESTR("isdistinct"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11isdistinct, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_10isdistinct)},
  {__Pyx_NAMESTR("take"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13take, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_12take)},
  {__Pyx_NAMESTR("drop"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15drop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_14drop)},
  {__Pyx_NAMESTR("take_nth"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17take_nth, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_16take_nth)},
  {__Pyx_NAMESTR("first"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19first, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_18first)},
  {__Pyx_NAMESTR("second"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_21second, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_20second)},
  {__Pyx_NAMESTR("nth"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_23nth, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_22nth)},
  {__Pyx_NAMESTR("last"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_25last, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_24last)},
  {__Pyx_NAMESTR("rest"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_27rest, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_26rest)},
  {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_29get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_28get)},
  {__Pyx_NAMESTR("mapcat"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_31mapcat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_30mapcat)},
  {__Pyx_NAMESTR("cons"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_33cons, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_32cons)},
  {__Pyx_NAMESTR("frequencies"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_35frequencies, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_34frequencies)},
  {__Pyx_NAMESTR("reduceby"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_37reduceby, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_36reduceby)},
  {__Pyx_NAMESTR("partition"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_39partition, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_38partition)},
  {__Pyx_NAMESTR("count"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_41count, METH_O, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_40count)},
  {__Pyx_NAMESTR("pluck"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_43pluck, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_42pluck)},
  {__Pyx_NAMESTR("join"), (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_45join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7cytoolz_9itertoolz_44join)},
  {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
    __Pyx_NAMESTR("itertoolz"),
    0, /* 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_u_Add_el_to_beginning_of_possibly, __pyx_k_Add_el_to_beginning_of_possibly, sizeof(__pyx_k_Add_el_to_beginning_of_possibly), 0, 1, 0, 0},
  {&__pyx_kp_u_All_values_in_sequence_are_dist, __pyx_k_All_values_in_sequence_are_dist, sizeof(__pyx_k_All_values_in_sequence_are_dist), 0, 1, 0, 0},
  {&__pyx_kp_u_Apply_func_to_each_sequence_in, __pyx_k_Apply_func_to_each_sequence_in, sizeof(__pyx_k_Apply_func_to_each_sequence_in), 0, 1, 0, 0},
  {&__pyx_kp_u_Every_nth_item_in_seq_list_take, __pyx_k_Every_nth_item_in_seq_list_take, sizeof(__pyx_k_Every_nth_item_in_seq_list_take), 0, 1, 0, 0},
  {&__pyx_kp_u_Find_number_of_occurrences_of_e, __pyx_k_Find_number_of_occurrences_of_e, sizeof(__pyx_k_Find_number_of_occurrences_of_e), 0, 1, 0, 0},
  {&__pyx_kp_u_Get_element_in_a_sequence_or_di, __pyx_k_Get_element_in_a_sequence_or_di, sizeof(__pyx_k_Get_element_in_a_sequence_or_di), 0, 1, 0, 0},
  {&__pyx_kp_u_Group_a_collection_by_a_key_fun, __pyx_k_Group_a_collection_by_a_key_fun, sizeof(__pyx_k_Group_a_collection_by_a_key_fun), 0, 1, 0, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_u_Is_x_iterable_isiterable_1_2_3, __pyx_k_Is_x_iterable_isiterable_1_2_3, sizeof(__pyx_k_Is_x_iterable_isiterable_1_2_3), 0, 1, 0, 0},
  {&__pyx_kp_u_Join_two_sequences_on_common_at, __pyx_k_Join_two_sequences_on_common_at, sizeof(__pyx_k_Join_two_sequences_on_common_at), 0, 1, 0, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_u_Merge_and_sort_a_collection_of, __pyx_k_Merge_and_sort_a_collection_of, sizeof(__pyx_k_Merge_and_sort_a_collection_of), 0, 1, 0, 0},
  {&__pyx_kp_u_Partition_sequence_into_tuples, __pyx_k_Partition_sequence_into_tuples, sizeof(__pyx_k_Partition_sequence_into_tuples), 0, 1, 0, 0},
  {&__pyx_kp_u_Perform_a_simultaneous_groupby, __pyx_k_Perform_a_simultaneous_groupby, sizeof(__pyx_k_Perform_a_simultaneous_groupby), 0, 1, 0, 0},
  {&__pyx_kp_u_Return_only_unique_elements_of, __pyx_k_Return_only_unique_elements_of, sizeof(__pyx_k_Return_only_unique_elements_of), 0, 1, 0, 0},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_kp_u_The_first_element_in_a_sequence, __pyx_k_The_first_element_in_a_sequence, sizeof(__pyx_k_The_first_element_in_a_sequence), 0, 1, 0, 0},
  {&__pyx_kp_u_The_first_n_elements_of_a_seque, __pyx_k_The_first_n_elements_of_a_seque, sizeof(__pyx_k_The_first_n_elements_of_a_seque), 0, 1, 0, 0},
  {&__pyx_kp_u_The_last_element_in_a_sequence, __pyx_k_The_last_element_in_a_sequence, sizeof(__pyx_k_The_last_element_in_a_sequence), 0, 1, 0, 0},
  {&__pyx_kp_u_The_nth_element_in_a_sequence_n, __pyx_k_The_nth_element_in_a_sequence_n, sizeof(__pyx_k_The_nth_element_in_a_sequence_n), 0, 1, 0, 0},
  {&__pyx_kp_u_The_second_element_in_a_sequenc, __pyx_k_The_second_element_in_a_sequenc, sizeof(__pyx_k_The_second_element_in_a_sequenc), 0, 1, 0, 0},
  {&__pyx_kp_u_The_sequence_following_the_firs, __pyx_k_The_sequence_following_the_firs, sizeof(__pyx_k_The_sequence_following_the_firs), 0, 1, 0, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_accumulate, __pyx_k_accumulate, sizeof(__pyx_k_accumulate), 0, 0, 1, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_binop, __pyx_k_binop, sizeof(__pyx_k_binop), 0, 0, 1, 1},
  {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1},
  {&__pyx_n_s_compatibility, __pyx_k_compatibility, sizeof(__pyx_k_compatibility), 0, 0, 1, 1},
  {&__pyx_n_s_concat, __pyx_k_concat, sizeof(__pyx_k_concat), 0, 0, 1, 1},
  {&__pyx_n_s_concatv, __pyx_k_concatv, sizeof(__pyx_k_concatv), 0, 0, 1, 1},
  {&__pyx_n_s_cons, __pyx_k_cons, sizeof(__pyx_k_cons), 0, 0, 1, 1},
  {&__pyx_kp_u_cons_line_665, __pyx_k_cons_line_665, sizeof(__pyx_k_cons_line_665), 0, 1, 0, 0},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_cytoolz_itertoolz, __pyx_k_cytoolz_itertoolz, sizeof(__pyx_k_cytoolz_itertoolz), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_n_s_drop, __pyx_k_drop, sizeof(__pyx_k_drop), 0, 0, 1, 1},
  {&__pyx_kp_u_drop_line_479, __pyx_k_drop_line_479, sizeof(__pyx_k_drop_line_479), 0, 1, 0, 0},
  {&__pyx_n_s_el, __pyx_k_el, sizeof(__pyx_k_el), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_fillvalue, __pyx_k_fillvalue, sizeof(__pyx_k_fillvalue), 0, 0, 1, 1},
  {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1},
  {&__pyx_kp_u_first_line_509, __pyx_k_first_line_509, sizeof(__pyx_k_first_line_509), 0, 1, 0, 0},
  {&__pyx_n_s_frequencies, __pyx_k_frequencies, sizeof(__pyx_k_frequencies), 0, 0, 1, 1},
  {&__pyx_kp_u_frequencies_line_705, __pyx_k_frequencies_line_705, sizeof(__pyx_k_frequencies_line_705), 0, 1, 0, 0},
  {&__pyx_n_s_from_iterable, __pyx_k_from_iterable, sizeof(__pyx_k_from_iterable), 0, 0, 1, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_kp_u_get_line_578, __pyx_k_get_line_578, sizeof(__pyx_k_get_line_578), 0, 1, 0, 0},
  {&__pyx_n_s_groupby, __pyx_k_groupby, sizeof(__pyx_k_groupby), 0, 0, 1, 1},
  {&__pyx_kp_u_groupby_line_110, __pyx_k_groupby_line_110, sizeof(__pyx_k_groupby_line_110), 0, 1, 0, 0},
  {&__pyx_n_s_heapify, __pyx_k_heapify, sizeof(__pyx_k_heapify), 0, 0, 1, 1},
  {&__pyx_n_s_heappop, __pyx_k_heappop, sizeof(__pyx_k_heappop), 0, 0, 1, 1},
  {&__pyx_n_s_heapq, __pyx_k_heapq, sizeof(__pyx_k_heapq), 0, 0, 1, 1},
  {&__pyx_n_s_heapreplace, __pyx_k_heapreplace, sizeof(__pyx_k_heapreplace), 0, 0, 1, 1},
  {&__pyx_kp_s_home_erik_git_cytoolz_cytoolz_i, __pyx_k_home_erik_git_cytoolz_cytoolz_i, sizeof(__pyx_k_home_erik_git_cytoolz_cytoolz_i), 0, 0, 1, 0},
  {&__pyx_n_s_identity, __pyx_k_identity, sizeof(__pyx_k_identity), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_interleave, __pyx_k_interleave, sizeof(__pyx_k_interleave), 0, 0, 1, 1},
  {&__pyx_n_s_interpose, __pyx_k_interpose, sizeof(__pyx_k_interpose), 0, 0, 1, 1},
  {&__pyx_n_s_isdistinct, __pyx_k_isdistinct, sizeof(__pyx_k_isdistinct), 0, 0, 1, 1},
  {&__pyx_kp_u_isdistinct_line_444, __pyx_k_isdistinct_line_444, sizeof(__pyx_k_isdistinct_line_444), 0, 1, 0, 0},
  {&__pyx_n_s_isiterable, __pyx_k_isiterable, sizeof(__pyx_k_isiterable), 0, 0, 1, 1},
  {&__pyx_kp_u_isiterable_line_425, __pyx_k_isiterable_line_425, sizeof(__pyx_k_isiterable_line_425), 0, 1, 0, 0},
  {&__pyx_n_s_islice, __pyx_k_islice, sizeof(__pyx_k_islice), 0, 0, 1, 1},
  {&__pyx_n_s_itemgetter, __pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 0, 1, 1},
  {&__pyx_n_s_iterate, __pyx_k_iterate, sizeof(__pyx_k_iterate), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_kp_u_join_line_1111, __pyx_k_join_line_1111, sizeof(__pyx_k_join_line_1111), 0, 1, 0, 0},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1},
  {&__pyx_kp_u_last_line_550, __pyx_k_last_line_550, sizeof(__pyx_k_last_line_550), 0, 1, 0, 0},
  {&__pyx_n_s_left_default, __pyx_k_left_default, sizeof(__pyx_k_left_default), 0, 0, 1, 1},
  {&__pyx_n_s_leftkey, __pyx_k_leftkey, sizeof(__pyx_k_leftkey), 0, 0, 1, 1},
  {&__pyx_n_s_leftseq, __pyx_k_leftseq, sizeof(__pyx_k_leftseq), 0, 0, 1, 1},
  {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_mapcat, __pyx_k_mapcat, sizeof(__pyx_k_mapcat), 0, 0, 1, 1},
  {&__pyx_kp_u_mapcat_line_654, __pyx_k_mapcat_line_654, sizeof(__pyx_k_mapcat_line_654), 0, 1, 0, 0},
  {&__pyx_n_s_merge_sorted, __pyx_k_merge_sorted, sizeof(__pyx_k_merge_sorted), 0, 0, 1, 1},
  {&__pyx_kp_u_merge_sorted_line_278, __pyx_k_merge_sorted_line_278, sizeof(__pyx_k_merge_sorted_line_278), 0, 1, 0, 0},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_kp_s_n_argument_for_drop_must_be_non, __pyx_k_n_argument_for_drop_must_be_non, sizeof(__pyx_k_n_argument_for_drop_must_be_non), 0, 0, 1, 0},
  {&__pyx_n_s_no__default, __pyx_k_no__default, sizeof(__pyx_k_no__default), 0, 0, 1, 1},
  {&__pyx_n_s_no__pad, __pyx_k_no__pad, sizeof(__pyx_k_no__pad), 0, 0, 1, 1},
  {&__pyx_n_s_no_default, __pyx_k_no_default, sizeof(__pyx_k_no_default), 0, 0, 1, 1},
  {&__pyx_n_s_no_pad, __pyx_k_no_pad, sizeof(__pyx_k_no_pad), 0, 0, 1, 1},
  {&__pyx_n_s_nth, __pyx_k_nth, sizeof(__pyx_k_nth), 0, 0, 1, 1},
  {&__pyx_kp_u_nth_line_531, __pyx_k_nth_line_531, sizeof(__pyx_k_nth_line_531), 0, 1, 0, 0},
  {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1},
  {&__pyx_n_s_pad, __pyx_k_pad, sizeof(__pyx_k_pad), 0, 0, 1, 1},
  {&__pyx_n_s_partition, __pyx_k_partition, sizeof(__pyx_k_partition), 0, 0, 1, 1},
  {&__pyx_n_s_partition_all, __pyx_k_partition_all, sizeof(__pyx_k_partition_all), 0, 0, 1, 1},
  {&__pyx_kp_u_partition_line_903, __pyx_k_partition_line_903, sizeof(__pyx_k_partition_line_903), 0, 1, 0, 0},
  {&__pyx_n_s_pass_exceptions, __pyx_k_pass_exceptions, sizeof(__pyx_k_pass_exceptions), 0, 0, 1, 1},
  {&__pyx_n_s_pluck, __pyx_k_pluck, sizeof(__pyx_k_pluck), 0, 0, 1, 1},
  {&__pyx_kp_u_pluck_line_1075, __pyx_k_pluck_line_1075, sizeof(__pyx_k_pluck_line_1075), 0, 1, 0, 0},
  {&__pyx_kp_u_plucks_an_element_or_several_el, __pyx_k_plucks_an_element_or_several_el, sizeof(__pyx_k_plucks_an_element_or_several_el), 0, 1, 0, 0},
  {&__pyx_n_s_predicate, __pyx_k_predicate, sizeof(__pyx_k_predicate), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_reduceby, __pyx_k_reduceby, sizeof(__pyx_k_reduceby), 0, 0, 1, 1},
  {&__pyx_kp_u_reduceby_line_740, __pyx_k_reduceby_line_740, sizeof(__pyx_k_reduceby_line_740), 0, 1, 0, 0},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_right_default, __pyx_k_right_default, sizeof(__pyx_k_right_default), 0, 0, 1, 1},
  {&__pyx_n_s_rightkey, __pyx_k_rightkey, sizeof(__pyx_k_rightkey), 0, 0, 1, 1},
  {&__pyx_n_s_rightseq, __pyx_k_rightseq, sizeof(__pyx_k_rightseq), 0, 0, 1, 1},
  {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
  {&__pyx_kp_u_second_line_519, __pyx_k_second_line_519, sizeof(__pyx_k_second_line_519), 0, 1, 0, 0},
  {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1},
  {&__pyx_n_s_seqs, __pyx_k_seqs, sizeof(__pyx_k_seqs), 0, 0, 1, 1},
  {&__pyx_n_s_sliding_window, __pyx_k_sliding_window, sizeof(__pyx_k_sliding_window), 0, 0, 1, 1},
  {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1},
  {&__pyx_kp_u_take_line_469, __pyx_k_take_line_469, sizeof(__pyx_k_take_line_469), 0, 1, 0, 0},
  {&__pyx_n_s_take_nth, __pyx_k_take_nth, sizeof(__pyx_k_take_nth), 0, 0, 1, 1},
  {&__pyx_kp_u_take_nth_line_499, __pyx_k_take_nth_line_499, sizeof(__pyx_k_take_nth_line_499), 0, 1, 0, 0},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1},
  {&__pyx_kp_u_unique_line_405, __pyx_k_unique_line_405, sizeof(__pyx_k_unique_line_405), 0, 1, 0, 0},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {&__pyx_n_s_zip_longest, __pyx_k_zip_longest, sizeof(__pyx_k_zip_longest), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

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

  /* "cytoolz/itertoolz.pyx":487
 *     """
 *     if n < 0:
 *         raise ValueError('n argument for drop() must be non-negative')             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i
 *     cdef object iter_seq
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_n_argument_for_drop_must_be_non); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "cytoolz/itertoolz.pyx":278
 * 
 * 
 * def merge_sorted(*seqs, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Merge and sort a collection of sorted collections
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_seqs, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_erik_git_cytoolz_cytoolz_i, __pyx_n_s_merge_sorted, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC inititertoolz(void); /*proto*/
PyMODINIT_FUNC inititertoolz(void)
#else
PyMODINIT_FUNC PyInit_itertoolz(void); /*proto*/
PyMODINIT_FUNC PyInit_itertoolz(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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_itertoolz(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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(__Pyx_NAMESTR("itertoolz"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_cytoolz__itertoolz) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "cytoolz.itertoolz")) {
      if (unlikely(PyDict_SetItemString(modules, "cytoolz.itertoolz", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_7cytoolz_9itertoolz__get_exceptions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_7cytoolz_9itertoolz__get_list_exc = ((PyObject*)Py_None); Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("groupby", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_groupby, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("c_merge_sorted", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_c_merge_sorted, "PyObject *(PyObject *, struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("unique", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_unique, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_unique *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("isiterable", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_isiterable, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("isdistinct", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_isdistinct, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("take", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_take, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("drop", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_drop, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("take_nth", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_take_nth, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("first", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_first, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("second", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_second, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("nth", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_nth, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("last", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_last, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("rest", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_rest, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("get", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_get, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_get *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("cons", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_cons, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("mapcat", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_mapcat, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("frequencies", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_frequencies, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("reduceby", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_reduceby, "PyObject *(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("partition", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_partition, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_partition *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("count", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_count, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("pluck", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_pluck, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_pluck *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("join", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_join, "PyObject *(PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_join *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_remove) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz_remove.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "remove", (PyObject *)&__pyx_type_7cytoolz_9itertoolz_remove) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz_remove = &__pyx_type_7cytoolz_9itertoolz_remove;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_accumulate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz_accumulate.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "accumulate", (PyObject *)&__pyx_type_7cytoolz_9itertoolz_accumulate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz_accumulate = &__pyx_type_7cytoolz_9itertoolz_accumulate;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__merge_sorted) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__merge_sorted.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "_merge_sorted", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__merge_sorted) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__merge_sorted = &__pyx_type_7cytoolz_9itertoolz__merge_sorted;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__merge_sorted_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__merge_sorted_key.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "_merge_sorted_key", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__merge_sorted_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key = &__pyx_type_7cytoolz_9itertoolz__merge_sorted_key;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_interleave) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz_interleave.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "interleave", (PyObject *)&__pyx_type_7cytoolz_9itertoolz_interleave) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz_interleave = &__pyx_type_7cytoolz_9itertoolz_interleave;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__unique_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__unique_key.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "_unique_key", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__unique_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__unique_key = &__pyx_type_7cytoolz_9itertoolz__unique_key;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__unique_identity) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__unique_identity.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "_unique_identity", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__unique_identity) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__unique_identity = &__pyx_type_7cytoolz_9itertoolz__unique_identity;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_interpose) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz_interpose.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "interpose", (PyObject *)&__pyx_type_7cytoolz_9itertoolz_interpose) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz_interpose = &__pyx_type_7cytoolz_9itertoolz_interpose;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_iterate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz_iterate.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "iterate", (PyObject *)&__pyx_type_7cytoolz_9itertoolz_iterate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz_iterate = &__pyx_type_7cytoolz_9itertoolz_iterate;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_sliding_window) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz_sliding_window.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "sliding_window", (PyObject *)&__pyx_type_7cytoolz_9itertoolz_sliding_window) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz_sliding_window = &__pyx_type_7cytoolz_9itertoolz_sliding_window;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_partition_all) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz_partition_all.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "partition_all", (PyObject *)&__pyx_type_7cytoolz_9itertoolz_partition_all) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz_partition_all = &__pyx_type_7cytoolz_9itertoolz_partition_all;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__pluck_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__pluck_index.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "_pluck_index", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__pluck_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__pluck_index = &__pyx_type_7cytoolz_9itertoolz__pluck_index;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__pluck_index_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__pluck_index_default.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "_pluck_index_default", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__pluck_index_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__pluck_index_default = &__pyx_type_7cytoolz_9itertoolz__pluck_index_default;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__pluck_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__pluck_list.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "_pluck_list", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__pluck_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__pluck_list = &__pyx_type_7cytoolz_9itertoolz__pluck_list;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__pluck_list_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__pluck_list_default.tp_print = 0;
  if (__Pyx_SetAttrString(__pyx_m, "_pluck_list_default", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__pluck_list_default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__pluck_list_default = &__pyx_type_7cytoolz_9itertoolz__pluck_list_default;
  __pyx_vtabptr_7cytoolz_9itertoolz__join = &__pyx_vtable_7cytoolz_9itertoolz__join;
  __pyx_vtable_7cytoolz_9itertoolz__join.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_5_join_rightkey;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__join.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_join", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__join = &__pyx_type_7cytoolz_9itertoolz__join;
  __pyx_vtabptr_7cytoolz_9itertoolz__inner_join = &__pyx_vtable_7cytoolz_9itertoolz__inner_join;
  __pyx_vtable_7cytoolz_9itertoolz__inner_join.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__join;
  __pyx_type_7cytoolz_9itertoolz__inner_join.tp_base = __pyx_ptype_7cytoolz_9itertoolz__join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__inner_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__inner_join.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__inner_join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__inner_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_inner_join", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__inner_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__inner_join = &__pyx_type_7cytoolz_9itertoolz__inner_join;
  __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join = &__pyx_vtable_7cytoolz_9itertoolz__right_outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__right_outer_join.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__join;
  __pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_base = __pyx_ptype_7cytoolz_9itertoolz__join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__right_outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_right_outer_join", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__right_outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__right_outer_join = &__pyx_type_7cytoolz_9itertoolz__right_outer_join;
  __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join = &__pyx_vtable_7cytoolz_9itertoolz__left_outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__left_outer_join.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__join;
  __pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_base = __pyx_ptype_7cytoolz_9itertoolz__join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__left_outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_left_outer_join", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__left_outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__left_outer_join = &__pyx_type_7cytoolz_9itertoolz__left_outer_join;
  __pyx_vtabptr_7cytoolz_9itertoolz__outer_join = &__pyx_vtable_7cytoolz_9itertoolz__outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__outer_join.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__join;
  __pyx_type_7cytoolz_9itertoolz__outer_join.tp_base = __pyx_ptype_7cytoolz_9itertoolz__join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__outer_join.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__outer_join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_outer_join", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__outer_join) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__outer_join = &__pyx_type_7cytoolz_9itertoolz__outer_join;
  __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key = &__pyx_vtable_7cytoolz_9itertoolz__inner_join_key;
  __pyx_vtable_7cytoolz_9itertoolz__inner_join_key.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join;
  __pyx_vtable_7cytoolz_9itertoolz__inner_join_key.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_15_inner_join_key_rightkey;
  __pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_base = __pyx_ptype_7cytoolz_9itertoolz__inner_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__inner_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_inner_join_key", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__inner_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__inner_join_key = &__pyx_type_7cytoolz_9itertoolz__inner_join_key;
  __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index = &__pyx_vtable_7cytoolz_9itertoolz__inner_join_index;
  __pyx_vtable_7cytoolz_9itertoolz__inner_join_index.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join;
  __pyx_vtable_7cytoolz_9itertoolz__inner_join_index.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_17_inner_join_index_rightkey;
  __pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_base = __pyx_ptype_7cytoolz_9itertoolz__inner_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__inner_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_inner_join_index", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__inner_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__inner_join_index = &__pyx_type_7cytoolz_9itertoolz__inner_join_index;
  __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices = &__pyx_vtable_7cytoolz_9itertoolz__inner_join_indices;
  __pyx_vtable_7cytoolz_9itertoolz__inner_join_indices.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join;
  __pyx_vtable_7cytoolz_9itertoolz__inner_join_indices.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_19_inner_join_indices_rightkey;
  __pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_base = __pyx_ptype_7cytoolz_9itertoolz__inner_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__inner_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_inner_join_indices", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__inner_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__inner_join_indices = &__pyx_type_7cytoolz_9itertoolz__inner_join_indices;
  __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key = &__pyx_vtable_7cytoolz_9itertoolz__right_outer_join_key;
  __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_key.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_key.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_21_right_outer_join_key_rightkey;
  __pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_base = __pyx_ptype_7cytoolz_9itertoolz__right_outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__right_outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_right_outer_join_key", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key = &__pyx_type_7cytoolz_9itertoolz__right_outer_join_key;
  __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index = &__pyx_vtable_7cytoolz_9itertoolz__right_outer_join_index;
  __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_index.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_index.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_23_right_outer_join_index_rightkey;
  __pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_base = __pyx_ptype_7cytoolz_9itertoolz__right_outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__right_outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_right_outer_join_index", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index = &__pyx_type_7cytoolz_9itertoolz__right_outer_join_index;
  __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices = &__pyx_vtable_7cytoolz_9itertoolz__right_outer_join_indices;
  __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_indices.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_indices.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_25_right_outer_join_indices_rightkey;
  __pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_base = __pyx_ptype_7cytoolz_9itertoolz__right_outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_right_outer_join_indices", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices = &__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices;
  __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key = &__pyx_vtable_7cytoolz_9itertoolz__left_outer_join_key;
  __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_key.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_key.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_20_left_outer_join_key_rightkey;
  __pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_base = __pyx_ptype_7cytoolz_9itertoolz__left_outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__left_outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_left_outer_join_key", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key = &__pyx_type_7cytoolz_9itertoolz__left_outer_join_key;
  __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index = &__pyx_vtable_7cytoolz_9itertoolz__left_outer_join_index;
  __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_index.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_index.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_22_left_outer_join_index_rightkey;
  __pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_base = __pyx_ptype_7cytoolz_9itertoolz__left_outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__left_outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_left_outer_join_index", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index = &__pyx_type_7cytoolz_9itertoolz__left_outer_join_index;
  __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices = &__pyx_vtable_7cytoolz_9itertoolz__left_outer_join_indices;
  __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_indices.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_indices.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_24_left_outer_join_indices_rightkey;
  __pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_base = __pyx_ptype_7cytoolz_9itertoolz__left_outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_left_outer_join_indices", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices = &__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices;
  __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key = &__pyx_vtable_7cytoolz_9itertoolz__outer_join_key;
  __pyx_vtable_7cytoolz_9itertoolz__outer_join_key.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__outer_join_key.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_15_outer_join_key_rightkey;
  __pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_base = __pyx_ptype_7cytoolz_9itertoolz__outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_outer_join_key", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__outer_join_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__outer_join_key = &__pyx_type_7cytoolz_9itertoolz__outer_join_key;
  __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index = &__pyx_vtable_7cytoolz_9itertoolz__outer_join_index;
  __pyx_vtable_7cytoolz_9itertoolz__outer_join_index.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__outer_join_index.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_17_outer_join_index_rightkey;
  __pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_base = __pyx_ptype_7cytoolz_9itertoolz__outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_outer_join_index", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__outer_join_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__outer_join_index = &__pyx_type_7cytoolz_9itertoolz__outer_join_index;
  __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices = &__pyx_vtable_7cytoolz_9itertoolz__outer_join_indices;
  __pyx_vtable_7cytoolz_9itertoolz__outer_join_indices.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join;
  __pyx_vtable_7cytoolz_9itertoolz__outer_join_indices.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_19_outer_join_indices_rightkey;
  __pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_base = __pyx_ptype_7cytoolz_9itertoolz__outer_join;
  if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_outer_join_indices", (PyObject *)&__pyx_type_7cytoolz_9itertoolz__outer_join_indices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cytoolz_9itertoolz__outer_join_indices = &__pyx_type_7cytoolz_9itertoolz__outer_join_indices;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "cytoolz/itertoolz.pyx":14
 * from .cpython cimport PtrIter_Next, PtrObject_GetItem
 * 
 * from heapq import heapify, heappop, heapreplace             # <<<<<<<<<<<<<<
 * from itertools import chain, islice
 * from operator import itemgetter
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_heapify);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heapify);
  __Pyx_GIVEREF(__pyx_n_s_heapify);
  __Pyx_INCREF(__pyx_n_s_heappop);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_heappop);
  __Pyx_GIVEREF(__pyx_n_s_heappop);
  __Pyx_INCREF(__pyx_n_s_heapreplace);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_heapreplace);
  __Pyx_GIVEREF(__pyx_n_s_heapreplace);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __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_heapify); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_heapify, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappop, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heapreplace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_heapreplace, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":15
 * 
 * from heapq import heapify, heappop, heapreplace
 * from itertools import chain, islice             # <<<<<<<<<<<<<<
 * from operator import itemgetter
 * from .compatibility import map, zip, zip_longest
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_chain);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_chain);
  __Pyx_GIVEREF(__pyx_n_s_chain);
  __Pyx_INCREF(__pyx_n_s_islice);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_islice);
  __Pyx_GIVEREF(__pyx_n_s_islice);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __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_chain); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chain, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_islice); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_islice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":16
 * from heapq import heapify, heappop, heapreplace
 * from itertools import chain, islice
 * from operator import itemgetter             # <<<<<<<<<<<<<<
 * from .compatibility import map, zip, zip_longest
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_itemgetter);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_itemgetter);
  __Pyx_GIVEREF(__pyx_n_s_itemgetter);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_operator, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __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_itemgetter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itemgetter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":17
 * from itertools import chain, islice
 * from operator import itemgetter
 * from .compatibility import map, zip, zip_longest             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_map);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_map);
  __Pyx_GIVEREF(__pyx_n_s_map);
  __Pyx_INCREF(__pyx_n_s_zip);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_zip);
  __Pyx_GIVEREF(__pyx_n_s_zip);
  __Pyx_INCREF(__pyx_n_s_zip_longest);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_zip_longest);
  __Pyx_GIVEREF(__pyx_n_s_zip_longest);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_compatibility, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __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_map); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_map, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_zip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_zip, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_zip_longest); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_zip_longest, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":20
 * 
 * 
 * __all__ = ['remove', 'accumulate', 'groupby', 'merge_sorted', 'interleave',             # <<<<<<<<<<<<<<
 *            'unique', 'isiterable', 'isdistinct', 'take', 'drop', 'take_nth',
 *            'first', 'second', 'nth', 'last', 'get', 'concat', 'concatv',
 */
  __pyx_t_1 = PyList_New(30); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_remove);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_remove);
  __Pyx_GIVEREF(__pyx_n_s_remove);
  __Pyx_INCREF(__pyx_n_s_accumulate);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_accumulate);
  __Pyx_GIVEREF(__pyx_n_s_accumulate);
  __Pyx_INCREF(__pyx_n_s_groupby);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_groupby);
  __Pyx_GIVEREF(__pyx_n_s_groupby);
  __Pyx_INCREF(__pyx_n_s_merge_sorted);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_merge_sorted);
  __Pyx_GIVEREF(__pyx_n_s_merge_sorted);
  __Pyx_INCREF(__pyx_n_s_interleave);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_interleave);
  __Pyx_GIVEREF(__pyx_n_s_interleave);
  __Pyx_INCREF(__pyx_n_s_unique);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_unique);
  __Pyx_GIVEREF(__pyx_n_s_unique);
  __Pyx_INCREF(__pyx_n_s_isiterable);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_isiterable);
  __Pyx_GIVEREF(__pyx_n_s_isiterable);
  __Pyx_INCREF(__pyx_n_s_isdistinct);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_isdistinct);
  __Pyx_GIVEREF(__pyx_n_s_isdistinct);
  __Pyx_INCREF(__pyx_n_s_take);
  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_take);
  __Pyx_GIVEREF(__pyx_n_s_take);
  __Pyx_INCREF(__pyx_n_s_drop);
  PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_drop);
  __Pyx_GIVEREF(__pyx_n_s_drop);
  __Pyx_INCREF(__pyx_n_s_take_nth);
  PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_take_nth);
  __Pyx_GIVEREF(__pyx_n_s_take_nth);
  __Pyx_INCREF(__pyx_n_s_first);
  PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_s_first);
  __Pyx_GIVEREF(__pyx_n_s_first);
  __Pyx_INCREF(__pyx_n_s_second);
  PyList_SET_ITEM(__pyx_t_1, 12, __pyx_n_s_second);
  __Pyx_GIVEREF(__pyx_n_s_second);
  __Pyx_INCREF(__pyx_n_s_nth);
  PyList_SET_ITEM(__pyx_t_1, 13, __pyx_n_s_nth);
  __Pyx_GIVEREF(__pyx_n_s_nth);
  __Pyx_INCREF(__pyx_n_s_last);
  PyList_SET_ITEM(__pyx_t_1, 14, __pyx_n_s_last);
  __Pyx_GIVEREF(__pyx_n_s_last);
  __Pyx_INCREF(__pyx_n_s_get);
  PyList_SET_ITEM(__pyx_t_1, 15, __pyx_n_s_get);
  __Pyx_GIVEREF(__pyx_n_s_get);
  __Pyx_INCREF(__pyx_n_s_concat);
  PyList_SET_ITEM(__pyx_t_1, 16, __pyx_n_s_concat);
  __Pyx_GIVEREF(__pyx_n_s_concat);
  __Pyx_INCREF(__pyx_n_s_concatv);
  PyList_SET_ITEM(__pyx_t_1, 17, __pyx_n_s_concatv);
  __Pyx_GIVEREF(__pyx_n_s_concatv);
  __Pyx_INCREF(__pyx_n_s_mapcat);
  PyList_SET_ITEM(__pyx_t_1, 18, __pyx_n_s_mapcat);
  __Pyx_GIVEREF(__pyx_n_s_mapcat);
  __Pyx_INCREF(__pyx_n_s_cons);
  PyList_SET_ITEM(__pyx_t_1, 19, __pyx_n_s_cons);
  __Pyx_GIVEREF(__pyx_n_s_cons);
  __Pyx_INCREF(__pyx_n_s_interpose);
  PyList_SET_ITEM(__pyx_t_1, 20, __pyx_n_s_interpose);
  __Pyx_GIVEREF(__pyx_n_s_interpose);
  __Pyx_INCREF(__pyx_n_s_frequencies);
  PyList_SET_ITEM(__pyx_t_1, 21, __pyx_n_s_frequencies);
  __Pyx_GIVEREF(__pyx_n_s_frequencies);
  __Pyx_INCREF(__pyx_n_s_reduceby);
  PyList_SET_ITEM(__pyx_t_1, 22, __pyx_n_s_reduceby);
  __Pyx_GIVEREF(__pyx_n_s_reduceby);
  __Pyx_INCREF(__pyx_n_s_iterate);
  PyList_SET_ITEM(__pyx_t_1, 23, __pyx_n_s_iterate);
  __Pyx_GIVEREF(__pyx_n_s_iterate);
  __Pyx_INCREF(__pyx_n_s_sliding_window);
  PyList_SET_ITEM(__pyx_t_1, 24, __pyx_n_s_sliding_window);
  __Pyx_GIVEREF(__pyx_n_s_sliding_window);
  __Pyx_INCREF(__pyx_n_s_partition);
  PyList_SET_ITEM(__pyx_t_1, 25, __pyx_n_s_partition);
  __Pyx_GIVEREF(__pyx_n_s_partition);
  __Pyx_INCREF(__pyx_n_s_partition_all);
  PyList_SET_ITEM(__pyx_t_1, 26, __pyx_n_s_partition_all);
  __Pyx_GIVEREF(__pyx_n_s_partition_all);
  __Pyx_INCREF(__pyx_n_s_count);
  PyList_SET_ITEM(__pyx_t_1, 27, __pyx_n_s_count);
  __Pyx_GIVEREF(__pyx_n_s_count);
  __Pyx_INCREF(__pyx_n_s_pluck);
  PyList_SET_ITEM(__pyx_t_1, 28, __pyx_n_s_pluck);
  __Pyx_GIVEREF(__pyx_n_s_pluck);
  __Pyx_INCREF(__pyx_n_s_join);
  PyList_SET_ITEM(__pyx_t_1, 29, __pyx_n_s_join);
  __Pyx_GIVEREF(__pyx_n_s_join);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":28
 * 
 * 
 * concatv = chain             # <<<<<<<<<<<<<<
 * concat = chain.from_iterable
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_chain); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_concatv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "cytoolz/itertoolz.pyx":29
 * 
 * concatv = chain
 * concat = chain.from_iterable             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_chain); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_from_iterable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":278
 * 
 * 
 * def merge_sorted(*seqs, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Merge and sort a collection of sorted collections
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_5merge_sorted, NULL, __pyx_n_s_cytoolz_itertoolz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_merge_sorted, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":405
 * 
 * 
 * cpdef object unique(object seq, object key=identity):             # <<<<<<<<<<<<<<
 *     """
 *     Return only unique elements of a sequence
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_identity); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_ = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":547
 * 
 * 
 * no_default = '__no__default__'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_no_default, __pyx_n_s_no__default) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cytoolz/itertoolz.pyx":574
 * 
 * 
 * cdef tuple _get_exceptions = (IndexError, KeyError, TypeError)             # <<<<<<<<<<<<<<
 * cdef tuple _get_list_exc = (IndexError, KeyError)
 * 
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_IndexError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_IndexError);
  __Pyx_GIVEREF(__pyx_builtin_IndexError);
  __Pyx_INCREF(__pyx_builtin_KeyError);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_builtin_KeyError);
  __Pyx_INCREF(__pyx_builtin_TypeError);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_builtin_TypeError);
  __Pyx_GIVEREF(__pyx_builtin_TypeError);
  __Pyx_XGOTREF(__pyx_v_7cytoolz_9itertoolz__get_exceptions);
  __Pyx_DECREF_SET(__pyx_v_7cytoolz_9itertoolz__get_exceptions, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":575
 * 
 * cdef tuple _get_exceptions = (IndexError, KeyError, TypeError)
 * cdef tuple _get_list_exc = (IndexError, KeyError)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_IndexError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_IndexError);
  __Pyx_GIVEREF(__pyx_builtin_IndexError);
  __Pyx_INCREF(__pyx_builtin_KeyError);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_builtin_KeyError);
  __Pyx_XGOTREF(__pyx_v_7cytoolz_9itertoolz__get_list_exc);
  __Pyx_DECREF_SET(__pyx_v_7cytoolz_9itertoolz__get_list_exc, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":578
 * 
 * 
 * cpdef object get(object ind, object seq, object default=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     Get element in a sequence or dict
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__3 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":740
 * 
 * 
 * cpdef dict reduceby(object key, object binop, object seq, object init=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     Perform a simultaneous groupby and reduction
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__4 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":900
 * 
 * 
 * no_pad = '__no__pad__'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_no_pad, __pyx_n_s_no__pad) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "cytoolz/itertoolz.pyx":903
 * 
 * 
 * cpdef object partition(Py_ssize_t n, object seq, object pad=no_pad):             # <<<<<<<<<<<<<<
 *     """
 *     Partition sequence into tuples of length n
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_pad); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__5 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1075
 * 
 * 
 * cpdef object pluck(object ind, object seqs, object default=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     plucks an element or several elements from each item in a sequence.
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__6 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1113
 * cpdef object join(object leftkey, object leftseq,
 *                   object rightkey, object rightseq,
 *                   object left_default=no_default,             # <<<<<<<<<<<<<<
 *                   object right_default=no_default):
 *     """
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__7 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1114
 *                   object rightkey, object rightseq,
 *                   object left_default=no_default,
 *                   object right_default=no_default):             # <<<<<<<<<<<<<<
 *     """
 *     Join two sequences on common attributes
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__8 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1213
 *                   object leftkey, object leftseq,
 *                   object rightkey, object rightseq,
 *                   object left_default=no_default,             # <<<<<<<<<<<<<<
 *                   object right_default=no_default):
 *         self.left_default = left_default
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__9 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1214
 *                   object rightkey, object rightseq,
 *                   object left_default=no_default,
 *                   object right_default=no_default):             # <<<<<<<<<<<<<<
 *         self.left_default = left_default
 *         self.right_default = right_default
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__10 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "cytoolz/itertoolz.pyx":1
 * #cython: embedsignature=True             # <<<<<<<<<<<<<<
 * from cpython.dict cimport PyDict_GetItem, PyDict_SetItem
 * from cpython.exc cimport (PyErr_Clear, PyErr_ExceptionMatches,
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_groupby_line_110, __pyx_kp_u_Group_a_collection_by_a_key_fun) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_merge_sorted_line_278, __pyx_kp_u_Merge_and_sort_a_collection_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_unique_line_405, __pyx_kp_u_Return_only_unique_elements_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_isiterable_line_425, __pyx_kp_u_Is_x_iterable_isiterable_1_2_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_isdistinct_line_444, __pyx_kp_u_All_values_in_sequence_are_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_take_line_469, __pyx_kp_u_The_first_n_elements_of_a_seque) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_drop_line_479, __pyx_kp_u_The_sequence_following_the_firs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_take_nth_line_499, __pyx_kp_u_Every_nth_item_in_seq_list_take) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_first_line_509, __pyx_kp_u_The_first_element_in_a_sequence) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_second_line_519, __pyx_kp_u_The_second_element_in_a_sequenc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_nth_line_531, __pyx_kp_u_The_nth_element_in_a_sequence_n) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_last_line_550, __pyx_kp_u_The_last_element_in_a_sequence) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_get_line_578, __pyx_kp_u_Get_element_in_a_sequence_or_di) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_mapcat_line_654, __pyx_kp_u_Apply_func_to_each_sequence_in) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cons_line_665, __pyx_kp_u_Add_el_to_beginning_of_possibly) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_frequencies_line_705, __pyx_kp_u_Find_number_of_occurrences_of_e) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_reduceby_line_740, __pyx_kp_u_Perform_a_simultaneous_groupby) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_partition_line_903, __pyx_kp_u_Partition_sequence_into_tuples) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_pluck_line_1075, __pyx_kp_u_plucks_an_element_or_several_el) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_join_line_1111, __pyx_kp_u_Join_two_sequences_on_common_at) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    __Pyx_AddTraceback("init cytoolz.itertoolz", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init cytoolz.itertoolz");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#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 /* CYTHON_REFNANNY */

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;
}

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);
}

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
}

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;
}

static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
    iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(!iternext)) {
#else
    if (unlikely(!iternext) || unlikely(!PyIter_Check(iterator))) {
#endif
        PyErr_Format(PyExc_TypeError,
            "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
        return NULL;
    }
    next = iternext(iterator);
    if (likely(next))
        return next;
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_VERSION_HEX >= 0x02070000
    if (unlikely(iternext == &_PyObject_NextNotImplemented))
        return NULL;
#endif
#endif
    if (defval) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
            if (unlikely(exc_type != PyExc_StopIteration) &&
                    !PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))
                return NULL;
            PyErr_Clear();
        }
        Py_INCREF(defval);
        return defval;
    }
    if (!PyErr_Occurred())
        PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}

#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

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

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;
}

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,
                                                              int wraparound, 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,
                                                              int wraparound, 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, int wraparound, 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))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            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));
}

static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return -1;
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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;
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    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);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    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_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
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) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        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) {
        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);
        }
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

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;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

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;
}

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; /* try absolute import on failure */
        }
        #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;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 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 long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((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);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
    {                                                                     \
        func_type value = func(x);                                        \
        if (sizeof(target_type) < sizeof(func_type)) {                    \
            if (unlikely(value != (func_type) (target_type) value)) {     \
                func_type zero = 0;                                       \
                PyErr_SetString(PyExc_OverflowError,                      \
                    (is_unsigned && unlikely(value < zero)) ?             \
                    "can't convert negative value to " #target_type :     \
                    "value too large to convert to " #target_type);       \
                return (target_type) -1;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = 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)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long) -1;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long) -1;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
            }
        }
        {
#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_Int(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_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 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)
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to int");
                return (int) -1;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(int)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to int");
                return (int) -1;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(int)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
                }
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
            }
        }
        {
#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_Int(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_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

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;
}

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

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

#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,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __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,      /*int firstlineno,*/
        __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;
    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*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);
}

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  /* Python 3+ has unicode identifiers */
        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 __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 /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else /* PY_VERSION_HEX < 0x03030000 */
        if (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 /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
        return PyUnicode_AsUTF8AndSize(o, length);
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
#endif /* PY_VERSION_HEX < 0x03030000 */
    } else
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
#if !CYTHON_COMPILING_IN_PYPY
    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_Int(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 Py_INCREF(x), 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)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #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 */
